QwtPlotRescaler(3)

πŸ“¦ version 5.2.3a, in epel 9, fedora 43, fedora 44

πŸ’– QwtPlotRescaler πŸ’–

okay bestie, welcome to the QwtPlotRescaler(3) page, straight outta the Qwt User's Guide ✨ this is the class that keeps your plot scales in a fixed aspect ratio, and it is, lowkey, a whole vibe. grab a boba, we're going in πŸ§‹


✨ NAME ✨

QwtPlotRescaler β€” the girl who autoadjusts your axes so your aspect ratios stay cute πŸ’…


🌸 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. that's the whole job, and she does it flawlessly, no notes πŸ‘‘

QwtPlotRescaler autoadjusts the axes of a QwtPlot according to fixed aspect ratios. periodt ✨


🌈 Member Enumeration Documentation 🌈

πŸ“ enum QwtPlotRescaler::RescalePolicy πŸ“

Rescale Policy. the rescale policy defines how to rescale the reference axis and their depending axes. like, it's the rules of the game fr fr.

  • 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

QwtPlotRescaler (QwtPlotCanvas *canvas, int referenceAxis =
    QwtPlot::xBottom, RescalePolicy policy = Expanding) [explicit]

Constructor. the main character entrance, honestly πŸšͺ✨

Parameters:

  • canvas β€” Canvas
  • referenceAxis β€” Reference axis, see RescalePolicy
  • policy β€” Rescale policy

See also: setRescalePolicy(), setReferenceAxis()


πŸ”₯ 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()

⭐ QwtPlotCanvas * QwtPlotRescaler::canvas ()

Returns: plot canvas

⭐ const QwtPlotCanvas * QwtPlotRescaler::canvas () const

Returns: plot canvas

⭐ QwtPlotRescaler::ExpandingDirection QwtPlotRescaler::expandingDirection (int axis) const

Return direction in which an axis should be expanded. which way is she growing? we love growth πŸͺ΄

Parameters:

  • axis β€” Axis index ( see QwtPlot::AxisId )

See also: setExpandingDirection()

⭐ QwtDoubleInterval QwtPlotRescaler::expandInterval (const QwtDoubleInterval &interval, double width, ExpandingDirection direction) const [protected]

Expand the interval. stretch her out bestie πŸ’ƒ

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 [protected], [virtual]

Calculate the new scale interval of a plot axis. math girlies rise up πŸ“

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

⭐ QwtDoubleInterval QwtPlotRescaler::interval (int axis) const [protected]

Return interval of an axis.

Parameters:

  • axis β€” Axis index ( see QwtPlot::AxisId )

⭐ bool QwtPlotRescaler::isEnabled () const

Returns: true when enabled, false otherwise

See also: setEnabled, eventFilter()

⭐ Qt::Orientation QwtPlotRescaler::orientation (int axis) const [protected]

Return orientation of an axis.

Parameters:

  • axis β€” Axis index ( see QwtPlot::AxisId )

⭐ QwtPlot * QwtPlotRescaler::plot ()

Returns: plot widget

⭐ const QwtPlot * QwtPlotRescaler::plot () const

Returns: plot widget

⭐ int QwtPlotRescaler::referenceAxis () const

Returns: Reference axis ( see RescalePolicy )

See also: setReferenceAxis()

⭐ void QwtPlotRescaler::rescale (const QSize &oldSize, const QSize &newSize) const [protected], [virtual]

Adjust the plot axes scales. do the thing, girl ✨

Parameters:

  • oldSize β€” Previous size of the canvas
  • newSize β€” New size of the canvas

⭐ QwtPlotRescaler::RescalePolicy QwtPlotRescaler::rescalePolicy () const

Returns: Rescale policy

See also: setRescalePolicy()

⭐ 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:

  • ratio β€” Aspect ratio

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. it's giving on/off switch energy πŸ”Œ

Parameters:

  • on β€” true or false

See also: isEnabled(), eventFilter()

⭐ void QwtPlotRescaler::setExpandingDirection (ExpandingDirection direction)

Set the direction in which all axis should be expanded. everybody grows together, squad goals πŸ«‚

Parameters:

  • direction β€” Direction

See also: expandingDirection()

⭐ 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 ). pick your main character axis πŸ‘‘

Parameters:

  • axis β€” Axis index ( QwtPlot::Axis )

See also: referenceAxis()

⭐ void QwtPlotRescaler::setRescalePolicy (RescalePolicy policy)

Change the rescale policy.

Parameters:

  • policy β€” Rescale policy

See also: rescalePolicy()

⭐ QwtDoubleInterval QwtPlotRescaler::syncScale (int axis, const QwtDoubleInterval &reference, const QSize &size) const [protected], [virtual]

Synchronize an axis scale according to the scale of the reference axis. matching outfits, but for scales πŸ’ž

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 [protected], [virtual]

Update the axes scales.

Parameters:

  • intervals β€” Scale intervals

🧚 Author 🧚

Generated automatically by Doxygen for Qwt User's Guide from the source code. not a human author, just a robot doing its lil thing πŸ€–πŸ’–


okay that's the whole page bestie, you ate that πŸ’…βœ¨

and for the cute sign-off: this lil guide is Version 5.2.3, dated Tue Nov 20 2012 πŸŽ€ she's an icon, she's a legend, and she is the moment β€” go rescale something gorgeous πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from