A scale engine trys to find "reasonable" ranges and step sizes for scales.
The layout of the scale can be varied with setOptions().
Qwt offers implementations for logarithmic (log10) and linear scales. Contributions for other types of scale engines (date/time, log2 ... ) are welcome.
Definition at line 50 of file qwt_scale_engine.h.
Public Types | |
enum | Attribute { NoAttribute = 0, IncludeReference = 1, Symmetric = 2, Floating = 4, Inverted = 8 } |
Public Member Functions | |
QwtScaleEngine () | |
virtual | ~QwtScaleEngine () |
void | setAttribute (Attribute, bool on=true) |
bool | testAttribute (Attribute) const |
void | setAttributes (int) |
int | attributes () const |
void | setReference (double reference) |
double | reference () const |
void | setMargins (double m1, double m2) |
double | loMargin () const |
double | hiMargin () const |
virtual void | autoScale (int maxNumSteps, double &x1, double &x2, double &stepSize) const =0 |
virtual QwtScaleDiv | divideScale (double x1, double x2, int maxMajSteps, int maxMinSteps, double stepSize=0.0) const =0 |
virtual QwtScaleTransformation * | transformation () const =0 |
Protected Member Functions | |
bool | contains (const QwtDoubleInterval &, double val) const |
QwtValueList | strip (const QwtValueList &, const QwtDoubleInterval &) const |
double | divideInterval (double interval, int numSteps) const |
QwtDoubleInterval | buildInterval (double v) const |
|
see QwtScaleEngine::setOption, testOption
Definition at line 54 of file qwt_scale_engine.h. |
|
Ctor.
Definition at line 169 of file qwt_scale_engine.cpp. |
|
Dtor.
Definition at line 176 of file qwt_scale_engine.cpp. |
|
Return the scale attributes Definition at line 379 of file qwt_scale_engine.cpp. Referenced by QwtLog10ScaleEngine::divideScale(). |
|
Align and divide an interval
Implemented in QwtLinearScaleEngine, and QwtLog10ScaleEngine. |
|
Build an interval for a value. In case of v == 0.0 the interval is [-0.5, 0.5], otherwide it is [0.5 * v, 1.5 * v] Definition at line 309 of file qwt_scale_engine.cpp. Referenced by QwtLog10ScaleEngine::autoScale(), and QwtLinearScaleEngine::autoScale(). |
|
Check if an interval "contains" a value
Definition at line 251 of file qwt_scale_engine.cpp. References QwtScaleArithmetic::compareEps(), QwtDoubleInterval::isValid(), QwtDoubleInterval::maxValue(), QwtDoubleInterval::minValue(), and QwtDoubleInterval::width(). Referenced by strip(). |
|
Calculate a step size for an interval size
Definition at line 233 of file qwt_scale_engine.cpp. References QwtScaleArithmetic::ceil125(), and QwtScaleArithmetic::divideEps(). Referenced by QwtLog10ScaleEngine::autoScale(), QwtLinearScaleEngine::autoScale(), QwtLog10ScaleEngine::divideScale(), and QwtLinearScaleEngine::divideScale(). |
|
Calculate a scale division.
Implemented in QwtLinearScaleEngine, and QwtLog10ScaleEngine. |
|
Definition at line 198 of file qwt_scale_engine.cpp. Referenced by QwtLog10ScaleEngine::autoScale(), QwtLinearScaleEngine::autoScale(), and QwtLog10ScaleEngine::divideScale(). |
|
Definition at line 187 of file qwt_scale_engine.cpp. Referenced by QwtLog10ScaleEngine::autoScale(), QwtLinearScaleEngine::autoScale(), and QwtLog10ScaleEngine::divideScale(). |
|
Definition at line 400 of file qwt_scale_engine.cpp. Referenced by QwtLog10ScaleEngine::autoScale(), QwtLinearScaleEngine::autoScale(), and QwtLog10ScaleEngine::divideScale(). |
|
Change a scale attribute
Definition at line 346 of file qwt_scale_engine.cpp. |
|
Change the scale attribute
Definition at line 371 of file qwt_scale_engine.cpp. Referenced by QwtLog10ScaleEngine::divideScale(). |
|
Specify margins at the scale's endpoints.
Definition at line 219 of file qwt_scale_engine.cpp. Referenced by QwtLog10ScaleEngine::divideScale(). |
|
Specify a reference point.
Definition at line 391 of file qwt_scale_engine.cpp. Referenced by QwtLog10ScaleEngine::divideScale(). |
|
Remove ticks from a list, that are not inside an interval
Definition at line 280 of file qwt_scale_engine.cpp. References contains(), and QwtDoubleInterval::isValid(). |
|
Check if a attribute is set.
Definition at line 360 of file qwt_scale_engine.cpp. Referenced by QwtLog10ScaleEngine::autoScale(), and QwtLinearScaleEngine::autoScale(). |
|
Implemented in QwtLinearScaleEngine, and QwtLog10ScaleEngine. |