SYNOPSIS

#include <qwt_interval.h>

Public Types

enum BorderFlag { IncludeBorders = 0x00, ExcludeMinimum = 0x01, ExcludeMaximum = 0x02, ExcludeBorders = ExcludeMinimum | ExcludeMaximum }

typedef QFlags< BorderFlag > BorderFlags

Public Member Functions

QwtInterval ()

QwtInterval (double minValue, double maxValue, BorderFlags=IncludeBorders)

void setInterval (double minValue, double maxValue, BorderFlags=IncludeBorders)

QwtInterval normalized () const

QwtInterval inverted () const

QwtInterval limited (double minValue, double maxValue) const

bool operator== (const QwtInterval &) const

bool operator!= (const QwtInterval &) const

void setBorderFlags (BorderFlags)

BorderFlags 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 QwtInterval &) const

QwtInterval intersect (const QwtInterval &) const

QwtInterval unite (const QwtInterval &) const

QwtInterval operator| (const QwtInterval &) const

QwtInterval operator& (const QwtInterval &) const

QwtInterval & operator|= (const QwtInterval &)

QwtInterval & operator&= (const QwtInterval &)

QwtInterval extend (double value) const

QwtInterval operator| (double) const

QwtInterval & operator|= (double)

bool isValid () const

bool isNull () const

void invalidate ()

QwtInterval symmetrize (double value) const

Detailed Description

A class representing an interval.

The interval is represented by 2 doubles, the lower and the upper limit.

Member Typedef Documentation

typedef QFlags<\fBBorderFlag\fP> \fBQwtInterval::BorderFlags\fP

Border flags.

Member Enumeration Documentation

enum \fBQwtInterval::BorderFlag\fP Flag indicating if a border is included or excluded

See also:

setBorderFlags(), borderFlags()

Enumerator:

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.

Constructor & Destructor Documentation

QwtInterval::QwtInterval ()\fC [inline]\fP

Default Constructor. Creates an invalid interval [0.0, -1.0]

See also:

setInterval(), isValid()

QwtInterval::QwtInterval (doubleminValue, doublemaxValue, \fBBorderFlags\fPborderFlags = \fCIncludeBorders\fP)\fC [inline]\fP Constructor

Build an interval with from min/max values

Parameters:

minValue Minimum value

maxValue Maximum value

borderFlags Include/Exclude borders

Member Function Documentation

\fBQwtInterval::BorderFlags\fP QwtInterval::borderFlags () const\fC [inline]\fP \fBReturns:\fP

Border flags

See also:

setBorderFlags()

bool QwtInterval::contains (doublevalue) const Test if a value is inside an interval

Parameters:

value Value

Returns:

true, if value >= minValue() && value <= maxValue()

\fBQwtInterval\fP QwtInterval::extend (doublevalue) 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

Parameters:

value Value

See also:

isValid()

\fBQwtInterval\fP QwtInterval::intersect (const \fBQwtInterval\fP &other) const

Intersect 2 intervals.

bool QwtInterval::intersects (const \fBQwtInterval\fP &other) const Test if two intervals overlap

void QwtInterval::invalidate ()\fC [inline]\fP Invalidate the interval

The limits are set to interval [0.0, -1.0]

See also:

isValid()

\fBQwtInterval\fP QwtInterval::inverted () const Invert the limits of the interval

Returns:

Inverted interval

See also:

normalized()

bool QwtInterval::isNull () const\fC [inline]\fP \fBReturns:\fP

true, if isValid() && (minValue() >= maxValue())

bool QwtInterval::isValid () const\fC [inline]\fP A interval is valid when \fBminValue()\fP <= \fBmaxValue()\fP. In case of \fBQwtInterval::ExcludeBorders\fP it is true when \fBminValue()\fP < \fBmaxValue()\fP

\fBQwtInterval\fP QwtInterval::limited (doublelowerBound, doubleupperBound) const Limit the interval, keeping the border modes

Parameters:

lowerBound Lower limit

upperBound Upper limit

Returns:

Limited interval

double QwtInterval::maxValue () const\fC [inline]\fP \fBReturns:\fP

Upper limit of the interval

double QwtInterval::minValue () const\fC [inline]\fP \fBReturns:\fP

Lower limit of the interval

\fBQwtInterval\fP QwtInterval::normalized () const

Normalize the limits of the interval. If maxValue() < minValue() the limits will be inverted.

Returns:

Normalized interval

See also:

isValid(), inverted()

bool QwtInterval::operator!= (const \fBQwtInterval\fP &other) const\fC [inline]\fP

Compare two intervals.

\fBQwtInterval\fP QwtInterval::operator& (const \fBQwtInterval\fP &interval) const\fC [inline]\fP Intersection of two intervals

See also:

intersect()

\fBQwtInterval\fP & QwtInterval::operator&= (const \fBQwtInterval\fP &interval)

Intersects this interval with the given interval.

bool QwtInterval::operator== (const \fBQwtInterval\fP &other) const\fC [inline]\fP

Compare two intervals.

\fBQwtInterval\fP QwtInterval::operator| (const \fBQwtInterval\fP &interval) const\fC [inline]\fP Union of two intervals

See also:

unite()

\fBQwtInterval\fP QwtInterval::operator| (doublevalue) const\fC [inline]\fP Extend an interval

Parameters:

value Value

Returns:

Extended interval

See also:

extend()

\fBQwtInterval\fP & QwtInterval::operator|= (const \fBQwtInterval\fP &interval)

Unites this interval with the given interval.

\fBQwtInterval\fP & QwtInterval::operator|= (doublevalue) Extend an interval

Parameters:

value Value

Returns:

Reference of the extended interval

See also:

extend()

void QwtInterval::setBorderFlags (\fBBorderFlags\fPborderFlags)\fC [inline]\fP Change the border flags

Parameters:

borderFlags Or'd BorderMode flags

See also:

borderFlags()

void QwtInterval::setInterval (doubleminValue, doublemaxValue, \fBBorderFlags\fPborderFlags = \fCIncludeBorders\fP)\fC [inline]\fP Assign the limits of the interval

Parameters:

minValue Minimum value

maxValue Maximum value

borderFlags Include/Exclude borders

void QwtInterval::setMaxValue (doublemaxValue)\fC [inline]\fP Assign the upper limit of the interval

Parameters:

maxValue Maximum value

void QwtInterval::setMinValue (doubleminValue)\fC [inline]\fP Assign the lower limit of the interval

Parameters:

minValue Minimum value

\fBQwtInterval\fP QwtInterval::symmetrize (doublevalue) const 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

\fBQwtInterval\fP QwtInterval::unite (const \fBQwtInterval\fP &other) const

Unite 2 intervals.

double QwtInterval::width () const\fC [inline]\fP Return the width of an interval The width of invalid intervals is 0.0, otherwise the result is \fBmaxValue()\fP - \fBminValue()\fP.

See also:

isValid()

Author

Generated automatically by Doxygen for Qwt User's Guide from the source code.