10 #ifndef QWT_INTERVAL_H
11 #define QWT_INTERVAL_H
13 #include "qwt_global.h"
14 #include <qmetatype.h>
16 #ifndef QT_NO_DEBUG_STREAM
36 IncludeBorders = 0x00,
39 ExcludeMinimum = 0x01,
42 ExcludeMaximum = 0x02,
45 ExcludeBorders = ExcludeMinimum | ExcludeMaximum
55 void setInterval(
double minValue,
double maxValue,
60 QwtInterval limited(
double lowerBound,
double upperBound )
const;
68 double minValue()
const;
69 double maxValue()
const;
73 void setMinValue(
double );
74 void setMaxValue(
double );
76 bool contains(
double value )
const;
115 d_borderFlags( IncludeBorders )
129 double minValue,
double maxValue,
BorderFlags borderFlags ):
130 d_minValue( minValue ),
131 d_maxValue( maxValue ),
132 d_borderFlags( borderFlags )
144 double minValue,
double maxValue,
BorderFlags borderFlags )
168 return d_borderFlags;
213 return d_minValue <= d_maxValue;
215 return d_minValue < d_maxValue;
229 return isValid() ? ( d_maxValue - d_minValue ) : 0.0;
257 return unite( other );
268 return ( d_minValue == other.d_minValue ) &&
269 ( d_maxValue == other.d_maxValue ) &&
270 ( d_borderFlags == other.d_borderFlags );
280 return ( !( *
this == other ) );
298 return isValid() && d_minValue >= d_maxValue;
316 #ifndef QT_NO_DEBUG_STREAM
317 QWT_EXPORT QDebug operator<<( QDebug,
const QwtInterval & );
bool operator!=(const QwtInterval &) const
Compare two intervals.
Definition: qwt_interval.h:278
void invalidate()
Definition: qwt_interval.h:307
QwtInterval operator&(const QwtInterval &) const
Intersection of two intervals.
Definition: qwt_interval.h:240
void setMinValue(double)
Definition: qwt_interval.h:176
QwtInterval()
Default Constructor.
Definition: qwt_interval.h:112
@ ExcludeBorders
Min/Max values are not included in the interval.
Definition: qwt_interval.h:45
void setInterval(double minValue, double maxValue, BorderFlags=IncludeBorders)
Definition: qwt_interval.h:143
QwtInterval extend(double value) const
Extend the interval.
Definition: qwt_interval.cpp:316
BorderFlag
Definition: qwt_interval.h:34
double minValue() const
Definition: qwt_interval.h:192
void setMaxValue(double)
Definition: qwt_interval.h:186
BorderFlags borderFlags() const
Definition: qwt_interval.h:166
bool isValid() const
Definition: qwt_interval.h:210
QwtInterval unite(const QwtInterval &) const
Unite 2 intervals.
Definition: qwt_interval.cpp:76
bool operator==(const QwtInterval &) const
Compare two intervals.
Definition: qwt_interval.h:266
QFlags< BorderFlag > BorderFlags
Border flags.
Definition: qwt_interval.h:49
double width() const
Return the width of an interval.
Definition: qwt_interval.h:227
QwtInterval intersect(const QwtInterval &) const
Intersect 2 intervals.
Definition: qwt_interval.cpp:139
bool isNull() const
Definition: qwt_interval.h:296
A class representing an interval.
Definition: qwt_interval.h:27
QwtInterval operator|(const QwtInterval &) const
Definition: qwt_interval.h:254
double maxValue() const
Definition: qwt_interval.h:198
void setBorderFlags(BorderFlags)
Definition: qwt_interval.h:157