Qwt User's Guide
svn
|
#include <qwt_interval.h>
Public Types | |
enum | BorderFlag { IncludeBorders = 0x00, ExcludeMinimum = 0x01, ExcludeMaximum = 0x02, ExcludeBorders = ExcludeMinimum | ExcludeMaximum } |
typedef QFlags< BorderFlag > | BorderFlags |
Public Member Functions | |
BorderFlags | borderFlags () const |
bool | contains (double value) const |
QwtInterval | extend (double value) const |
QwtInterval | intersect (const QwtInterval &) const |
bool | intersects (const QwtInterval &) const |
void | invalidate () |
QwtInterval | inverted () const |
bool | isNull () const |
bool | isValid () const |
QwtInterval | limited (double minValue, double maxValue) const |
double | maxValue () const |
double | minValue () const |
QwtInterval | normalized () const |
bool | operator!= (const QwtInterval &) const |
QwtInterval | operator& (const QwtInterval &) const |
QwtInterval & | operator&= (const QwtInterval &) |
bool | operator== (const QwtInterval &) const |
QwtInterval | operator| (const QwtInterval &) const |
QwtInterval | operator| (double) const |
QwtInterval & | operator|= (const QwtInterval &) |
QwtInterval & | operator|= (double) |
QwtInterval () | |
QwtInterval (double minValue, double maxValue, BorderFlags=IncludeBorders) | |
void | setBorderFlags (BorderFlags) |
void | setInterval (double minValue, double maxValue, BorderFlags=IncludeBorders) |
void | setMaxValue (double) |
void | setMinValue (double) |
QwtInterval | symmetrize (double value) const |
QwtInterval | unite (const QwtInterval &) const |
double | width () const |
A class representing an interval.
The interval is represented by 2 doubles, the lower and the upper limit.
typedef QFlags<BorderFlag> QwtInterval::BorderFlags |
Border flags.
Flag indicating if a border is included or excluded
QwtInterval::QwtInterval | ( | ) | [inline] |
QwtInterval::QwtInterval | ( | double | minValue, |
double | maxValue, | ||
BorderFlags | borderFlags = IncludeBorders |
||
) | [inline] |
Constructor
Build an interval with from min/max values
minValue | Minimum value |
maxValue | Maximum value |
borderFlags | Include/Exclude borders |
QwtInterval::BorderFlags QwtInterval::borderFlags | ( | ) | const [inline] |
bool QwtInterval::contains | ( | double | value | ) | const |
Test if a value is inside an interval
value | Value |
QwtInterval QwtInterval::extend | ( | double | value | ) | const |
Extend the interval
If value is below minValue, value becomes the lower limit. If value is above maxValue, value becomes the upper limit.
extend has no effect for invalid intervals
value | Value |
QwtInterval QwtInterval::intersect | ( | const QwtInterval & | other | ) | const |
Intersect 2 intervals.
bool QwtInterval::intersects | ( | const QwtInterval & | other | ) | const |
Test if two intervals overlap
void QwtInterval::invalidate | ( | ) | [inline] |
QwtInterval QwtInterval::inverted | ( | ) | const |
bool QwtInterval::isNull | ( | ) | const [inline] |
bool QwtInterval::isValid | ( | ) | const [inline] |
A interval is valid when minValue() <= maxValue(). In case of QwtInterval::ExcludeBorders it is true when minValue() < maxValue()
QwtInterval QwtInterval::limited | ( | double | lowerBound, |
double | upperBound | ||
) | const |
Limit the interval, keeping the border modes
lowerBound | Lower limit |
upperBound | Upper limit |
double QwtInterval::maxValue | ( | ) | const [inline] |
double QwtInterval::minValue | ( | ) | const [inline] |
QwtInterval QwtInterval::normalized | ( | ) | const |
Normalize the limits of the interval.
If maxValue() < minValue() the limits will be inverted.
bool QwtInterval::operator!= | ( | const QwtInterval & | other | ) | const [inline] |
Compare two intervals.
QwtInterval QwtInterval::operator& | ( | const QwtInterval & | interval | ) | const [inline] |
Intersection of two intervals
QwtInterval & QwtInterval::operator&= | ( | const QwtInterval & | interval | ) |
Intersects this interval with the given interval.
bool QwtInterval::operator== | ( | const QwtInterval & | other | ) | const [inline] |
Compare two intervals.
QwtInterval QwtInterval::operator| | ( | const QwtInterval & | interval | ) | const [inline] |
Union of two intervals
QwtInterval QwtInterval::operator| | ( | double | value | ) | const [inline] |
QwtInterval & QwtInterval::operator|= | ( | const QwtInterval & | interval | ) |
Unites this interval with the given interval.
QwtInterval & QwtInterval::operator|= | ( | double | value | ) |
Extend an interval
value | Value |
void QwtInterval::setBorderFlags | ( | BorderFlags | borderFlags | ) | [inline] |
void QwtInterval::setInterval | ( | double | minValue, |
double | maxValue, | ||
BorderFlags | borderFlags = IncludeBorders |
||
) | [inline] |
Assign the limits of the interval
minValue | Minimum value |
maxValue | Maximum value |
borderFlags | Include/Exclude borders |
void QwtInterval::setMaxValue | ( | double | maxValue | ) | [inline] |
Assign the upper limit of the interval
maxValue | Maximum value |
void QwtInterval::setMinValue | ( | double | minValue | ) | [inline] |
Assign the lower limit of the interval
minValue | Minimum value |
QwtInterval QwtInterval::symmetrize | ( | double | value | ) | const |
Adjust the limit that is closer to value, so that value becomes the center of the interval.
value | Center |
QwtInterval QwtInterval::unite | ( | const QwtInterval & | other | ) | const |
Unite 2 intervals.
double QwtInterval::width | ( | ) | const [inline] |
Return the width of an interval The width of invalid intervals is 0.0, otherwise the result is maxValue() - minValue().