QwtRoundScaleDraw(3)

πŸ’… QwtRoundScaleDraw(3) β€” manual name: Library Functions Manual πŸ’…

🌸 NAME 🌸

QwtRoundScaleDraw β€” a class for drawing round scales. That’s her whole assignment, and she ate, no cap.

πŸŽ€ SYNOPSIS πŸŽ€

#include <qwt_round_scale_draw.h>

Inherits QwtAbstractScaleDraw.

Inherited by QwtCompassScaleDraw.

πŸ’– Public Member Functions πŸ’–

  • QwtRoundScaleDraw () β€” Constructor.
  • virtual ~QwtRoundScaleDraw () β€” Destructor.
  • void setRadius (double radius)
  • double radius () const
  • void moveCenter (double x, double y) β€” Move the center of the scale draw, leaving the radius unchanged.
  • void moveCenter (const QPointF &)
  • QPointF center () const β€” Get the center of the scale.
  • void setAngleRange (double angle1, double angle2) β€” Adjust the baseline circle segment for round scales.
  • virtual double extent (const QFont &) const override

🫢 Public Member Functions inherited from QwtAbstractScaleDraw 🫢

  • QwtAbstractScaleDraw () β€” Constructor.
  • virtual ~QwtAbstractScaleDraw () β€” Destructor.
  • void setScaleDiv (const QwtScaleDiv &)
  • const QwtScaleDiv & scaleDiv () const
  • void setTransformation (QwtTransform *)
  • const QwtScaleMap & scaleMap () const
  • QwtScaleMap & scaleMap ()
  • void enableComponent (ScaleComponent, bool enable=true)
  • bool hasComponent (ScaleComponent) const
  • void setTickLength (QwtScaleDiv::TickType, double length)
  • double tickLength (QwtScaleDiv::TickType) const
  • double maxTickLength () const
  • void setSpacing (double) β€” Set the spacing between tick and labels.
  • double spacing () const β€” Get the spacing.
  • void setPenWidthF (qreal width) β€” Specify the width of the scale pen.
  • qreal penWidthF () const
  • virtual void draw (QPainter *, const QPalette &) const β€” Draw the scale.
  • virtual QwtText label (double) const β€” Convert a value into its representing label.
  • void setMinimumExtent (double) β€” Set a minimum for the extent.
  • double minimumExtent () const
  • void invalidateCache ()

πŸ›‘οΈ Protected Member Functions πŸ›‘οΈ

  • virtual void drawTick (QPainter *, double value, double len) const β€” override.
  • virtual void drawBackbone (QPainter *) const override
  • virtual void drawLabel (QPainter *, double value) const override

🧚 Protected Member Functions inherited from QwtAbstractScaleDraw 🧚

  • const QwtText & tickLabel (const QFont &, double value) const β€” Convert a value into its representing label and cache it.

🧬 Additional Inherited Members 🧬

🧬 Public Types inherited from QwtAbstractScaleDraw 🧬

  • enum ScaleComponent { Backbone = 0x01, Ticks = 0x02, Labels = 0x04 }
  • typedef QFlags< ScaleComponent > ScaleComponents

🌟 Detailed Description 🌟

Okay so QwtRoundScaleDraw is literally a class for drawing round scales. You can use it to draw round scales β€” that’s the vibe. The circle segment can be adjusted with setAngleRange(). The geometry of the scale can be specified with moveCenter() and setRadius().

After a scale division has been specified as a QwtScaleDiv object using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s), the scale can be drawn with the QwtAbstractScaleDraw::draw() member. Slay.

πŸ“Œ Definition at line 31 of file qwt_round_scale_draw.h.


πŸ’« Constructor & Destructor Documentation πŸ’«

QwtRoundScaleDraw::QwtRoundScaleDraw ()

Constructor. The range of the scale is initialized to [0, 100], The center is set to (50, 50) with a radius of 50. The angle range is set to [-135, 135]. Those are the factory settings, bestie.

πŸ“Œ Definition at line 44 of file qwt_round_scale_draw.cpp.

QwtRoundScaleDraw::~QwtRoundScaleDraw () β€” [virtual]

Destructor. She’s logging off, but make it graceful.

πŸ“Œ Definition at line 53 of file qwt_round_scale_draw.cpp.


πŸ”₯ Member Function Documentation πŸ”₯

QPointF QwtRoundScaleDraw::center () const

