Inherited by QwtScaleDraw.
Map a double interval into an integer interval.
The QwtDiMap class maps an interval of type double into an interval of type int. It consists of two intervals D = [d1, d2] (double) and I = [i1, i2] (int), which are specified with the QwtDiMap::setDblRange and QwtDiMap::setIntRange members. The point d1 is mapped to the point i1, and d2 is mapped to i2. Any point inside or outside D can be mapped to a point inside or outside I using QwtDiMap::transform or QwtDiMap::limTransform or vice versa using QwtPlot::invTransform. D can be scaled linearly or logarithmically, as specified with QwtDiMap::setDblRange.
Usage
#include <qwt_dimap.h>
QwtDiMap map;
int ival;
double dval;
map.setDblRange(0.0, 3.1415); // Assign an interval of type double with
// linear mapping
map.setIntRange(0,100); // Assign an integer interval
ival = map.transform(1.0); // obtain integer value corresponding to 1.0
dval = map.invTransform(77); // obtain double value corresponding to 77
Definition at line 46 of file qwt_dimap.h.
QwtDiMap ()
QwtDiMap (int i1, int i2, double d1, double d2, bool lg=FALSE)
~QwtDiMap ()
bool contains (double x) const
bool contains (int x) const
void setIntRange (int i1, int i2)
void setDblRange (double d1, double d2, bool lg=FALSE)
int transform (double x) const
double invTransform (int i) const
int limTransform (double x) const
double xTransform (double x) const
double d1 () const
double d2 () const
int i1 () const
int i2 () const
bool logarithmic () const
QT_STATIC_CONST double LogMin = 1.0e-150
QT_STATIC_CONST double LogMax = 1.0e150
Constructor.
The double and integer intervals are both set to [0,1]. Definition at line 20 of file qwt_dimap.cpp.
Constructor.
Constructs a QwtDiMap instance with initial integer and double intervals
Parameters:
Definition at line 43 of file qwt_dimap.cpp.
Destructor.
Definition at line 54 of file qwt_dimap.cpp.
Returns:
Parameters:
Definition at line 73 of file qwt_dimap.cpp.
Returns:
Parameters:
Definition at line 63 of file qwt_dimap.cpp.
Returns:
Definition at line 86 of file qwt_dimap.h.
Referenced by QwtSlider::getValue(), and QwtSlider::xyPosition().
Returns:
Definition at line 94 of file qwt_dimap.h.
Referenced by QwtSlider::getValue(), and QwtSlider::xyPosition().
Returns:
Definition at line 102 of file qwt_dimap.h.
Referenced by QwtScaleDraw::drawBackbone(), QwtSlider::getScrollMode(), QwtSlider::getValue(), and QwtSlider::xyPosition().
Returns:
Definition at line 110 of file qwt_dimap.h.
Referenced by QwtScaleDraw::drawBackbone(), QwtSlider::getScrollMode(), QwtSlider::getValue(), and QwtSlider::xyPosition().
Transform an integer value into a double value.
Parameters:
Returns:
Definition at line 132 of file qwt_dimap.cpp.
Referenced by QwtSlider::getValue(), QwtPlotPicker::invTransform(), and QwtPlot::invTransform().
Transform and limit.
The function is similar to QwtDiMap::transform, but limits the input value to the nearest border of the map's double interval if it lies outside that interval.
Parameters:
Returns:
Definition at line 155 of file qwt_dimap.cpp.
References transform().
Referenced by QwtThermo::drawThermo().
Returns:
Definition at line 118 of file qwt_dimap.h.
Specify the borders of the double interval.
Parameters:
Definition at line 84 of file qwt_dimap.cpp.
Referenced by QwtPlot::canvasMap(), QwtDiMap(), QwtThermo::setRange(), and QwtScaleDraw::setScale().
Specify the borders of the integer interval.
Parameters:
Definition at line 116 of file qwt_dimap.cpp.
Referenced by QwtPlot::canvasMap(), QwtSlider::layoutSlider(), QwtThermo::layoutThermo(), QwtScaleDraw::setAngleRange(), and QwtScaleDraw::setGeometry().
Transform a point in double interval into an point in the integer interval.
Parameters:
Returns:
Warning:
Definition at line 136 of file qwt_dimap.h.
Referenced by QwtCurve::closePolyline(), QwtGrid::draw(), QwtCurve::drawDots(), QwtCurve::drawLines(), QwtCurve::drawSteps(), QwtCurve::drawSticks(), QwtCurve::drawSymbols(), QwtScaleDraw::drawTick(), QwtScaleDraw::labelPlacement(), limTransform(), QwtPlotPicker::transform(), QwtPlot::transform(), and QwtSlider::xyPosition().
Exact transformation.
This function is similar to QwtDiMap::transform, but makes the integer interval appear to be double.
Parameters:
Returns:
Definition at line 185 of file qwt_dimap.cpp.
Referenced by QwtPlot::closestCurve(), QwtPlot::closestMarker(), and QwtCurve::drawSpline().
Generated automatically by Doxygen for Qwt User's Guide from the source code.