Qwt User's Guide: QwtScaleDiv Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# QwtScaleDiv Class Reference

List of all members.

## Detailed Description

A class representing a scale division.

A scale division consists of its limits and 3 list of tick values qualified as major, medium and minor ticks.

In most cases scale divisions are calculated by a QwtScaleEngine.

See also:
  QwtScaleEngine::subDivideInto, QwtScaleEngine::subDivide

Definition at line 30 of file qwt_scale_div.h.

## Public Types
enum | TickType { NoTick = -1, MinorTick, MediumTick, MajorTick, NTickTypes }
## Public Member Functions
| QwtScaleDiv ()
| QwtScaleDiv (const QwtDoubleInterval &, QwtValueList[NTickTypes])
| QwtScaleDiv (double lBound, double rBound, QwtValueList[NTickTypes])
int | operator== (const QwtScaleDiv &s) const
int | operator!= (const QwtScaleDiv &s) const
void | setInterval (double lBound, double rBound)
void | setInterval (const QwtDoubleInterval &)
QwtDoubleInterval | interval () const
double | lBound () const
double | hBound () const
double | range () const
bool | contains (double v) const
void | setTicks (int type, const QwtValueList &)
const QwtValueList & | ticks (int type) const
void | invalidate ()
bool | isValid () const
void | invert ()

## Constructor & Destructor Documentation

QwtScaleDiv::QwtScaleDiv | ( |  | ) | `[explicit]`

Construct an invalid QwtScaleDiv instance.

Definition at line 15 of file qwt_scale_div.cpp.

QwtScaleDiv::QwtScaleDiv | ( | const QwtDoubleInterval & | interval,
|  | QwtValueList | ticks[NTickTypes] |
| ) |  |  | `[explicit]`

Construct QwtScaleDiv instance.

Parameters:

  | interval | Interval
  | ticks | List of major, medium and minor ticks

Definition at line 28 of file qwt_scale_div.cpp.

References ticks().

QwtScaleDiv::QwtScaleDiv | ( | double | lBound,
|  | double | hBound,
|  | QwtValueList | ticks[NTickTypes] |
| ) |  |  | `[explicit]`

Construct QwtScaleDiv instance.

Parameters:

  | lBound | First interval limit
  | hBound | Second interval limit
  | ticks | List of major, medium and minor ticks

Definition at line 46 of file qwt_scale_div.cpp.

References ticks().

## Member Function Documentation

int QwtScaleDiv::operator== | ( | const QwtScaleDiv & | other | ) | const

Equality operator.

Returns:
  true if this instance is equal to other

Definition at line 70 of file qwt_scale_div.cpp.

References d_hBound, d_isValid, d_lBound, and d_ticks.

int QwtScaleDiv::operator!= | ( | const QwtScaleDiv & | s | ) | const

Inequality.

Returns:
  true if this instance is not equal to s

Definition at line 92 of file qwt_scale_div.cpp.

void QwtScaleDiv::setInterval | ( | double | lBound,
|  | double | hBound |
| ) |  |  | `[inline]`

Change the interval left bound right bound

Definition at line 84 of file qwt_scale_div.h.

Referenced by setInterval().

void QwtScaleDiv::setInterval | ( | const QwtDoubleInterval & | interval | ) |

Change the interval Interval

Definition at line 61 of file qwt_scale_div.cpp.

References interval(), QwtDoubleInterval::maxValue(), QwtDoubleInterval::minValue(), and setInterval().

QwtDoubleInterval QwtScaleDiv::interval | ( |  | ) | const`[inline]`

Returns:
  lBound -> hBound

Definition at line 93 of file qwt_scale_div.h.

Referenced by setInterval().

double QwtScaleDiv::lBound | ( |  | ) | const`[inline]`

Returns:
  left bound

See also:
  QwtScaleDiv::hBound

Definition at line 102 of file qwt_scale_div.h.

Referenced by QwtPlot::canvasMap(), QwtPlotPanner::moveCanvas(), QwtPlot::print(), QwtPlotZoomer::rescale(), QwtPlotMagnifier::rescale(), QwtPlotPicker::scaleRect(), and QwtAbstractScaleDraw::setScaleDiv().

double QwtScaleDiv::hBound | ( |  | ) | const`[inline]`

Returns:
  right bound

See also:
  QwtScaleDiv::lBound

Definition at line 111 of file qwt_scale_div.h.

Referenced by QwtPlot::canvasMap(), QwtPlotPanner::moveCanvas(), QwtPlot::print(), QwtPlotZoomer::rescale(), and QwtAbstractScaleDraw::setScaleDiv().

double QwtScaleDiv::range | ( |  | ) | const`[inline]`

Returns:
  hBound() - lBound()

Definition at line 119 of file qwt_scale_div.h.

Referenced by QwtPlotPicker::scaleRect().

void QwtScaleDiv::setTicks | ( | int | type,
|  | const QwtValueList & | ticks |
| ) |  |  |

Assign ticks

Parameters:

  | type | MinorTick, MediumTick or MajorTick
  | ticks | Values of the tick positions

Definition at line 149 of file qwt_scale_div.cpp.

const QwtValueList & QwtScaleDiv::ticks | ( | int | type | ) | const

Return a list of ticks

Parameters:

  | type | MinorTick, MediumTick or MajorTick

Definition at line 160 of file qwt_scale_div.cpp.

Referenced by QwtRoundScaleDraw::extent(), QwtScaleDraw::getBorderDistHint(), invert(), QwtScaleDraw::maxLabelHeight(), QwtScaleDraw::maxLabelWidth(), QwtScaleDraw::minLabelDist(), QwtScaleDraw::minLength(), QwtScaleDiv(), and QwtPlot::sizeHint().

void QwtScaleDiv::invalidate | ( |  | ) |

Invalidate the scale division.

Definition at line 98 of file qwt_scale_div.cpp.

bool QwtScaleDiv::isValid | ( |  | ) | const

Check if the scale division is valid.

Definition at line 110 of file qwt_scale_div.cpp.

void QwtScaleDiv::invert | ( |  | ) |

Invert the scale divison.

Definition at line 127 of file qwt_scale_div.cpp.

References ticks().

Referenced by QwtLog10ScaleEngine::divideScale().