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

Base class for scale engines 更多...

#include <qwt_scale_engine.h>

类 QwtScaleEngine 继承关系图:
QwtLinearScaleEngine QwtLogScaleEngine QwtDateScaleEngine

class  PrivateData
 

Public 类型

enum  Attribute {
  NoAttribute = 0x00 , IncludeReference = 0x01 , Symmetric = 0x02 , Floating = 0x04 ,
  Inverted = 0x08
}
 Layout attributes 更多...
 

Public 成员函数

 QwtScaleEngine (uint base=10)
 Constructor
 
void setBase (uint base)
 Set the base
 
uint base () const
 Return base of the scale engine
 
void setAttribute (Attribute, bool on=true)
 Set an attribute
 
bool testAttribute (Attribute) const
 Test if an attribute is enabled
 
void setAttributes (Attributes)
 Set attributes
 
Attributes attributes () const
 Return scale attributes
 
void setReference (double)
 Set the reference value
 
double reference () const
 Return the reference value
 
void setMargins (double lower, double upper)
 Set the margins
 
double lowerMargin () const
 Return the margin at the lower end of the scale
 
double upperMargin () const
 Return the margin at the upper end of the scale
 
virtual void autoScale (int maxNumSteps, double &x1, double &x2, double &stepSize) const =0
 Align and divide an interval
 
virtual QwtScaleDiv divideScale (double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize=0.0) const =0
 Calculate a scale division
 
void setTransformation (QwtTransform *)
 Set the transformation
 
QwtTransformtransformation () const
 Create and return a clone of the transformation of the engine
 

Protected 成员函数

bool contains (const QwtInterval &, double value) const
 Check if an interval contains a value
 
QList< double > strip (const QList< double > &, const QwtInterval &) const
 Strip values outside an interval
 
double divideInterval (double intervalSize, int numSteps) const
 Divide an interval
 
QwtInterval buildInterval (double value) const
 Build an interval around a value
 

详细描述

Base class for scale engines

A scale engine tries to find "reasonable" ranges and step sizes for scales. The layout of the scale can be varied with setAttribute(). Qwt offers implementations for logarithmic and linear scales.

参见
QwtLinearScaleEngine, QwtLogScaleEngine

成员枚举类型说明

◆ Attribute

Layout attributes

参见
setAttribute(), testAttribute(), reference(), lowerMargin(), upperMargin()
枚举值
NoAttribute 

No attributes

IncludeReference 

Build a scale which includes the reference() value

Symmetric 

Build a scale which is symmetric to the reference() value

Floating 

The endpoints of the scale are supposed to be equal the outmost included values plus the specified margins (see setMargins()). If this attribute is not set, the endpoints of the scale will be integer multiples of the step size.

Inverted 

Turn the scale upside down

构造及析构函数说明

◆ QwtScaleEngine()

QwtScaleEngine::QwtScaleEngine ( uint  base = 10)
explicit

Constructor

参数
baseBase of the scale engine
参见
setBase()

成员函数说明

◆ attributes()

QwtScaleEngine::Attributes QwtScaleEngine::attributes ( ) const

Return scale attributes

返回
the attributes
Scale attributes
参见
Attribute, setAttributes(), testAttribute()

◆ autoScale()

virtual void QwtScaleEngine::autoScale ( int  maxNumSteps,
double &  x1,
double &  x2,
double &  stepSize 
) const
pure virtual

Align and divide an interval

QwtLinearScaleEngine, QwtLogScaleEngine , 以及 QwtDateScaleEngine 内被实现.

◆ base()

uint QwtScaleEngine::base ( ) const

Return base of the scale engine

返回
the base
Base of the scale engine
参见
setBase()

◆ buildInterval()

QwtInterval QwtScaleEngine::buildInterval ( double  value) const
protected

Build an interval around a value

In case of v == 0.0 the interval is [-0.5, 0.5], otherwise it is [0.5 * v, 1.5 * v]

参数
valueInitial value
返回
Calculated interval

◆ contains()

