QwtScaleEngine(3)

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

🌸 NAME 🌸

QwtScaleEngine β€” the base class for scale engines, bestie</p> ✨


✨ SYNOPSIS ✨

#include <qwt_scale_engine.h>

Inherited by QwtLinearScaleEngine, and QwtLog10ScaleEngine. it's giving family tree πŸ’…</p>

πŸŽ€ Public Types πŸŽ€

enum Attribute { NoAttribute =  0, IncludeReference =  1, Symmetric =
    2, Floating =  4, Inverted =  8 }

πŸ’– Public Member Functions πŸ’–

QwtScaleEngine ()
virtual ~QwtScaleEngine ()
int attributes () const
virtual void autoScale (int maxNumSteps, double &x1, double &x2, double
    &stepSize) const =0
virtual QwtScaleDiv divideScale (double x1, double x2, int maxMajSteps,
    int maxMinSteps, double stepSize=0.0) const =0
double lowerMargin () const
double reference () const
void setAttribute (Attribute, bool on=true)
void setAttributes (int)
void setMargins (double lower, double upper)
void setReference (double reference)
bool testAttribute (Attribute) const
virtual QwtScaleTransformation * transformation () const =0
double upperMargin () const

πŸ¦‹ Protected Member Functions πŸ¦‹

QwtDoubleInterval buildInterval (double v) const
bool contains (const QwtDoubleInterval &, double val) const
double divideInterval (double interval, int numSteps) const
QwtValueList strip (const QwtValueList &, const QwtDoubleInterval &)
    const

πŸ’– DETAILED DESCRIPTION πŸ’–

Base class for scale engines.

Okay so picture this: a scale engine is the little genius that looks at your data and goes "mmhmm, I know what reasonable ranges and step sizes should look like for this scale." That's literally its whole job. 🫢

And the way the scale is laid out? You can vibe-check it with setAttribute(). customisation era</p>

Qwt ships with implementations for logarithmic (log10) and linear scales. And if you wanna contribute other types of scale engines (date/time, log2 ... )? they are welcome, no cap πŸ’–


πŸŽ€ MEMBER ENUMERATION DOCUMENTATION πŸŽ€

🌸 enum QwtScaleEngine::Attribute 🌸

  • IncludeReference</p> β€” Build a scale which includes the reference() value. ✨
  • Symmetric β€” Build a scale which is symmetric to the reference() value. πŸ¦‹
  • Floating β€” The endpoints of the scale are supposed to be equal the outmost included values plus the specified margins (see setMargins()). If this attribute is not set, the endpoints of the scale will be integer multiples of the step size. lowkey important, remember this one
  • Inverted β€” Turn the scale upside down. πŸ™ƒ flip it, reverse it

See also: setAttribute(), testAttribute(), reference(), lowerMargin(), upperMargin()


πŸ‘‘ MEMBER FUNCTION DOCUMENTATION πŸ‘‘

πŸ’œ int QwtScaleEngine::attributes () const

Return the scale attributes. just hands you the whole attribute vibe in one int

See also: Attribute, setAttributes(), testAttribute()


πŸ’œ virtual void QwtScaleEngine::autoScale (int maxNumSteps, double &x1, double &x2, double &stepSize) const [pure virtual]

Align and divide an interval. it's giving "let me fix this range for you" energy

Parameters:

  • maxNumSteps β€” Max. number of steps
  • x1 β€” First limit of the interval (In/Out)
  • x2 β€” Second limit of the interval (In/Out)
  • stepSize β€” Step size (Return value)

Implemented in QwtLog10ScaleEngine, and QwtLinearScaleEngine. ✨


πŸ’œ QwtDoubleInterval QwtScaleEngine::buildInterval (double v) const [protected]

Build an interval for a value. In case of v == 0.0 the interval is [-0.5, 0.5], otherwide it is [0.5 * v, 1.5 * v] yes the original says "otherwide", iconic tbh πŸŽ€


πŸ’œ bool QwtScaleEngine::contains (const QwtDoubleInterval & interval, double value) const [protected]

Check if an interval 'contains' a value. quote-unquote "contains", the scare quotes are in the original, I don't make the rules 😭

