#include <qwt_plot_rescaler.h>
List of all members.
Public Types |
enum | ExpandingDirection {
ExpandUp,
ExpandDown,
ExpandBoth
} |
enum | RescalePolicy {
Fixed,
Expanding,
Fitting
} |
Detailed Description
QwtPlotRescaler takes care of fixed aspect ratios for plot scales.
QwtPlotRescaler autoadjusts the axes of a QwtPlot according to fixed aspect ratios.
Member Enumeration Documentation
Rescale Policy.
The rescale policy defines how to rescale the reference axis and their depending axes.
Expanding
The interval of the reference axis will be shrinked/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.
Constructor & Destructor Documentation
QwtPlotRescaler::QwtPlotRescaler |
( |
QwtPlotCanvas * |
canvas, |
|
|
int |
referenceAxis = QwtPlot::xBottom , |
|
|
RescalePolicy |
policy = Expanding |
|
) |
| |
|
explicit |
Member Function Documentation
double QwtPlotRescaler::aspectRatio |
( |
int |
axis | ) |
const |
Return aspect ratio between an axis and the reference axis.
- Parameters:
-
axis | Axis index ( see QwtPlot::AxisId ) |
- See also:
- setAspectRatio()
QwtPlotRescaler::ExpandingDirection QwtPlotRescaler::expandingDirection |
( |
int |
axis | ) |
const |
Return direction in which an axis should be expanded
- Parameters:
-
axis | Axis index ( see QwtPlot::AxisId ) |
- See also:
- setExpandingDirection()
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
QwtDoubleInterval 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
Return interval of an axis
- Parameters:
-
axis | Axis index ( see QwtPlot::AxisId ) |
bool QwtPlotRescaler::isEnabled |
( |
| ) |
const |
Qt::Orientation QwtPlotRescaler::orientation |
( |
int |
axis | ) |
const |
|
protected |
Return orientation of an axis
- Parameters:
-
axis | Axis index ( see QwtPlot::AxisId ) |
QwtPlot * QwtPlotRescaler::plot |
( |
| ) |
|
const QwtPlot * QwtPlotRescaler::plot |
( |
| ) |
const |
int QwtPlotRescaler::referenceAxis |
( |
| ) |
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 |
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()
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()
void QwtPlotRescaler::setEnabled |
( |
bool |
on | ) |
|
En/disable the rescaler.
When enabled is true an event filter is installed for the canvas, otherwise the event filter is removed.
- Parameters:
-
- See also:
- isEnabled(), eventFilter()
void QwtPlotRescaler::setExpandingDirection |
( |
ExpandingDirection |
direction | ) |
|
void QwtPlotRescaler::setExpandingDirection |
( |
int |
axis, |
|
|
ExpandingDirection |
direction |
|
) |
| |
Set the direction in which an axis should be expanded
- Parameters:
-
axis | Axis index ( see QwtPlot::AxisId ) |
direction | Direction |
- See also:
- expandingDirection()
void QwtPlotRescaler::setReferenceAxis |
( |
int |
axis | ) |
|
Set the reference axis ( see RescalePolicy )
- Parameters:
-
- See also:
- referenceAxis()
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 |
void QwtPlotRescaler::updateScales |
( |
QwtDoubleInterval |
intervals[QwtPlot::axisCnt] | ) |
const |
|
protectedvirtual |
Update the axes scales
- Parameters:
-