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

A scale map 更多...

#include <qwt_scale_map.h>

Public 成员函数

 QwtScaleMap ()
 Default constructor
 
 QwtScaleMap (const QwtScaleMap &)
 Copy constructor
 
 QwtScaleMap (QwtScaleMap &&)
 Move constructor
 
 ~QwtScaleMap ()
 Destructor
 
QwtScaleMapoperator= (const QwtScaleMap &)
 Copy assignment operator
 
QwtScaleMapoperator= (QwtScaleMap &&)
 Move assignment operator
 
void setTransformation (QwtTransform *)
 Set the transformation (takes ownership)
 
const QwtTransformtransformation () const
 Return the transformation
 
void setPaintInterval (double p1, double p2)
 Set the paint device interval boundaries
 
void setScaleInterval (double s1, double s2)
 Set the scale interval boundaries
 
double transform (double s) const
 Transform a scale value to paint device coordinate
 
double invTransform (double p) const
 Transform a paint device coordinate to scale value
 
constexpr double p1 () const noexcept
 Return first border of paint interval
 
constexpr double p2 () const noexcept
 Return second border of paint interval
 
constexpr double s1 () const noexcept
 Return first border of scale interval
 
constexpr double s2 () const noexcept
 Return second border of scale interval
 
double pDist () const
 Return distance between paint interval boundaries
 
double sDist () const
 Return distance between scale interval boundaries
 
constexpr bool isLinear () const noexcept
 Check if this scale has no nonlinear transformation
 
constexpr bool isInverting () const noexcept
 Check if the mapping direction is inverted
 
constexpr double cnv () const noexcept
 Conversion factor for linear fast-path: result = p1() + (value - ts1()) * cnv()
 
constexpr double ts1 () const noexcept
 Transformed scale origin for linear fast-path
 

静态 Public 成员函数

static QRectF transform (const QwtScaleMap &, const QwtScaleMap &, const QRectF &)
 Transform a rectangle from scale to paint coordinates
 
static QRectF invTransform (const QwtScaleMap &, const QwtScaleMap &, const QRectF &)
 Transform a rectangle from paint to scale coordinates
 
static QPointF transform (const QwtScaleMap &, const QwtScaleMap &, const QPointF &)
 Transform a point from scale to paint coordinates
 
static QPointF invTransform (const QwtScaleMap &, const QwtScaleMap &, const QPointF &)
 Transform a point from paint to scale coordinates
 
static bool isLinerScale (const QwtScaleMap &sm)
 Check if the scale is linear (no transformation)
 

Protected 成员函数

void swap (QwtScaleMap &other) noexcept
 

详细描述

A scale map

QwtScaleMap offers transformations from the coordinate system of a scale into the linear coordinate system of a paint device and vice versa.

参见
QwtTransform, QwtScaleDiv

构造及析构函数说明

◆ QwtScaleMap()

QwtScaleMap::QwtScaleMap ( )

Default constructor

The scale and paint device intervals are both set to [0,1].

成员函数说明

◆ cnv()

constexpr double QwtScaleMap::cnv ( ) const
inlineconstexprnoexcept

Conversion factor for linear fast-path: result = p1() + (value - ts1()) * cnv()

Return the conversion factor for linear fast-path transform

◆ invTransform() [1/3]

QPointF QwtScaleMap::invTransform ( const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QPointF &  pos 
)
static

Transform a point from paint to scale coordinates

参数
xMapX axis scale map
yMapY axis scale map
posPosition in paint coordinates
返回
Position in scale coordinates
参见
transform()

◆ invTransform() [2/3]

QRectF QwtScaleMap::invTransform ( const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  rect 
)
static

Transform a rectangle from paint to scale coordinates

参数
xMapX axis scale map
yMapY axis scale map
rectRectangle in paint coordinates
返回
Rectangle in scale coordinates
参见
transform()

◆ invTransform() [3/3]

double QwtScaleMap::invTransform ( double  p) const
inline

Transform a paint device coordinate to scale value

Transform a paint device value into a value in the interval of the scale

参数
pValue relative to the coordinates of the paint device
返回
Transformed value
参见
transform()

◆ isInverting()

constexpr bool QwtScaleMap::isInverting ( ) const
inlineconstexprnoexcept

Check if the mapping direction is inverted

Return true when ( p1() < p2() ) != ( s1() < s2() )

◆ isLinear()

constexpr bool QwtScaleMap::isLinear ( ) const
inlineconstexprnoexcept

Check if this scale has no nonlinear transformation

Return true when there is no nonlinear transformation

◆ isLinerScale()

bool QwtScaleMap::isLinerScale ( const QwtScaleMap sm)
static

Check if the scale is linear (no transformation)

参数
smScale map to check
返回
True if the scale has no transformation (linear scale)

◆ operator=()

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

Copy assignment operator

Assignment operator

◆ p1()

constexpr double QwtScaleMap::p1 ( ) const
inlineconstexprnoexcept

Return first border of paint interval

Return first border of the paint interval

◆ p2()

constexpr double QwtScaleMap::p2 ( ) const
inlineconstexprnoexcept

Return second border of paint interval

Return second border of the paint interval

◆ pDist()

double QwtScaleMap::pDist ( ) const
inline

Return distance between paint interval boundaries

Return qwtAbs(p2() - p1())

◆ s1()

constexpr double QwtScaleMap::s1 ( ) const
inlineconstexprnoexcept

Return first border of scale interval

Return first border of the scale interval

◆ s2()

constexpr double QwtScaleMap::s2 ( ) const
inlineconstexprnoexcept

Return second border of scale interval

Return second border of the scale interval

◆ sDist()

double QwtScaleMap::sDist ( ) const
inline

Return distance between scale interval boundaries

Return qwtAbs(s2() - s1())

◆ setPaintInterval()

void QwtScaleMap::setPaintInterval ( double  p1,
double  p2 
)

Set the paint device interval boundaries

Specify the borders of the paint device interval

参数
p1First border
p2Second border

◆ setScaleInterval()

void QwtScaleMap::setScaleInterval ( double  s1,
double  s2 
)

Set the scale interval boundaries

Specify the borders of the scale interval

Scales might be aligned to transformation depending boundaries

参数
s1First border
s2Second border

◆ setTransformation()

void QwtScaleMap::setTransformation ( QwtTransform transform)

Set the transformation (takes ownership)

Initialize the map with a transformation

参数
transformTransformation object (takes ownership)

◆ transform() [1/3]

QPointF QwtScaleMap::transform ( const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QPointF &  pos 
)
static

Transform a point from scale to paint coordinates

参数
xMapX axis scale map
yMapY axis scale map
posPosition in scale coordinates
返回
Position in paint coordinates
参见
invTransform()

◆ transform() [2/3]

QRectF QwtScaleMap::transform ( const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  rect 
)
static

Transform a rectangle from scale to paint coordinates

参数
xMapX axis scale map
yMapY axis scale map
rectRectangle in scale coordinates
返回
Rectangle in paint coordinates
参见
invTransform()

◆ transform() [3/3]

double QwtScaleMap::transform ( double  s) const
inline

Transform a scale value to paint device coordinate

Transform a point related to the scale interval into a point related to the paint device interval

参数
sValue relative to the coordinates of the scale
返回
Transformed value
参见
invTransform()

◆ transformation()

const QwtTransform * QwtScaleMap::transformation ( ) const

Return the transformation

Get the transformation

返回
Transformation object

◆ ts1()

constexpr double QwtScaleMap::ts1 ( ) const
inlineconstexprnoexcept

Transformed scale origin for linear fast-path

Return the transformed scale origin for linear fast-path transform


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