Get the center of the scale. The main character location, basically.

πŸ“Œ Definition at line 96 of file qwt_round_scale_draw.cpp.

void QwtRoundScaleDraw::drawBackbone (QPainter * painter) const β€” [override], [protected], [virtual]

Draws the baseline of the scale. It’s giving structural support, honestly.

Parameters:

  • painter β€” Painter.

See also: drawTick(), drawLabel().

Implements QwtAbstractScaleDraw.

πŸ“Œ Definition at line 224 of file qwt_round_scale_draw.cpp.

void QwtRoundScaleDraw::drawLabel (QPainter * painter, double value) const β€” [override], [protected], [virtual]

Draws the label for a major scale tick. Communication icon behavior.

Parameters:

  • painter β€” Painter.
  • value β€” Value.

See also: drawTick(), drawBackbone().

Implements QwtAbstractScaleDraw.

πŸ“Œ Definition at line 145 of file qwt_round_scale_draw.cpp.

void QwtRoundScaleDraw::drawTick (QPainter * painter, double value, double len) const β€” [override], [protected], [virtual]

Draw a tick. Tiny mark, big purpose.

Parameters:

  • painter β€” Painter.
  • value β€” Value of the tick.
  • len β€” Length of the tick.

See also: drawBackbone(), drawLabel().

Implements QwtAbstractScaleDraw.

πŸ“Œ Definition at line 190 of file qwt_round_scale_draw.cpp.

double QwtRoundScaleDraw::extent (const QFont & font) const β€” [override], [virtual]

Calculate the extent of the scale.

The extent is the distance from the baseline to the outermost pixel of the scale draw. radius() + extent() is an upper limit for the radius of the bounding circle.

Parameters:

  • font β€” Font used for painting the labels.

Returns: Calculated extent.

See also: setMinimumExtent(), minimumExtent().

Warning: The implemented algorithm is not too smart and calculates only an upper limit, that might be a few pixels too large.

Implements QwtAbstractScaleDraw.

πŸ“Œ Definition at line 255 of file qwt_round_scale_draw.cpp.

void QwtRoundScaleDraw::moveCenter (const QPointF & center)

Move the center of the scale draw, leaving the radius unchanged. Relocation era, but make it cute.

Parameters:

  • center β€” New center.

See also: setRadius().

πŸ“Œ Definition at line 90 of file qwt_round_scale_draw.cpp.

void QwtRoundScaleDraw::moveCenter (double x, double y) β€” [inline]

Move the center of the scale draw, leaving the radius unchanged. Same energy, coordinate edition.

πŸ“Œ Definition at line 64 of file qwt_round_scale_draw.h.

double QwtRoundScaleDraw::radius () const

Get the radius.

Radius is the radius of the backbone without ticks and labels.

Returns: Radius of the scale.

See also: setRadius(), extent().

πŸ“Œ Definition at line 79 of file qwt_round_scale_draw.cpp.

void QwtRoundScaleDraw::setAngleRange (double angle1, double angle2)

Adjust the baseline circle segment for round scales. The baseline will be drawn from min(angle1,angle2) to max(angle1, angle2). The default setting is [ -135, 135 ]. An angle of 0 degrees corresponds to the 12 o’clock position, and positive angles count in a clockwise direction.

Parameters:

  • angle1, angle2 β€” boundaries of the angle interval in degrees.
Warning: - The angle range is limited to [-360, 360] degrees. Angles exceeding this range will be clipped. - For angles more or equal than 360 degrees above or below min(angle1, angle2), scale marks will not be drawn. - If you need a counterclockwise scale, use QwtScaleDiv::setInterval()

πŸ“Œ Definition at line 118 of file qwt_round_scale_draw.cpp.

void QwtRoundScaleDraw::setRadius (double radius)

Change the radius of the scale. Yes, that’s the assignment.

Radius is the radius of the backbone without ticks and labels.

Parameters:

  • radius β€” New Radius.

See also: moveCenter().

πŸ“Œ Definition at line 66 of file qwt_round_scale_draw.cpp.


✍️ Author ✍️

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

So the author is literally Doxygen doing its thing for Qwt User’s Guide β€” no cap.


πŸ’– footer sign-off: Qwt User's Guide Β· QwtRoundScaleDraw(3). The original footer doesn’t list a date, so I’m not inventing one β€” mwah, bestie. 🫢

πŸ“¦ where this page comes from