Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_interval.h


Ignore:
Timestamp:
May 10, 2017, 3:20:54 PM (7 years ago)
Author:
stoecker
Message:

update qwt and qwtpolar, many QT5 fixes (unfinished)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_interval.h

    r4271 r8127  
    1212
    1313#include "qwt_global.h"
     14#include <qmetatype.h>
     15
    1416#ifndef QT_NO_DEBUG_STREAM
    1517#include <qdebug.h>
     
    200202
    201203/*!
    202    Return the width of an interval
    203    The width of invalid intervals is 0.0, otherwise the result is
    204    maxValue() - minValue().
    205 
    206    \sa isValid()
    207 */
    208 inline double QwtInterval::width() const
    209 {
    210     return isValid() ? ( d_maxValue - d_minValue ) : 0.0;
    211 }
    212 
    213 /*!
    214    Intersection of two intervals
    215    \sa intersect()
    216 */
    217 inline QwtInterval QwtInterval::operator&(
    218     const QwtInterval &interval ) const
    219 {
    220     return intersect( interval );
    221 }
    222 
    223 /*!
    224    Union of two intervals
    225    \sa unite()
    226 */
    227 inline QwtInterval QwtInterval::operator|(
    228     const QwtInterval &interval ) const
    229 {
    230     return unite( interval );
    231 }
    232 
    233 //! Compare two intervals
    234 inline bool QwtInterval::operator==( const QwtInterval &other ) const
    235 {
    236     return ( d_minValue == other.d_minValue ) &&
    237            ( d_maxValue == other.d_maxValue ) &&
    238            ( d_borderFlags == other.d_borderFlags );
    239 }
    240 
    241 //! Compare two intervals
    242 inline bool QwtInterval::operator!=( const QwtInterval &other ) const
    243 {
    244     return ( !( *this == other ) );
    245 }
    246 
    247 /*!
    248    Extend an interval
    249 
    250    \param value Value
    251    \return Extended interval
    252    \sa extend()
    253 */
    254 inline QwtInterval QwtInterval::operator|( double value ) const
    255 {
    256     return extend( value );
    257 }
    258 
    259 //! \return true, if isValid() && (minValue() >= maxValue())
    260 inline bool QwtInterval::isNull() const
    261 {
    262     return isValid() && d_minValue >= d_maxValue;
    263 }
    264 
    265 /*!
    266204   A interval is valid when minValue() <= maxValue().
    267205   In case of QwtInterval::ExcludeBorders it is true
    268206   when minValue() < maxValue()
     207
     208   \return True, when the interval is valid
    269209*/
    270210inline bool QwtInterval::isValid() const
     
    277217
    278218/*!
     219   \brief Return the width of an interval
     220
     221   The width of invalid intervals is 0.0, otherwise the result is
     222   maxValue() - minValue().
     223
     224   \return Interval width
     225   \sa isValid()
     226*/
     227inline double QwtInterval::width() const
     228{
     229    return isValid() ? ( d_maxValue - d_minValue ) : 0.0;
     230}
     231
     232/*!
     233   \brief Intersection of two intervals
     234 
     235   \param other Interval to intersect with
     236   \return Intersection of this and other
     237
     238   \sa intersect()
     239*/
     240inline QwtInterval QwtInterval::operator&(
     241    const QwtInterval &other ) const
     242{
     243    return intersect( other );
     244}
     245
     246/*!
     247   Union of two intervals
     248
     249   \param other Interval to unite with
     250   \return Union of this and other
     251
     252   \sa unite()
     253*/
     254inline QwtInterval QwtInterval::operator|(
     255    const QwtInterval &other ) const
     256{
     257    return unite( other );
     258}
     259
     260/*!
     261   \brief Compare two intervals
     262
     263   \param other Interval to compare with
     264   \return True, when this and other are equal
     265*/
     266inline bool QwtInterval::operator==( const QwtInterval &other ) const
     267{
     268    return ( d_minValue == other.d_minValue ) &&
     269           ( d_maxValue == other.d_maxValue ) &&
     270           ( d_borderFlags == other.d_borderFlags );
     271}
     272/*!
     273   \brief Compare two intervals
     274
     275   \param other Interval to compare with
     276   \return True, when this and other are not equal
     277*/
     278inline bool QwtInterval::operator!=( const QwtInterval &other ) const
     279{
     280    return ( !( *this == other ) );
     281}
     282
     283/*!
     284   Extend an interval
     285
     286   \param value Value
     287   \return Extended interval
     288   \sa extend()
     289*/
     290inline QwtInterval QwtInterval::operator|( double value ) const
     291{
     292    return extend( value );
     293}
     294
     295//! \return true, if isValid() && (minValue() >= maxValue())
     296inline bool QwtInterval::isNull() const
     297{
     298    return isValid() && d_minValue >= d_maxValue;
     299}
     300
     301/*!
    279302  Invalidate the interval
    280303
     
    289312
    290313Q_DECLARE_OPERATORS_FOR_FLAGS( QwtInterval::BorderFlags )
     314Q_DECLARE_METATYPE( QwtInterval )
    291315
    292316#ifndef QT_NO_DEBUG_STREAM
Note: See TracChangeset for help on using the changeset viewer.