A scale map. More...
#include <qwt_scale_map.h>
Public Member Functions | |
| double | invTransform (double p) const |
| bool | isInverting () const |
| QwtScaleMap & | operator= (const QwtScaleMap &) |
| Assignment operator. | |
| double | p1 () const |
| double | p2 () const |
| double | pDist () const |
| QwtScaleMap () | |
| Constructor. | |
| QwtScaleMap (const QwtScaleMap &) | |
| Copy constructor. | |
| double | s1 () const |
| double | s2 () const |
| double | sDist () const |
| void | setPaintInterval (double p1, double p2) |
| Specify the borders of the paint device interval. | |
| void | setScaleInterval (double s1, double s2) |
| Specify the borders of the scale interval. | |
| void | setTransformation (QwtTransform *) |
| double | transform (double s) const |
| const QwtTransform * | transformation () const |
| Get the transformation. | |
| ~QwtScaleMap () | |
Static Public Member Functions | |
| static QRectF | invTransform (const QwtScaleMap &, const QwtScaleMap &, const QRectF &) |
| static QPointF | invTransform (const QwtScaleMap &, const QwtScaleMap &, const QPointF &) |
| static QRectF | transform (const QwtScaleMap &, const QwtScaleMap &, const QRectF &) |
| static QPointF | transform (const QwtScaleMap &, const QwtScaleMap &, const QPointF &) |
Private Member Functions | |
| void | updateFactor () |
Private Attributes | |
| double | d_cnv |
| double | d_p1 |
| double | d_p2 |
| double | d_s1 |
| double | d_s2 |
| QwtTransform * | d_transform |
| double | d_ts1 |
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.
Definition at line 30 of file qwt_scale_map.h.
Constructor.
The scale and paint device intervals are both set to [0,1].
Definition at line 20 of file qwt_scale_map.cpp.
| QwtScaleMap::QwtScaleMap | ( | const QwtScaleMap & | other | ) |
Copy constructor.
Definition at line 32 of file qwt_scale_map.cpp.
Destructor
Definition at line 48 of file qwt_scale_map.cpp.
| double QwtScaleMap::invTransform | ( | double | p | ) | const [inline] |
Transform an paint device value into a value in the interval of the scale.
| p | Value relative to the coordinates of the paint device |
Definition at line 156 of file qwt_scale_map.h.
| QRectF QwtScaleMap::invTransform | ( | const QwtScaleMap & | xMap, |
| const QwtScaleMap & | yMap, | ||
| const QRectF & | rect | ||
| ) | [static] |
Transform a rectangle from paint to scale coordinates
| xMap | X map |
| yMap | Y map |
| rect | Rectangle in paint coordinates |
Definition at line 223 of file qwt_scale_map.cpp.
| QPointF QwtScaleMap::invTransform | ( | const QwtScaleMap & | xMap, |
| const QwtScaleMap & | yMap, | ||
| const QPointF & | pos | ||
| ) | [static] |
Transform a rectangle from paint to scale coordinates
| xMap | X map |
| yMap | Y map |
| pos | Position in paint coordinates |
Definition at line 186 of file qwt_scale_map.cpp.
| bool QwtScaleMap::isInverting | ( | ) | const [inline] |
| QwtScaleMap & QwtScaleMap::operator= | ( | const QwtScaleMap & | other | ) |
Assignment operator.
Definition at line 54 of file qwt_scale_map.cpp.
| double QwtScaleMap::p1 | ( | ) | const [inline] |
Definition at line 101 of file qwt_scale_map.h.
| double QwtScaleMap::p2 | ( | ) | const [inline] |
Definition at line 109 of file qwt_scale_map.h.
| double QwtScaleMap::pDist | ( | ) | const [inline] |
Definition at line 117 of file qwt_scale_map.h.
| double QwtScaleMap::s1 | ( | ) | const [inline] |
Definition at line 85 of file qwt_scale_map.h.
| double QwtScaleMap::s2 | ( | ) | const [inline] |
Definition at line 93 of file qwt_scale_map.h.
| double QwtScaleMap::sDist | ( | ) | const [inline] |
Definition at line 125 of file qwt_scale_map.h.
| void QwtScaleMap::setPaintInterval | ( | double | p1, |
| double | p2 | ||
| ) |
Specify the borders of the paint device interval.
| p1 | first border |
| p2 | second border |
Definition at line 118 of file qwt_scale_map.cpp.
| void QwtScaleMap::setScaleInterval | ( | double | s1, |
| double | s2 | ||
| ) |
Specify the borders of the scale interval.
| s1 | first border |
| s2 | second border |
Definition at line 99 of file qwt_scale_map.cpp.
| void QwtScaleMap::setTransformation | ( | QwtTransform * | transform | ) |
Initialize the map with a transformation
Definition at line 75 of file qwt_scale_map.cpp.
| double QwtScaleMap::transform | ( | double | s | ) | const [inline] |
Transform a point related to the scale interval into an point related to the interval of the paint device
| s | Value relative to the coordinates of the scale |
Definition at line 139 of file qwt_scale_map.h.
| QRectF QwtScaleMap::transform | ( | const QwtScaleMap & | xMap, |
| const QwtScaleMap & | yMap, | ||
| const QRectF & | rect | ||
| ) | [static] |
Transform a rectangle from scale to paint coordinates
| xMap | X map |
| yMap | Y map |
| rect | Rectangle in scale coordinates |
Definition at line 152 of file qwt_scale_map.cpp.
| QPointF QwtScaleMap::transform | ( | const QwtScaleMap & | xMap, |
| const QwtScaleMap & | yMap, | ||
| const QPointF & | pos | ||
| ) | [static] |
Transform a point from scale to paint coordinates
| xMap | X map |
| yMap | Y map |
| pos | Position in scale coordinates |
Definition at line 205 of file qwt_scale_map.cpp.
| const QwtTransform * QwtScaleMap::transformation | ( | ) | const |
Get the transformation.
Definition at line 87 of file qwt_scale_map.cpp.
| void QwtScaleMap::updateFactor | ( | ) | [private] |
Definition at line 126 of file qwt_scale_map.cpp.
double QwtScaleMap::d_cnv [private] |
Definition at line 76 of file qwt_scale_map.h.
double QwtScaleMap::d_p1 [private] |
Definition at line 74 of file qwt_scale_map.h.
double QwtScaleMap::d_p2 [private] |
Definition at line 74 of file qwt_scale_map.h.
double QwtScaleMap::d_s1 [private] |
Definition at line 73 of file qwt_scale_map.h.
double QwtScaleMap::d_s2 [private] |
Definition at line 73 of file qwt_scale_map.h.
QwtTransform* QwtScaleMap::d_transform [private] |
Definition at line 79 of file qwt_scale_map.h.
double QwtScaleMap::d_ts1 [private] |
Definition at line 77 of file qwt_scale_map.h.