Parameters:

  • interval β€” Interval
  • value β€” Value

See also: QwtScaleArithmetic::compareEps()


πŸ’œ double QwtScaleEngine::divideInterval (double intervalSize, int numSteps) const [protected]

Calculate a step size for an interval size. math girlies rise up 🧚

Parameters:

  • intervalSize β€” Interval size
  • numSteps β€” Number of steps

Returns: Step size


πŸ’œ virtual QwtScaleDiv QwtScaleEngine::divideScale (double x1, double x2, int maxMajSteps, int maxMinSteps, double stepSize = 0.0) const [pure virtual]

Calculate a scale division.

Parameters:

  • x1 β€” First interval limit
  • x2 β€” Second interval limit
  • maxMajSteps β€” Maximum for the number of major steps
  • maxMinSteps β€” Maximum number of minor steps
  • stepSize β€” Step size. If stepSize == 0.0, the scaleEngine calculates one. it'll do the math itself, independent queen πŸ’…

Implemented in QwtLog10ScaleEngine, and QwtLinearScaleEngine. ✨


πŸ’œ double QwtScaleEngine::lowerMargin () const

Returns: the margin at the lower end of the scale. The default margin is 0. zero, zilch, nada, that's the default bestie

See also: setMargins()


πŸ’œ double QwtScaleEngine::reference () const

Returns: the reference value

See also: setReference(), setAttribute()


πŸ’œ void QwtScaleEngine::setAttribute (Attribute attribute, bool on = true)

Change a scale attribute. glow-up button for your scale's layout

Parameters:

  • attribute β€” Attribute to change
  • on β€” On/Off

See also: Attribute, testAttribute()


πŸ’œ void QwtScaleEngine::setAttributes (int attributes)

Change the scale attribute.

Parameters:

  • attributes β€” Set scale attributes

See also: Attribute, attributes()


πŸ’œ void QwtScaleEngine::setMargins (double lower, double upper)

Specify margins at the scale's endpoints.

Parameters:

  • lower β€” minimum distance between the scale's lower boundary and the smallest enclosed value
  • upper β€” minimum distance between the scale's upper boundary and the greatest enclosed value

Margins can be used to leave a minimum amount of space between the enclosed intervals and the boundaries of the scale. basically personal space for your scale 🫢

⚠️ Warning: QwtLog10ScaleEngine measures the margins in decades. Yes. Decades. Not your usual units. Don't get caught slipping. 😭

See also: upperMargin(), lowerMargin()


πŸ’œ void QwtScaleEngine::setReference (double r)

Specify a reference point.

Parameters:

  • r β€” new reference value

The reference point is needed if options IncludeReference or Symmetric are active. Its default value is 0.0. zero point zero, always, unless you say otherwise

See also: Attribute


πŸ’œ QwtValueList QwtScaleEngine::strip (const QwtValueList & ticks, const QwtDoubleInterval & interval) const [protected]

Remove ticks from a list, that are not inside an interval. declutter era ✨

Parameters:

  • ticks β€” Tick list
  • interval β€” Interval

Returns: Stripped tick list


πŸ’œ bool QwtScaleEngine::testAttribute (Attribute attribute) const

Check if a attribute is set. goes straight to the point, we love that

Parameters:

  • attribute β€” Attribute to be tested

See also: Attribute, setAttribute()


πŸ’œ virtual QwtScaleTransformation * QwtScaleEngine::transformation () const [pure virtual]

Returns: a transformation

Implemented in QwtLog10ScaleEngine, and QwtLinearScaleEngine. ✨


πŸ’œ double QwtScaleEngine::upperMargin () const

Returns: the margin at the upper end of the scale. The default margin is 0. again, default is zero, we're consistent here

See also: setMargins()


🌈 AUTHOR 🌈

Generated automatically by Doxygen for Qwt User's Guide from the source code. not me getting auto-generated, the robots wrote me fr fr πŸ€–πŸ’–


and that's the whole page bestie, you ate it, no crumbs left πŸ’…βœ¨

Version 5.2.3 β€” dated Tue Nov 20 2012 β€” and it's still serving QwtScaleEngine(3) realness to this very day. periodt. πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from