QwtScaleDiv(3)

πŸ’… QwtScaleDiv πŸ’…

okay so real talk β€” this page comes to you straight out of the Library Functions Manual, and it's all about QwtScaleDiv, a class representing a scale division. she's iconic, she's geometric, she's got main character energy. let's get into it πŸŽ€


✨ NAME ✨

QwtScaleDiv β€” a class representing a scale division. no cap, that's literally the whole thing πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <qwt_scale_div.h>

🌸 Public Types 🌸

enum TickType { NoTick = -1, MinorTick, MediumTick, MajorTick,
    NTickTypes }

Scale tick types ✨ (yes bestie, there are four of them, we'll get there)

🫢 Public Member Functions 🫢

  • QwtScaleDiv (double lowerBound=0.0, double upperBound=0.0) β€” the basic constructor
  • QwtScaleDiv (const QwtInterval &, QList< double >[NTickTypes]) β€” constructor from an interval plus a tick array
  • QwtScaleDiv (double lowerBound, double upperBound, QList< double >[NTickTypes]) β€” constructor from two bounds plus a tick array
  • QwtScaleDiv (double lowerBound, double upperBound, const QList< double > &minorTicks, const QList< double > &mediumTicks, const QList< double > &majorTicks) β€” the "gimme all three tick lists explicitly" constructor
  • bool operator== (const QwtScaleDiv &) const β€” Equality operator. πŸ’―
  • bool operator!= (const QwtScaleDiv &) const β€” Inequality. the opposite vibe πŸ™ˆ
  • void setInterval (double lowerBound, double upperBound) β€” set the interval from two numbers
  • void setInterval (const QwtInterval &) β€” set the interval from a QwtInterval
  • QwtInterval interval () const β€” grab the interval back out
  • void setLowerBound (double) β€” set the lower bound
  • double lowerBound () const β€” read the lower bound
  • void setUpperBound (double) β€” set the upper bound
  • double upperBound () const β€” read the upper bound
  • double range () const β€” the range
  • bool contains (double value) const β€” is this value in here or not
  • void setTicks (int tickType, const QList< double > &) β€” assign ticks
  • QList< double > ticks (int tickType) const β€” get the tick list for a type
  • bool isEmpty () const β€” Check if the scale division is empty( lowerBound() == upperBound() ). ⭐
  • bool isIncreasing () const β€” Check if the scale division is increasing( lowerBound() <= upperBound() ). ⭐
  • void invert () β€” flip it in place
  • QwtScaleDiv inverted () const β€” get a flipped copy
  • QwtScaleDiv bounded (double lowerBound, double upperBound) const β€” clamp a copy to an interval

🌈 Detailed Description 🌈

A class representing a scale division. periodt.

A Qwt scale is defined by its boundaries and 3 list for the positions of the major, medium and minor ticks. (three lists, three tick flavors β€” she's organized πŸ’…)

the tea on upperBound(): it might be smaller than the lowerBound() to indicate inverted scales. yes bestie, that's on purpose, that's not a bug, don't come for her 😭

Scale divisions can be calculated from a QwtScaleEngine. 🧚

See also: QwtScaleEngine::divideScale(), QwtPlot::setAxisScaleDiv(), QwtAbstractSlider::setScaleDiv()

Definition at line 33 of file qwt_scale_div.h.


πŸŽ€ Member Enumeration Documentation πŸŽ€

enum QwtScaleDiv::TickType

Scale tick types. the whole tick taxonomy, laid out πŸ¦‹

Enumerator:

  • NoTick β€” No ticks. literally none. the void. πŸ’€
  • MinorTick β€” Minor ticks. the little ones πŸ“
  • MediumTick β€” Medium ticks. the middle children 🌸
  • MajorTick β€” Major ticks. the main characters πŸ‘‘
  • NTickTypes β€” Number of valid tick types.

Definition at line 37 of file qwt_scale_div.h.


✨ Constructor & Destructor Documentation ✨

QwtScaleDiv::QwtScaleDiv (double lowerBound = 0.0, double upperBound = 0.0)

[explicit]

Construct a division without ticks. a clean slate, no little marks anywhere, just vibes 🫢

Parameters:

  • lowerBound β€” First boundary
  • upperBound β€” Second boundary
Note: lowerBound might be greater than upperBound for inverted scales. (inverted is a look, okay?)

Definition at line 21 of file qwt_scale_div.cpp.

QwtScaleDiv::QwtScaleDiv (const QwtInterval & interval, QList< double > ticks[NTickTypes])

[explicit]

Construct a scale division πŸ’–

Parameters:

  • interval β€” Interval
  • ticks β€” List of major, medium and minor ticks

Definition at line 33 of file qwt_scale_div.cpp.

QwtScaleDiv::QwtScaleDiv (double lowerBound, double upperBound, QList< double > ticks[NTickTypes])

[explicit]

Construct a scale division πŸ’–

Parameters:

  • lowerBound β€” First boundary
  • upperBound β€” Second boundary
  • ticks β€” List of major, medium and minor ticks
Note: lowerBound might be greater than upperBound for inverted scales.

Definition at line 51 of file qwt_scale_div.cpp.

QwtScaleDiv::QwtScaleDiv (double lowerBound, double upperBound, const QList< double > & minorTicks, const QList< double > & mediumTicks, const QList< double > & majorTicks)

[explicit]

Construct a scale division πŸ’– (this one wants all three lists handed to her directly, no array, we love an explicit queen)

Parameters:

  • lowerBound β€” First boundary
  • upperBound β€” Second boundary
  • minorTicks β€” List of minor ticks
  • mediumTicks β€” List medium ticks
  • majorTicks β€” List of major ticks
Note: lowerBound might be greater than upperBound for inverted scales.

Definition at line 71 of file qwt_scale_div.cpp.


πŸ’œ Member Function Documentation πŸ’œ

QwtScaleDiv QwtScaleDiv::bounded (double lowerBound, double upperBound) const

Return a scale division with an interval [lowerBound, upperBound] where all ticks outside this interval are removed. she's doing a little cleanup, a little curation, a little "you're not on the guest list" energy ✨

Parameters:

  • lowerBound β€” Lower bound
  • upperBound β€” Upper bound

Returns: Scale division with all ticks inside of the given interval

Note: lowerBound might be greater than upperBound for inverted scales.

Definition at line 263 of file qwt_scale_div.cpp.

bool QwtScaleDiv::contains (double value) const

Return if a value is between lowerBound() and upperBound(). the vibe check for numbers 🫢

Parameters:

  • value β€” Value

Returns: true/false

Definition at line 212 of file qwt_scale_div.cpp.

QwtInterval QwtScaleDiv::interval () const

Returns: lowerBound -> upperBound

Definition at line 111 of file qwt_scale_div.cpp.

void QwtScaleDiv::invert ()

Invert the scale division. do it in place, no copy, no drama πŸ’…

See also: inverted()

Definition at line 224 of file qwt_scale_div.cpp.

QwtScaleDiv QwtScaleDiv::inverted () const

Returns: A scale division with inverted boundaries and ticks

See also: invert()

Definition at line 244 of file qwt_scale_div.cpp.

bool QwtScaleDiv::isEmpty () const

Check if the scale division is empty( lowerBound() == upperBound() ). 😭

Definition at line 195 of file qwt_scale_div.cpp.

bool QwtScaleDiv::isIncreasing () const

Check if the scale division is increasing( lowerBound() <= upperBound() ). ⭐

Definition at line 201 of file qwt_scale_div.cpp.

double QwtScaleDiv::lowerBound () const

Returns: First boundary

See also: upperBound()

Definition at line 131 of file qwt_scale_div.cpp.

bool QwtScaleDiv::operator!= (const QwtScaleDiv & other) const

Inequality. πŸ™ˆ

Returns: true if this instance is not equal to other

Definition at line 189 of file qwt_scale_div.cpp.

bool QwtScaleDiv::operator== (const QwtScaleDiv & other) const

Equality operator. πŸ’―

Returns: true if this instance is equal to other

Definition at line 168 of file qwt_scale_div.cpp.

double QwtScaleDiv::range () const

Returns: upperBound() - lowerBound()

Definition at line 159 of file qwt_scale_div.cpp.

void QwtScaleDiv::setInterval (const QwtInterval & interval)

Change the interval.

Parameters:

  • interval β€” Interval

Definition at line 102 of file qwt_scale_div.cpp.

void QwtScaleDiv::setInterval (double lowerBound, double upperBound)

Change the interval.

Parameters:

  • lowerBound β€” First boundary
  • upperBound β€” Second boundary
Note: lowerBound might be greater than upperBound for inverted scales.

Definition at line 91 of file qwt_scale_div.cpp.

void QwtScaleDiv::setLowerBound (double lowerBound)

Set the first boundary.

Parameters:

  • lowerBound β€” First boundary
See also: lowerBound(), setUpperBound()

Definition at line 122 of file qwt_scale_div.cpp.

void QwtScaleDiv::setTicks (int tickType, const QList< double > & ticks)

Assign ticks. πŸŽ€

Parameters:

  • tickType β€” MinorTick, MediumTick or MajorTick
  • ticks β€” Values of the tick positions

Definition at line 297 of file qwt_scale_div.cpp.

void QwtScaleDiv::setUpperBound (double upperBound)

Set the second boundary.

Parameters:

  • upperBound β€” Second boundary
See also: upperBound(), setLowerBound()

Definition at line 142 of file qwt_scale_div.cpp.

QList< double > QwtScaleDiv::ticks (int tickType) const

Return a list of ticks. 🌸

Parameters:

  • tickType β€” MinorTick, MediumTick or MajorTick

Returns: Tick list

Definition at line 309 of file qwt_scale_div.cpp.

double QwtScaleDiv::upperBound () const

Returns: upper bound

See also: lowerBound()

Definition at line 151 of file qwt_scale_div.cpp.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Qwt User's Guide from the source code.


and that's the whole page bestie 🫢 this div came to you from the Qwt User's Guide, auto-generated by Doxygen straight from the source code β€” so if you're picturing a tired little robot typing this out at 3am, you're honestly not far off πŸ˜­πŸ’– slay, go build something pretty with it. πŸŽ€βœ¨

πŸ“¦ where this page comes from