bool QwtScaleEngine::contains ( const QwtInterval interval,
double  value 
) const
protected

Check if an interval contains a value

Check if an interval "contains" a value

参数
intervalInterval
valueValue
返回
True, when the value is inside the interval

◆ divideInterval()

double QwtScaleEngine::divideInterval ( double  intervalSize,
int  numSteps 
) const
protected

Divide an interval

Calculate a step size for an interval size

参数
intervalSizeInterval size
numStepsNumber of steps
返回
Step size

◆ divideScale()

virtual QwtScaleDiv QwtScaleEngine::divideScale ( double  x1,
double  x2,
int  maxMajorSteps,
int  maxMinorSteps,
double  stepSize = 0.0 
) const
pure virtual

Calculate a scale division

QwtLinearScaleEngine, QwtLogScaleEngine , 以及 QwtDateScaleEngine 内被实现.

◆ lowerMargin()

double QwtScaleEngine::lowerMargin ( ) const

Return the margin at the lower end of the scale

返回
the lower margin
The margin at the lower end

The default margin is 0.

参见
setMargins()

◆ reference()

double QwtScaleEngine::reference ( ) const

Return the reference value

返回
the reference value
The reference value
参见
setReference(), setAttribute()

◆ setAttribute()

void QwtScaleEngine::setAttribute ( Attribute  attribute,
bool  on = true 
)

Set an attribute

Change a scale attribute

参数
attributeAttribute to change
onOn/Off
参见
Attribute, testAttribute()

◆ setAttributes()

void QwtScaleEngine::setAttributes ( Attributes  attributes)

Set attributes

Change the scale attribute

参数
attributesSet scale attributes
参见
Attribute, attributes()

◆ setBase()

void QwtScaleEngine::setBase ( uint  base)

Set the base

Set the base of the scale engine

参数
baseBase of the engine

While a base of 10 is what 99.9% of all applications need, certain scales might need a different base: f.e 2. The default setting is 10.

参见
base()

◆ setMargins()

void QwtScaleEngine::setMargins ( double  lower,
double  upper 
)

Set the margins

Specify margins at the scale's endpoints

参数
lowerMinimum distance between the scale's lower boundary and the smallest enclosed value
upperMinimum distance between the scale's upper boundary and the greatest enclosed value

Margins can be used to leave a minimum amount of space between the enclosed intervals and the boundaries of the scale.

警告
QwtLogScaleEngine measures the margins in decades.
参见
upperMargin(), lowerMargin()

◆ setReference()

void QwtScaleEngine::setReference ( double  reference)

Set the reference value

Specify a reference point

参数
referenceNew reference value

The reference point is needed if options IncludeReference or Symmetric are active. Its default value is 0.0.

参见
Attribute

◆ setTransformation()

void QwtScaleEngine::setTransformation ( QwtTransform transform)

Set the transformation

Assign a transformation

参数
transformTransformation

The transformation object is used as factory for clones that are returned by transformation(). The scale engine takes ownership of the transformation.

参见
QwtTransform::copy(), transformation()

◆ strip()

QList< double > QwtScaleEngine::strip ( const QList< double > &  ticks,
const QwtInterval interval 
) const
protected

Strip values outside an interval

Remove ticks from a list, that are not inside an interval

参数
ticksTick list
intervalInterval
返回
Stripped tick list

◆ testAttribute()

bool QwtScaleEngine::testAttribute ( Attribute  attribute) const

Test if an attribute is enabled

返回
true if an attribute is set
参数
attributeAttribute to be tested
返回
True, if attribute is enabled
参见
Attribute, setAttribute()

◆ transformation()

QwtTransform * QwtScaleEngine::transformation ( ) const

Create and return a clone of the transformation of the engine

返回
the transformation

When the engine has no special transformation nullptr is returned, indicating no transformation.

返回
A clone of the transformation
参见
setTransformation()

◆ upperMargin()

double QwtScaleEngine::upperMargin ( ) const

Return the margin at the upper end of the scale

返回
the upper margin
The margin at the upper end

The default margin is 0.

参见
setMargins()

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