Qwtdoubleinterval -
#include <qwt_double_interval.h>
enum BorderMode { IncludeBorders = 0, ExcludeMinimum = 1, ExcludeMaximum = 2, ExcludeBorders = ExcludeMinimum | ExcludeMaximum }
QwtDoubleInterval ()
QwtDoubleInterval (double minValue, double maxValue, int borderFlags=IncludeBorders)
int borderFlags () const
bool contains (double value) const
QwtDoubleInterval extend (double value) const
QwtDoubleInterval intersect (const QwtDoubleInterval &) const
bool intersects (const QwtDoubleInterval &) const
void invalidate ()
QwtDoubleInterval inverted () const
bool isNull () const
bool isValid () const
QwtDoubleInterval limited (double minValue, double maxValue) const
double maxValue () const
double minValue () const
QwtDoubleInterval normalized () const
int operator!= (const QwtDoubleInterval &) const
QwtDoubleInterval operator& (const QwtDoubleInterval &) const
QwtDoubleInterval & operator&= (const QwtDoubleInterval &)
int operator== (const QwtDoubleInterval &) const
QwtDoubleInterval operator| (const QwtDoubleInterval &) const
QwtDoubleInterval operator| (double) const
QwtDoubleInterval & operator|= (const QwtDoubleInterval &)
QwtDoubleInterval & operator|= (double)
void setBorderFlags (int)
void setInterval (double minValue, double maxValue, int borderFlags=IncludeBorders)
void setMaxValue (double)
void setMinValue (double)
QwtDoubleInterval symmetrize (double value) const
QwtDoubleInterval unite (const QwtDoubleInterval &) const
double width () const
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/excluded from an interval
IncludeBorders
min/max values are inside the interval
ExcludeMinimum
min value is not included in the interval
ExcludeMaximum
max value is not included in the interval
ExcludeBorders
min/max values are not included in the interval
See also:
setBorderMode(), testBorderMode()
Default Constructor. Creates an invalid interval [0.0, -1.0]
See also:
setInterval(), isValid()
Constructor
Build an interval with from min/max values
Parameters:
minValue Minimum value
maxValue Maximum value
borderFlags Include/Exclude borders
Returns:
Border flags
See also:
setBorderFlags()
Test if a value is inside an interval
Parameters:
value Value
Returns:
true, if value >= minValue() && value <= maxValue()
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
Parameters:
value Value
See also:
isValid()
Test if two intervals overlap
Invalidate the interval
The limits are set to interval [0.0, -1.0]
See also:
isValid()
Invert the limits of the interval
Returns:
Inverted interval
See also:
normalized()
Returns:
true, if isValid() && (minValue() >= maxValue())
A interval is valid when minValue() <= maxValue(). In case of QwtDoubleInterval::ExcludeBorders it is true when minValue() < maxValue()
Limit the interval, keeping the border modes
Parameters:
lowerBound Lower limit
upperBound Upper limit
Returns:
Limited interval
Returns:
Upper limit of the interval
Returns:
Lower limit of the interval
Normalize the limits of the interval. If maxValue() < minValue() the limits will be inverted.
Returns:
Normalized interval
See also:
isValid(), inverted()
Intersection of two intervals
See also:
intersect()
Union of two intervals
See also:
unite()
Extend an interval
See also:
extend()
Change the border flags
Parameters:
borderFlags Or'd BorderMode flags
See also:
borderFlags()
Assign the limits of the interval
Parameters:
minValue Minimum value
maxValue Maximum value
borderFlags Include/Exclude borders
Assign the upper limit of the interval
Parameters:
maxValue Maximum value
Assign the lower limit of the interval
Parameters:
minValue Minimum value
Adjust the limit that is closer to value, so that value becomes the center of the interval.
Parameters:
value Center
Returns:
Interval with value as center
Return the width of an interval The width of invalid intervals is 0.0, otherwise the result is maxValue() - minValue().
See also:
isValid()
Generated automatically by Doxygen for Qwt User's Guide from the source code.