QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
Public 类型 | Public 成员函数 | 所有成员列表
QwtInterval类 参考

A class representing an interval 更多...

#include <qwt_interval.h>

Public 类型

enum  BorderFlag { IncludeBorders = 0x00 , ExcludeMinimum = 0x01 , ExcludeMaximum = 0x02 , ExcludeBorders = ExcludeMinimum | ExcludeMaximum }
 Flag indicating if a border is included or excluded 更多...
 

Public 成员函数

constexpr QwtInterval () noexcept
 Border flags
 
constexpr QwtInterval (double minValue, double maxValue, BorderFlags=IncludeBorders) noexcept
 Constructor with min/max values
 
void setInterval (double minValue, double maxValue, BorderFlags=IncludeBorders) noexcept
 Assign the limits of the interval
 
QwtInterval normalized () const
 Normalize the limits of the interval
 
QwtInterval inverted () const
 Invert 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) noexcept
 Change the border flags
 
constexpr BorderFlags borderFlags () const noexcept
 
constexpr double minValue () const noexcept
 
constexpr double maxValue () const noexcept
 
constexpr double centerValue () const noexcept
 
constexpr double width () const noexcept
 Return the width of an interval
 
constexpr long double widthL () const noexcept
 Return the width of an interval as long double
 
void setMinValue (double) noexcept
 Assign the lower limit of the interval
 
void setMaxValue (double) noexcept
 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 two intervals
 
QwtInterval unite (const QwtInterval &) const
 Unite two intervals
 
QwtInterval operator| (const QwtInterval &) const
 Union of two intervals
 
QwtInterval operator& (const QwtInterval &) const
 Intersection of two intervals
 
QwtIntervaloperator|= (const QwtInterval &)
 Unite this interval with the given interval
 
QwtIntervaloperator&= (const QwtInterval &)
 Intersect this interval with the given interval
 
QwtInterval extend (double value) const
 Extend the interval
 
QwtInterval operator| (double) const
 Extend an interval
 
QwtIntervaloperator|= (double)
 Extend an interval
 
constexpr bool isValid () const noexcept
 Check if the interval is valid
 
constexpr bool isNull () const noexcept
 Check if interval is null
 
void invalidate () noexcept
 Invalidate the interval
 
QwtInterval symmetrize (double value) const
 Symmetrize the interval around a value
 

详细描述

A class representing an interval

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

成员枚举类型说明

◆ BorderFlag

Flag indicating if a border is included or excluded

参见
setBorderFlags(), borderFlags()
枚举值
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

构造及析构函数说明

◆ QwtInterval() [1/2]

constexpr QwtInterval::QwtInterval ( )
inlineconstexprnoexcept

Border flags

Default Constructor

Creates an invalid interval [0.0, -1.0]

参见
setInterval(), isValid()

◆ QwtInterval() [2/2]

constexpr QwtInterval::QwtInterval ( double  minValue,
double  maxValue,
BorderFlags  borderFlags = IncludeBorders 
)
inlineconstexprnoexcept

Constructor with min/max values

参数
minValueMinimum value
maxValueMaximum value
borderFlagsInclude/Exclude borders

成员函数说明

◆ borderFlags()

constexpr QwtInterval::BorderFlags QwtInterval::borderFlags ( ) const
inlineconstexprnoexcept
返回
Border flags
参见
setBorderFlags()

◆ centerValue()

constexpr double QwtInterval::centerValue ( ) const
inlineconstexprnoexcept
返回
Center of the interval
参见
width()

◆ contains() [1/2]

bool QwtInterval::contains ( const QwtInterval interval) const

Test if an interval is inside an interval

参数
[in]intervalInterval to test
返回
True if interval lies inside the boundaries

◆ contains() [2/2]

bool QwtInterval::contains ( double  value) const

Test if a value is inside an interval

参数
[in]valueValue to test
返回
True if value lies inside the boundaries

◆ extend()

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.

参数
[in]valueValue to extend with
返回
Extended interval
参见
isValid()

◆ intersect()

QwtInterval QwtInterval::intersect ( const QwtInterval other) const

Intersect two intervals

参数
[in]otherInterval to intersect with
返回
Intersection of this and other

◆ intersects()

bool QwtInterval::intersects ( const QwtInterval other) const

Test if two intervals overlap

参数
[in]otherInterval to test
返回
True when the intervals are intersecting

◆ invalidate()

void QwtInterval::invalidate ( )
inlinenoexcept

Invalidate the interval

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

参见
isValid()

◆ inverted()

QwtInterval QwtInterval::inverted ( ) const

Invert the interval

minValue() and maxValue() are swapped, border flags remain unchanged.

