QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | List of all members
QwtSimpleCompassRose Class Reference

A simple rose for QwtCompass. More...

#include <qwt_compass_rose.h>

Inheritance diagram for QwtSimpleCompassRose:
QwtCompassRose

Classes

class  PrivateData
 

Public Member Functions

 QwtSimpleCompassRose (int numThorns=8, int numThornLevels=-1)
 Constructor.
 
void setWidth (double)
 Set the width of the rose heads.
 
double width () const
 Get the width of the rose heads.
 
void setNumThorns (int)
 Set the number of thorns on one level.
 
int numThorns () const
 Get the number of thorns.
 
void setNumThornLevels (int)
 Set the number of thorn levels.
 
int numThornLevels () const
 Get the number of thorn levels.
 
void setShrinkFactor (double factor)
 Set the shrink factor for thorns with each level.
 
double shrinkFactor () const
 Get the shrink factor for thorns with each level.
 
void setFlatStyle (bool)
 Set flat style.
 
bool flatStyle () const
 Return whether flat style is enabled.
 
virtual void draw (QPainter *, const QPointF &center, double radius, double north, QPalette::ColorGroup=QPalette::Active) const override
 Draw the rose.
 
- Public Member Functions inherited from QwtCompassRose
 QwtCompassRose ()
 Constructor.
 
virtual ~QwtCompassRose ()
 Destructor.
 
virtual void setPalette (const QPalette &)
 Assign a palette.
 
const QPalette & palette () const
 Get the current palette.
 

Static Public Member Functions

static void drawRose (QPainter *, const QPalette &, const QPointF &center, double radius, double north, double width, int numThorns, int numThornLevels, double shrinkFactor, bool flatStyle=true)
 Static helper to draw a rose with specified parameters.
 

Detailed Description

A simple rose for QwtCompass.

QwtSimpleCompassRose provides a simple compass rose implementation with configurable thorn count and levels.

Constructor & Destructor Documentation

◆ QwtSimpleCompassRose()

QwtSimpleCompassRose::QwtSimpleCompassRose ( int  numThorns = 8,
int  numThornLevels = -1 
)

Constructor.

Parameters
[in]numThornsNumber of thorns
[in]numThornLevelsNumber of thorn levels (-1 means auto)

Destructor

Member Function Documentation

◆ draw()

void QwtSimpleCompassRose::draw ( QPainter *  painter,
const QPointF &  center,
double  radius,
double  north,
QPalette::ColorGroup  cg = QPalette::Active 
) const
overridevirtual

Draw the rose.

Parameters
[in]painterPainter
[in]centerCenter point
[in]radiusRadius of the rose
[in]northPosition pointing north
[in]cgColor group

Implements QwtCompassRose.

◆ drawRose()

void QwtSimpleCompassRose::drawRose ( QPainter *  painter,
const QPalette &  palette,
const QPointF &  center,
double  radius,
double  north,
double  width,
int  numThorns,
int  numThornLevels,
double  shrinkFactor,
bool  flatStyle = true 
)
static

Static helper to draw a rose with specified parameters.

Parameters
[in]painterPainter
[in]palettePalette for drawing
[in]centerCenter of the rose
[in]radiusRadius of the rose
[in]northPosition pointing to north
[in]widthWidth of the rose heads
[in]numThornsNumber of thorns
[in]numThornLevelsNumber of thorn levels
[in]shrinkFactorFactor to shrink the thorns with each level

◆ flatStyle()

bool QwtSimpleCompassRose::flatStyle ( ) const

Return whether flat style is enabled.

See also
setFlatStyle()

◆ numThornLevels()

int QwtSimpleCompassRose::numThornLevels ( ) const

Get the number of thorn levels.

Returns
Number of thorn levels
See also
setNumThorns(), setNumThornLevels()

◆ numThorns()

int QwtSimpleCompassRose::numThorns ( ) const

Get the number of thorns.

Returns
Number of thorns
See also
setNumThorns(), setNumThornLevels()

◆ setFlatStyle()

void QwtSimpleCompassRose::setFlatStyle ( bool  on)

Set flat style.

When enabled (default), thorns are drawn with a single solid color instead of the two-tone Light/Dark 3D effect.

Parameters
ontrue for flat style, false for classic 3D style
See also
flatStyle()

◆ setNumThornLevels()

void QwtSimpleCompassRose::setNumThornLevels ( int  numThornLevels)

Set the number of thorn levels.

Parameters
[in]numThornLevelsNumber of thorn levels
See also
setNumThorns(), numThornLevels()

◆ setNumThorns()

void QwtSimpleCompassRose::setNumThorns ( int  numThorns)

Set the number of thorns on one level.

Parameters
[in]numThornsNumber of thorns (aligned to multiple of 4, minimum 4)
See also
numThorns(), setNumThornLevels()

◆ setShrinkFactor()

void QwtSimpleCompassRose::setShrinkFactor ( double  factor)

Set the shrink factor for thorns with each level.

Parameters
[in]factorShrink factor (default: 0.9)
See also
shrinkFactor()

◆ setWidth()

void QwtSimpleCompassRose::setWidth ( double  width)

Set the width of the rose heads.

Parameters
[in]widthWidth (range: 0.03 to 0.4, lower values make thinner heads)

◆ shrinkFactor()

double QwtSimpleCompassRose::shrinkFactor ( ) const

Get the shrink factor for thorns with each level.

Returns
Shrink factor
See also
setShrinkFactor()

◆ width()

double QwtSimpleCompassRose::width ( ) const

Get the width of the rose heads.

Returns
Width of the rose heads
See also
setWidth()

The documentation for this class was generated from the following files: