Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_interval.h
- Timestamp:
- May 10, 2017, 3:20:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_interval.h
r4271 r8127 12 12 13 13 #include "qwt_global.h" 14 #include <qmetatype.h> 15 14 16 #ifndef QT_NO_DEBUG_STREAM 15 17 #include <qdebug.h> … … 200 202 201 203 /*! 202 Return the width of an interval203 The width of invalid intervals is 0.0, otherwise the result is204 maxValue() - minValue().205 206 \sa isValid()207 */208 inline double QwtInterval::width() const209 {210 return isValid() ? ( d_maxValue - d_minValue ) : 0.0;211 }212 213 /*!214 Intersection of two intervals215 \sa intersect()216 */217 inline QwtInterval QwtInterval::operator&(218 const QwtInterval &interval ) const219 {220 return intersect( interval );221 }222 223 /*!224 Union of two intervals225 \sa unite()226 */227 inline QwtInterval QwtInterval::operator|(228 const QwtInterval &interval ) const229 {230 return unite( interval );231 }232 233 //! Compare two intervals234 inline bool QwtInterval::operator==( const QwtInterval &other ) const235 {236 return ( d_minValue == other.d_minValue ) &&237 ( d_maxValue == other.d_maxValue ) &&238 ( d_borderFlags == other.d_borderFlags );239 }240 241 //! Compare two intervals242 inline bool QwtInterval::operator!=( const QwtInterval &other ) const243 {244 return ( !( *this == other ) );245 }246 247 /*!248 Extend an interval249 250 \param value Value251 \return Extended interval252 \sa extend()253 */254 inline QwtInterval QwtInterval::operator|( double value ) const255 {256 return extend( value );257 }258 259 //! \return true, if isValid() && (minValue() >= maxValue())260 inline bool QwtInterval::isNull() const261 {262 return isValid() && d_minValue >= d_maxValue;263 }264 265 /*!266 204 A interval is valid when minValue() <= maxValue(). 267 205 In case of QwtInterval::ExcludeBorders it is true 268 206 when minValue() < maxValue() 207 208 \return True, when the interval is valid 269 209 */ 270 210 inline bool QwtInterval::isValid() const … … 277 217 278 218 /*! 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 */ 227 inline 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 */ 240 inline 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 */ 254 inline 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 */ 266 inline 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 */ 278 inline 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 */ 290 inline QwtInterval QwtInterval::operator|( double value ) const 291 { 292 return extend( value ); 293 } 294 295 //! \return true, if isValid() && (minValue() >= maxValue()) 296 inline bool QwtInterval::isNull() const 297 { 298 return isValid() && d_minValue >= d_maxValue; 299 } 300 301 /*! 279 302 Invalidate the interval 280 303 … … 289 312 290 313 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtInterval::BorderFlags ) 314 Q_DECLARE_METATYPE( QwtInterval ) 291 315 292 316 #ifndef QT_NO_DEBUG_STREAM
Note:
See TracChangeset
for help on using the changeset viewer.