QwtRoundScaleDraw(3)

NAME
QwtRoundScaleDraw - A class for drawing round scales.

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

  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

  Additional Inherited Members

Detailed Description

A class for drawing round scales. QwtRoundScaleDraw can be used to draw round scales. The circle segment can be adjusted by 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.

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].

Definition at line 44 of file qwt_round_scale_draw.cpp.

Member Function Documentation

  void QwtRoundScaleDraw::drawBackbone (QPainter * painter) const [override], [protected], [virtual]
Draws the baseline of the scale

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

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

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 between 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

Parameters
    center New center

See also
    setRadius()

Definition at line 90 of file qwt_round_scale_draw.cpp.

  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 of radius the scale
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.