|
QWT 7.0.1
|
A class representing an interval. More...
#include <qwt_interval.h>
Public Types | |
| enum | BorderFlag { IncludeBorders = 0x00 , ExcludeMinimum = 0x01 , ExcludeMaximum = 0x02 , ExcludeBorders = ExcludeMinimum | ExcludeMaximum } |
| Flag indicating if a border is included or excluded. More... | |
Public Member Functions | |
| QwtInterval () | |
| Border flags. | |
| QwtInterval (double minValue, double maxValue, BorderFlags=IncludeBorders) | |
| Constructor. | |
| void | setInterval (double minValue, double maxValue, BorderFlags=IncludeBorders) |
| Assign the limits of the interval. | |
| QwtInterval | normalized () const |
| Normalize the limits of the interval. | |
| QwtInterval | inverted () const |
| Invert the limits of the interval. | |
| QwtInterval | limited (double lowerBound, double upperBound) const |
| Limit the interval, keeping the border modes. | |
| bool | operator== (const QwtInterval &) const |
| Compare two intervals. | |
| bool | operator!= (const QwtInterval &) const |
| Compare two intervals. | |
| void | setBorderFlags (BorderFlags) |
| Change the border flags. | |
| BorderFlags | borderFlags () const |
| double | minValue () const |
| double | maxValue () const |
| double | centerValue () const |
| double | width () const |
| Return the width of an interval. | |
| long double | widthL () const |
| Return the width of an interval as long double. | |
| void | setMinValue (double) |
| Assign the lower limit of the interval. | |
| void | setMaxValue (double) |
| Assign the upper limit of the interval. | |
| bool | contains (double value) const |
| Test if a value is inside an interval. | |
| bool | contains (const QwtInterval &) const |
| Test if an interval is inside an interval. | |
| bool | intersects (const QwtInterval &) const |
| Test if two intervals overlap. | |
| QwtInterval | intersect (const QwtInterval &) const |
| Intersect 2 intervals. | |
| QwtInterval | unite (const QwtInterval &) const |
| Unite 2 intervals. | |
| QwtInterval | operator| (const QwtInterval &) const |
| Union of two intervals. | |
| QwtInterval | operator& (const QwtInterval &) const |
| Intersection of two intervals. | |
| QwtInterval & | operator|= (const QwtInterval &) |
| Unite this interval with the given interval. | |
| QwtInterval & | operator&= (const QwtInterval &) |
| Intersect this interval with the given interval. | |
| QwtInterval | extend (double value) const |
| Extend the interval. | |
| QwtInterval | operator| (double) const |
| Extend an interval. | |
| QwtInterval & | operator|= (double) |
| Extend an interval. | |
| bool | isValid () const |
| A interval is valid when minValue() <= maxValue(). | |
| bool | isNull () const |
| void | invalidate () |
| Invalidate the interval. | |
| QwtInterval | symmetrize (double value) const |
| Adjust the limit that is closer to value, so that value becomes the center of the interval. | |
A class representing an interval.
The interval is represented by 2 doubles, the lower and the upper limit.
Flag indicating if a border is included or excluded.
|
inline |
Border flags.
Default Constructor.
Creates an invalid interval [0.0, -1.0]
|
inline |
Constructor.
Build an interval with from min/max values
| minValue | Minimum value |
| maxValue | Maximum value |
| borderFlags | Include/Exclude borders |
|
inline |
|
inline |
| bool QwtInterval::contains | ( | const QwtInterval & | interval | ) | const |
Test if an interval is inside an interval.
| interval | Interval |
| 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.
| other | Interval to be intersect with |
| bool QwtInterval::intersects | ( | const QwtInterval & | other | ) | const |
Test if two intervals overlap.
| other | Interval |
|
inline |
| QwtInterval QwtInterval::inverted | ( | ) | const |
|
inline |
|
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 |
|
inline |
|
inline |
| QwtInterval QwtInterval::normalized | ( | ) | const |
Normalize the limits of the interval.
If maxValue() < minValue() the limits will be inverted.
|
inline |
Compare two intervals.
| other | Interval to compare with |
|
inline |
Intersection of two intervals.
| other | Interval to intersect with |
| QwtInterval & QwtInterval::operator&= | ( | const QwtInterval & | other | ) |
Intersect this interval with the given interval.
| other | Interval to be intersected with |
|
inline |
Compare two intervals.
| other | Interval to compare with |
|
inline |
Union of two intervals.
| other | Interval to unite with |
|
inline |
| QwtInterval & QwtInterval::operator|= | ( | const QwtInterval & | other | ) |
Unite this interval with the given interval.
| other | Interval to be united with |
| QwtInterval & QwtInterval::operator|= | ( | double | value | ) |
Extend an interval.
| value | Value |
|
inline |
|
inline |
Assign the limits of the interval.
| minValue | Minimum value |
| maxValue | Maximum value |
| borderFlags | Include/Exclude borders |
|
inline |
Assign the upper limit of the interval.
| maxValue | Maximum value |
|
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 |
|
inline |
Return the width of an interval.
The width of invalid intervals is 0.0, otherwise the result is maxValue() - minValue().
|
inline |
Return the width of an interval as long double.
The width of invalid intervals is 0.0, otherwise the result is maxValue() - minValue().