QwtPlotRescaler(3) | Qwt User's Guide | QwtPlotRescaler(3) |
NAME¶
QwtPlotRescaler -
SYNOPSIS¶
#include <qwt_plot_rescaler.h>
Public Types¶
enum ExpandingDirection { ExpandUp,
ExpandDown, ExpandBoth }
enum RescalePolicy { Fixed, Expanding, Fitting }
Public Member Functions¶
QwtPlotRescaler (QwtPlotCanvas *, int
referenceAxis=QwtPlot::xBottom, RescalePolicy=Expanding)
virtual ~QwtPlotRescaler ()
double aspectRatio (int axis) const
QwtPlotCanvas * canvas ()
const QwtPlotCanvas * canvas () const
virtual bool eventFilter (QObject *, QEvent *)
ExpandingDirection expandingDirection (int axis) const
QwtDoubleInterval intervalHint (int axis) const
bool isEnabled () const
QwtPlot * plot ()
const QwtPlot * plot () const
int referenceAxis () const
void rescale () const
RescalePolicy rescalePolicy () const
void setAspectRatio (double ratio)
void setAspectRatio (int axis, double ratio)
void setEnabled (bool)
void setExpandingDirection (ExpandingDirection)
void setExpandingDirection (int axis, ExpandingDirection)
void setIntervalHint (int axis, const QwtDoubleInterval &)
void setReferenceAxis (int axis)
void setRescalePolicy (RescalePolicy)
Protected Member Functions¶
virtual void canvasResizeEvent (QResizeEvent *)
QwtDoubleInterval expandInterval (const QwtDoubleInterval
&, double width, ExpandingDirection) const
virtual QwtDoubleInterval expandScale (int axis, const QSize
&oldSize, const QSize &newSize) const
QwtDoubleInterval interval (int axis) const
Qt::Orientation orientation (int axis) const
virtual void rescale (const QSize &oldSize, const QSize
&newSize) const
virtual QwtDoubleInterval syncScale (int axis, const
QwtDoubleInterval &reference, const QSize &size) const
virtual void updateScales (QwtDoubleInterval
intervals[QwtPlot::axisCnt]) const
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¶
enum QwtPlotRescaler::RescalePolicy¶
Rescale Policy. The rescale policy defines how to rescale the reference axis and their depending axes.
- •
- 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 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.
- •
- Fitting
The intervals of the axes are calculated, so that all axes include their minimal interval.
Constructor & Destructor Documentation¶
QwtPlotRescaler::QwtPlotRescaler (QwtPlotCanvas *canvas, intreferenceAxis = QwtPlot::xBottom, RescalePolicypolicy = Expanding) [explicit]¶
Constructor
Parameters:
referenceAxis Reference axis, see RescalePolicy
policy Rescale policy
See also:
Member Function Documentation¶
double QwtPlotRescaler::aspectRatio (intaxis) const¶
Return aspect ratio between an axis and the reference axis.
Parameters:
See also:
QwtPlotCanvas * QwtPlotRescaler::canvas ()¶
Returns:
const QwtPlotCanvas * QwtPlotRescaler::canvas () const¶
Returns:
QwtPlotRescaler::ExpandingDirection QwtPlotRescaler::expandingDirection (intaxis) const¶
Return direction in which an axis should be expanded
Parameters:
See also:
QwtDoubleInterval QwtPlotRescaler::expandInterval (const QwtDoubleInterval &interval, doublewidth, ExpandingDirectiondirection) const [protected]¶
Expand the interval
Parameters:
width Distance to be added to the interval
direction Direction of the expand operation
Returns:
QwtDoubleInterval QwtPlotRescaler::expandScale (intaxis, const QSize &oldSize, const QSize &newSize) const [protected], [virtual]¶
Calculate the new scale interval of a plot axis
Parameters:
oldSize Previous size of the canvas
newSize New size of the canvas
Returns:
QwtDoubleInterval QwtPlotRescaler::interval (intaxis) const [protected]¶
Return interval of an axis
Parameters:
bool QwtPlotRescaler::isEnabled () const¶
Returns:
See also:
Qt::Orientation QwtPlotRescaler::orientation (intaxis) const [protected]¶
Return orientation of an axis
Parameters:
QwtPlot * QwtPlotRescaler::plot ()¶
Returns:
const QwtPlot * QwtPlotRescaler::plot () const¶
Returns:
int QwtPlotRescaler::referenceAxis () const¶
Returns:
See also:
void QwtPlotRescaler::rescale (const QSize &oldSize, const QSize &newSize) const [protected], [virtual]¶
Adjust the plot axes scales
Parameters:
newSize New size of the canvas
QwtPlotRescaler::RescalePolicy QwtPlotRescaler::rescalePolicy () const¶
Returns:
See also:
void QwtPlotRescaler::setAspectRatio (doubleratio)¶
Set the aspect ratio between the scale of the reference axis and the other scales. The default ratio is 1.0
Parameters:
See also:
void QwtPlotRescaler::setAspectRatio (intaxis, doubleratio)¶
Set the aspect ratio between the scale of the reference axis and another scale. The default ratio is 1.0
Parameters:
ratio Aspect ratio
See also:
void QwtPlotRescaler::setEnabled (boolon)¶
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:
void QwtPlotRescaler::setExpandingDirection (ExpandingDirectiondirection)¶
Set the direction in which all axis should be expanded
Parameters:
See also:
void QwtPlotRescaler::setExpandingDirection (intaxis, ExpandingDirectiondirection)¶
Set the direction in which an axis should be expanded
Parameters:
direction Direction
See also:
void QwtPlotRescaler::setReferenceAxis (intaxis)¶
Set the reference axis ( see RescalePolicy )
Parameters:
See also:
void QwtPlotRescaler::setRescalePolicy (RescalePolicypolicy)¶
Change the rescale policy
Parameters:
See also:
QwtDoubleInterval QwtPlotRescaler::syncScale (intaxis, const QwtDoubleInterval &reference, const QSize &size) const [protected], [virtual]¶
Synchronize an axis scale according to the scale of the reference axis
Parameters:
reference Interval of the reference axis
size Size of the canvas
void QwtPlotRescaler::updateScales (QwtDoubleIntervalintervals[QwtPlot::axisCnt]) const [protected], [virtual]¶
Update the axes scales
Parameters:
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Tue Nov 20 2012 | Version 5.2.3 |