◆ isNull()

constexpr bool QwtInterval::isNull ( ) const
inlineconstexprnoexcept

Check if interval is null

返回
True if isValid() && (minValue() >= maxValue())

◆ isValid()

constexpr bool QwtInterval::isValid ( ) const
inlineconstexprnoexcept

Check if the interval is valid

A interval is valid when minValue() <= maxValue(). In case of QwtInterval::ExcludeBorders it is true when minValue() < maxValue()

返回
True, if the interval is valid
参见
isValid()

◆ limited()

QwtInterval QwtInterval::limited ( double  lowerBound,
double  upperBound 
) const

Limit the interval, keeping the border modes

参数
[in]lowerBoundLower limit
[in]upperBoundUpper limit
返回
Limited interval

◆ maxValue()

constexpr double QwtInterval::maxValue ( ) const
inlineconstexprnoexcept
返回
Maximum value of the interval
参见
setMaxValue()

◆ minValue()

constexpr double QwtInterval::minValue ( ) const
inlineconstexprnoexcept
返回
Minimum value of the interval
参见
setMinValue()

◆ normalized()

QwtInterval QwtInterval::normalized ( ) const

Normalize the limits of the interval

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

◆ operator!=()

bool QwtInterval::operator!= ( const QwtInterval other) const
inline

Compare two intervals

参数
[in]otherInterval to compare with
返回
True when this and other are not equal

◆ operator&()

QwtInterval QwtInterval::operator& ( const QwtInterval other) const
inline

Intersection of two intervals

参数
[in]otherInterval to intersect with
返回
Intersection of this and other
参见
intersect()

◆ operator&=()

QwtInterval & QwtInterval::operator&= ( const QwtInterval other)

Intersect this interval with the given interval

参数
[in]otherInterval to be intersected with
返回
Reference to this interval

◆ operator==()

bool QwtInterval::operator== ( const QwtInterval other) const
inline

Compare two intervals

参数
[in]otherInterval to compare with
返回
True when this and other are equal

◆ operator|() [1/2]

QwtInterval QwtInterval::operator| ( const QwtInterval other) const
inline

Union of two intervals

参数
[in]otherInterval to unite with
返回
Union of this and other
参见
unite()

◆ operator|() [2/2]

QwtInterval QwtInterval::operator| ( double  value) const
inline

Extend an interval

参数
[in]valueValue to extend with
返回
Extended interval
参见
extend()

◆ operator|=() [1/2]

QwtInterval & QwtInterval::operator|= ( const QwtInterval other)

Unite this interval with the given interval

参数
[in]otherInterval to be united with
返回
Reference to this interval

◆ operator|=() [2/2]

QwtInterval & QwtInterval::operator|= ( double  value)

Extend an interval

参数
[in]valueValue to extend with
返回
Reference to the extended interval
参见
extend()

◆ setBorderFlags()

void QwtInterval::setBorderFlags ( BorderFlags  borderFlags)
inlinenoexcept

Change the border flags

参数
borderFlagsOr'd BorderMode flags
参见
borderFlags()

◆ setInterval()

void QwtInterval::setInterval ( double  minValue,
double  maxValue,
BorderFlags  borderFlags = IncludeBorders 
)
inlinenoexcept

Assign the limits of the interval

参数
minValueMinimum value
maxValueMaximum value
borderFlagsInclude/Exclude borders

◆ setMaxValue()

void QwtInterval::setMaxValue ( double  maxValue)
inlinenoexcept

Assign the upper limit of the interval

参数
maxValueMaximum value

◆ setMinValue()

void QwtInterval::setMinValue ( double  minValue)
inlinenoexcept

Assign the lower limit of the interval

参数
minValueMinimum value

◆ symmetrize()

QwtInterval QwtInterval::symmetrize ( double  value) const

Symmetrize the interval around a value

Adjust the limit that is closer to value, so that value becomes the center of the interval.

参数
[in]valueCenter value
返回
Interval with value as center

◆ unite()

QwtInterval QwtInterval::unite ( const QwtInterval other) const

Unite two intervals

参数
[in]otherInterval to unite with
返回
Union of this and other
参见
intersect()

◆ width()

constexpr double QwtInterval::width ( ) const
inlineconstexprnoexcept

Return the width of an interval

The width of invalid intervals is 0.0, otherwise the result is maxValue() - minValue().

返回
Interval width
参见
isValid()

◆ widthL()

constexpr long double QwtInterval::widthL ( ) const
inlineconstexprnoexcept

Return the width of an interval as long double

The width of invalid intervals is 0.0, otherwise the result is maxValue() - minValue().

返回
Interval width
参见
isValid()

该类的文档由以下文件生成: