A scale map.
More...
#include <qwt_scale_map.h>
|
| | QwtScaleMap () |
| | Default constructor.
|
| |
|
| QwtScaleMap (const QwtScaleMap &) |
| | Copy constructor.
|
| |
|
| QwtScaleMap (QwtScaleMap &&) |
| | Move constructor.
|
| |
|
| ~QwtScaleMap () |
| | Destructor.
|
| |
| QwtScaleMap & | operator= (const QwtScaleMap &) |
| | Copy assignment operator.
|
| |
|
QwtScaleMap & | operator= (QwtScaleMap &&) |
| | Move assignment operator.
|
| |
| void | setTransformation (QwtTransform *) |
| | Set the transformation (takes ownership)
|
| |
| const QwtTransform * | transformation () 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.
|
| |
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.
- See also
- 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]
Transform a point from paint to scale coordinates.
- Parameters
-
| xMap | X axis scale map |
| yMap | Y axis scale map |
| pos | Position in paint coordinates |
- Returns
- Position in scale coordinates
- See also
- transform()
◆ invTransform() [2/3]
Transform a rectangle from paint to scale coordinates.
- Parameters
-
| xMap | X axis scale map |
| yMap | Y axis scale map |
| rect | Rectangle in paint coordinates |
- Returns
- Rectangle in scale coordinates
- See also
- 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.
- Parameters
-
| p | Value relative to the coordinates of the paint device |
- Returns
- Transformed value
- See also
- 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)
- Parameters
-
- Returns
- True if the scale has no transformation (linear scale)
◆ operator=()
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.
- Parameters
-
| p1 | First border |
| p2 | Second 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
- Parameters
-
| s1 | First border |
| s2 | Second border |
◆ setTransformation()
| void QwtScaleMap::setTransformation |
( |
QwtTransform * |
transform | ) |
|
Set the transformation (takes ownership)
Initialize the map with a transformation.
- Parameters
-
| transform | Transformation object (takes ownership) |
◆ transform() [1/3]
Transform a point from scale to paint coordinates.
- Parameters
-
| xMap | X axis scale map |
| yMap | Y axis scale map |
| pos | Position in scale coordinates |
- Returns
- Position in paint coordinates
- See also
- invTransform()
◆ transform() [2/3]
Transform a rectangle from scale to paint coordinates.
- Parameters
-
| xMap | X axis scale map |
| yMap | Y axis scale map |
| rect | Rectangle in scale coordinates |
- Returns
- Rectangle in paint coordinates
- See also
- 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.
- Parameters
-
| s | Value relative to the coordinates of the scale |
- Returns
- Transformed value
- See also
- invTransform()
◆ transformation()
Return the transformation.
Get the transformation.
- Returns
- 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.
The documentation for this class was generated from the following files:
- /home/runner/work/QWT/QWT/src/core/qwt_scale_map.h
- /home/runner/work/QWT/QWT/src/core/qwt_scale_map.cpp