#include <qwt_double_interval.h>
Public Types | |
| enum | BorderMode { IncludeBorders = 0, ExcludeMinimum = 1, ExcludeMaximum = 2, ExcludeBorders = ExcludeMinimum | ExcludeMaximum } |
Public Member Functions | |
| QwtDoubleInterval () | |
| QwtDoubleInterval (double minValue, double maxValue, int borderFlags=IncludeBorders) | |
| void | setInterval (double minValue, double maxValue, int borderFlags=IncludeBorders) |
| QwtDoubleInterval | normalized () const |
| QwtDoubleInterval | inverted () const |
| QwtDoubleInterval | limited (double minValue, double maxValue) const |
| int | operator== (const QwtDoubleInterval &) const |
| int | operator!= (const QwtDoubleInterval &) const |
| void | setBorderFlags (int) |
| int | borderFlags () const |
| double | minValue () const |
| double | maxValue () const |
| double | width () const |
| void | setMinValue (double) |
| void | setMaxValue (double) |
| bool | contains (double value) const |
| bool | intersects (const QwtDoubleInterval &) const |
| QwtDoubleInterval | intersect (const QwtDoubleInterval &) const |
| QwtDoubleInterval | unite (const QwtDoubleInterval &) const |
| QwtDoubleInterval | operator| (const QwtDoubleInterval &) const |
| QwtDoubleInterval | operator& (const QwtDoubleInterval &) const |
| QwtDoubleInterval & | operator|= (const QwtDoubleInterval &) |
| QwtDoubleInterval & | operator&= (const QwtDoubleInterval &) |
| QwtDoubleInterval | extend (double value) const |
| QwtDoubleInterval | operator| (double) const |
| QwtDoubleInterval & | operator|= (double) |
| bool | isValid () const |
| bool | isNull () const |
| void | invalidate () |
| QwtDoubleInterval | symmetrize (double value) const |
The interval is represented by 2 doubles, the lower and the upper limit.
Flag indicating if a border is included/excluded from an interval
| QwtDoubleInterval::QwtDoubleInterval | ( | ) | [inline] |
| QwtDoubleInterval::QwtDoubleInterval | ( | double | minValue, | |
| double | maxValue, | |||
| int | borderFlags = IncludeBorders | |||
| ) | [inline] |
Constructor
Build an interval with from min/max values
| minValue | Minimum value | |
| maxValue | Maximum value | |
| borderFlags | Include/Exclude borders |
| int QwtDoubleInterval::borderFlags | ( | ) | const [inline] |
| bool QwtDoubleInterval::contains | ( | double | value | ) | const |
Test if a value is inside an interval
| value | Value |
| QwtDoubleInterval QwtDoubleInterval::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 |
| QwtDoubleInterval QwtDoubleInterval::intersect | ( | const QwtDoubleInterval & | other | ) | const |
Intersect 2 intervals.
| bool QwtDoubleInterval::intersects | ( | const QwtDoubleInterval & | other | ) | const |
Test if two intervals overlap
| void QwtDoubleInterval::invalidate | ( | ) | [inline] |
| QwtDoubleInterval QwtDoubleInterval::inverted | ( | ) | const |
| bool QwtDoubleInterval::isNull | ( | ) | const [inline] |
| bool QwtDoubleInterval::isValid | ( | ) | const [inline] |
A interval is valid when minValue() <= maxValue(). In case of QwtDoubleInterval::ExcludeBorders it is true when minValue() < maxValue()
| QwtDoubleInterval QwtDoubleInterval::limited | ( | double | lowerBound, | |
| double | upperBound | |||
| ) | const |
Limit the interval, keeping the border modes
| lowerBound | Lower limit | |
| upperBound | Upper limit |
| double QwtDoubleInterval::maxValue | ( | ) | const [inline] |
| double QwtDoubleInterval::minValue | ( | ) | const [inline] |
| QwtDoubleInterval QwtDoubleInterval::normalized | ( | ) | const |
Normalize the limits of the interval.
If maxValue() < minValue() the limits will be inverted.
| int QwtDoubleInterval::operator!= | ( | const QwtDoubleInterval & | other | ) | const [inline] |
Compare two intervals.
| QwtDoubleInterval QwtDoubleInterval::operator& | ( | const QwtDoubleInterval & | interval | ) | const [inline] |
Intersection of two intervals
| QwtDoubleInterval & QwtDoubleInterval::operator&= | ( | const QwtDoubleInterval & | interval | ) |
Intersects this interval with the given interval.
| int QwtDoubleInterval::operator== | ( | const QwtDoubleInterval & | other | ) | const [inline] |
Compare two intervals.
| QwtDoubleInterval QwtDoubleInterval::operator| | ( | double | value | ) | const [inline] |
Extend an interval
| QwtDoubleInterval QwtDoubleInterval::operator| | ( | const QwtDoubleInterval & | interval | ) | const [inline] |
Union of two intervals
| QwtDoubleInterval & QwtDoubleInterval::operator|= | ( | const QwtDoubleInterval & | interval | ) |
Unites this interval with the given interval.
| void QwtDoubleInterval::setBorderFlags | ( | int | borderFlags | ) | [inline] |
| void QwtDoubleInterval::setInterval | ( | double | minValue, | |
| double | maxValue, | |||
| int | borderFlags = IncludeBorders | |||
| ) | [inline] |
Assign the limits of the interval
| minValue | Minimum value | |
| maxValue | Maximum value | |
| borderFlags | Include/Exclude borders |
| void QwtDoubleInterval::setMaxValue | ( | double | maxValue | ) | [inline] |
Assign the upper limit of the interval
| maxValue | Maximum value |
| void QwtDoubleInterval::setMinValue | ( | double | minValue | ) | [inline] |
Assign the lower limit of the interval
| minValue | Minimum value |
| QwtDoubleInterval QwtDoubleInterval::symmetrize | ( | double | value | ) | const |
Adjust the limit that is closer to value, so that value becomes the center of the interval.
| value | Center |
| QwtDoubleInterval QwtDoubleInterval::unite | ( | const QwtDoubleInterval & | other | ) | const |
Unite 2 intervals.
| double QwtDoubleInterval::width | ( | ) | const [inline] |
Return the width of an interval The width of invalid intervals is 0.0, otherwise the result is maxValue() - minValue().
1.5.8