QwtPlotRescaler takes care of fixed aspect ratios for plot scales.
More...
#include <qwt_plot_rescaler.h>
|
double | pixelDist (int axis, const QSize &) const |
|
QwtPlotRescaler takes care of fixed aspect ratios for plot scales.
QwtPlotRescaler auto adjusts the axes of a QwtPlot according to fixed aspect ratios.
Definition at line 28 of file qwt_plot_rescaler.h.
When rescalePolicy() is set to Expanding its direction depends on ExpandingDirection
Enumerator |
---|
ExpandUp |
The upper limit of the scale is adjusted.
|
ExpandDown |
The lower limit of the scale is adjusted.
|
ExpandBoth |
Both limits of the scale are adjusted.
|
Definition at line 67 of file qwt_plot_rescaler.h.
The rescale policy defines how to rescale the reference axis and their depending axes.
- See also
- ExpandingDirection, setIntervalHint()
Enumerator |
---|
Fixed |
The interval of the reference axis remains unchanged, when the geometry of the canvas changes. All other axes will be adjusted according to their aspect ratio.
|
Expanding |
The interval of the reference axis will be shrunk/expanded, when the geometry of the canvas changes. All other axes will be adjusted according to their aspect ratio.
The interval, that is represented by one pixel is fixed.
|
Fitting |
The intervals of the axes are calculated, so that all axes include their interval hint.
|
Definition at line 37 of file qwt_plot_rescaler.h.
QwtPlotRescaler::~QwtPlotRescaler |
( |
| ) |
|
|
virtual |
double QwtPlotRescaler::aspectRatio |
( |
int |
axis | ) |
const |
QWidget * QwtPlotRescaler::canvas |
( |
| ) |
|
const QWidget * QwtPlotRescaler::canvas |
( |
| ) |
const |
void QwtPlotRescaler::canvasResizeEvent |
( |
QResizeEvent * |
event | ) |
|
|
protectedvirtual |
bool QwtPlotRescaler::eventFilter |
( |
QObject * |
object, |
|
|
QEvent * |
event |
|
) |
| |
|
virtual |
Expand the interval
- Parameters
-
interval | Interval to be expanded |
width | Distance to be added to the interval |
direction | Direction of the expand operation |
- Returns
- Expanded interval
Definition at line 511 of file qwt_plot_rescaler.cpp.
QwtInterval QwtPlotRescaler::expandScale |
( |
int |
axis, |
|
|
const QSize & |
oldSize, |
|
|
const QSize & |
newSize |
|
) |
| const |
|
protectedvirtual |
Calculate the new scale interval of a plot axis
- Parameters
-
axis | Axis index ( see QwtPlot::AxisId ) |
oldSize | Previous size of the canvas |
newSize | New size of the canvas |
- Returns
- Calculated new interval for the axis
Definition at line 388 of file qwt_plot_rescaler.cpp.
QwtInterval QwtPlotRescaler::interval |
( |
int |
axis | ) |
const |
|
protected |
- Parameters
-
axis | Axis index ( see QwtPlot::AxisId ) |
- Returns
- Normalized interval of an axis
Definition at line 494 of file qwt_plot_rescaler.cpp.
QwtInterval QwtPlotRescaler::intervalHint |
( |
int |
axis | ) |
const |
bool QwtPlotRescaler::isEnabled |
( |
| ) |
const |
Qt::Orientation QwtPlotRescaler::orientation |
( |
int |
axis | ) |
const |
|
protected |
- Returns
- Orientation of an axis
- Parameters
-
axis | Axis index ( see QwtPlot::AxisId ) |
Definition at line 482 of file qwt_plot_rescaler.cpp.
double QwtPlotRescaler::pixelDist |
( |
int |
axis, |
|
|
const QSize & |
size |
|
) |
| const |
|
private |
QwtPlot * QwtPlotRescaler::plot |
( |
| ) |
|
const QwtPlot * QwtPlotRescaler::plot |
( |
| ) |
const |
int QwtPlotRescaler::referenceAxis |
( |
| ) |
const |
void QwtPlotRescaler::rescale |
( |
| ) |
const |
void QwtPlotRescaler::rescale |
( |
const QSize & |
oldSize, |
|
|
const QSize & |
newSize |
|
) |
| const |
|
protectedvirtual |
Adjust the plot axes scales
- Parameters
-
oldSize | Previous size of the canvas |
newSize | New size of the canvas |
Definition at line 357 of file qwt_plot_rescaler.cpp.
void QwtPlotRescaler::setAspectRatio |
( |
double |
ratio | ) |
|
Set the aspect ratio between the scale of the reference axis and the other scales. The default ratio is 1.0
- Parameters
-
- See also
- aspectRatio()
Definition at line 202 of file qwt_plot_rescaler.cpp.
void QwtPlotRescaler::setAspectRatio |
( |
int |
axis, |
|
|
double |
ratio |
|
) |
| |
Set the aspect ratio between the scale of the reference axis and another scale. The default ratio is 1.0
- Parameters
-
axis | Axis index ( see QwtPlot::AxisId ) |
ratio | Aspect ratio |
- See also
- aspectRatio()
Definition at line 216 of file qwt_plot_rescaler.cpp.
void QwtPlotRescaler::setEnabled |
( |
bool |
on | ) |
|
void QwtPlotRescaler::setIntervalHint |
( |
int |
axis, |
|
|
const QwtInterval & |
interval |
|
) |
| |
void QwtPlotRescaler::setReferenceAxis |
( |
int |
axis | ) |
|
Synchronize an axis scale according to the scale of the reference axis
- Parameters
-
axis | Axis index ( see QwtPlot::AxisId ) |
reference | Interval of the reference axis |
size | Size of the canvas |
- Returns
- New interval for axis
Definition at line 451 of file qwt_plot_rescaler.cpp.
void QwtPlotRescaler::updateScales |
( |
QwtInterval |
intervals[QwtPlot::axisCnt] | ) |
const |
|
protectedvirtual |
The documentation for this class was generated from the following files: