QwtPolarGrid(3)
okay bestie, welcome to the QwtPolarGrid(3) page from the Library Functions Manual โ this one is a lot, so grab a snack and let's go ๐
๐ธ NAME ๐ธ
QwtPolarGrid โ an item which draws scales and grid lines on a polar plot. that's literally its whole job, and it ate ๐
โจ SYNOPSIS โจ
#include <qwt_polar_grid.h>
Inherits QwtPolarItem.
๐ Public Types ๐
enum DisplayFlagโ the display flags, with these exact values:
enum DisplayFlag { SmartOriginLabel = 1, HideMaxRadiusLabel = 2,
ClipAxisBackground = 4, SmartScaleDraw = 8, ClipGridLines = 16 }
enum GridAttributeโ grid attributes, bestie:
enum GridAttribute { AutoScaling = 0x01 }
typedef QFlags< DisplayFlag > DisplayFlagstypedef QFlags< GridAttribute > GridAttributes
๐ฆ Public Types inherited from QwtPolarItem ๐ฆ
enum RttiValuesโ runtime type information, iykyk:
enum RttiValues { Rtti_PolarItem = 0, Rtti_PolarGrid, Rtti_PolarMarker,
Rtti_PolarCurve, Rtti_PolarSpectrogram, Rtti_PolarUserItem = 1000 }
enum ItemAttributeโ plot item attributes:
enum ItemAttribute { Legend = 0x01, AutoScale = 0x02 }
enum RenderHintโ render hints:
enum RenderHint { RenderAntialiased = 0x01 }
typedef QFlags< ItemAttribute > ItemAttributestypedef QFlags< RenderHint > RenderHints
๐ Public Member Functions ๐
QwtPolarGrid ()โ constructor, slay.virtual ~QwtPolarGrid ()โ destructor.virtual int rtti () const overridevoid setDisplayFlag (DisplayFlag, bool on=true)bool testDisplayFlag (DisplayFlag) constvoid setGridAttribute (GridAttribute, bool on=true)โ specify an attribute for the grid.bool testGridAttribute (GridAttribute) constvoid showGrid (int scaleId, bool show=true)bool isGridVisible (int scaleId) constvoid showMinorGrid (int scaleId, bool show=true)bool isMinorGridVisible (int scaleId) constvoid showAxis (int axisId, bool show=true)bool isAxisVisible (int axisId) constvoid setPen (const QPen &p)void setFont (const QFont &)void setMajorGridPen (const QPen &p)void setMajorGridPen (int scaleId, const QPen &p)QPen majorGridPen (int scaleId) constvoid setMinorGridPen (const QPen &p)void setMinorGridPen (int scaleId, const QPen &p)QPen minorGridPen (int scaleId) constvoid setAxisPen (int axisId, const QPen &p)QPen axisPen (int axisId) constvoid setAxisFont (int axisId, const QFont &p)QFont axisFont (int axisId) constvoid setScaleDraw (int axisId, QwtScaleDraw *)โ set a scale draw.const QwtScaleDraw * scaleDraw (int axisId) constQwtScaleDraw * scaleDraw (int axisId)void setAzimuthScaleDraw (QwtRoundScaleDraw *)โ set a scale draw for the azimuth scale.const QwtRoundScaleDraw * azimuthScaleDraw () constQwtRoundScaleDraw * azimuthScaleDraw ()virtual void draw (QPainter *p, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, double radius, const QRectF &rect) const overridevirtual void updateScaleDiv (const QwtScaleDiv &azimuthMap, const QwtScaleDiv &radialMap, const QwtInterval &) overrideโ update the item to changes of the axes scale division.virtual int marginHint () const override
๐ Public Member Functions inherited from QwtPolarItem ๐
QwtPolarItem (const QwtText &title=QwtText())virtual ~QwtPolarItem ()โ destroy theQwtPolarItem.void attach (QwtPolarPlot *plot)โ attach the item to a plot.void detach ()โ this method detaches aQwtPolarItemfrom theQwtPolarPlotit has been associated with.QwtPolarPlot * plot () constvoid setTitle (const QString &title)void setTitle (const QwtText &title)const QwtText & title () constvoid setItemAttribute (ItemAttribute, bool on=true)bool testItemAttribute (ItemAttribute) constvoid setRenderHint (RenderHint, bool on=true)bool testRenderHint (RenderHint) constvoid setRenderThreadCount (uint numThreads)uint renderThreadCount () constdouble z () constvoid setZ (double z)โ set the z value.void show ()โ show the item.void hide ()โ hide the item.virtual void setVisible (bool)bool isVisible () constvirtual void itemChanged ()virtual void legendChanged ()virtual QwtInterval boundingInterval (int scaleId) constvoid setLegendIconSize (const QSize &)QSize legendIconSize () constvirtual QList< QwtLegendData > legendData () constโ return all information, that is needed to represent the item on the legend.virtual QwtGraphic legendIcon (int index, const QSizeF &) const
๐ง Protected Member Functions ๐ง
void drawRays (QPainter *, const QRectF &, const QPointF &pole, double radius, const QwtScaleMap &azimuthMap, const QList< double > &) constvoid drawCircles (QPainter *, const QRectF &, const QPointF &pole, const QwtScaleMap &radialMap, const QList< double > &) constvoid drawAxis (QPainter *, int axisId) const
๐ Detailed Description ๐
an item which draws scales and grid lines on a polar plot. no cap, that's the whole point of it.
so the QwtPolarGrid class can be used to draw a coordinate grid. a coordinate grid consists of major and minor gridlines, bestie โ and the locations of the gridlines are determined by the azimuth and radial scale divisions. that's the math, not me โจ
QwtPolarGrid is also responsible for drawing the axis representing the scales. and get this โ it is possible to display 4 radial and one azimuth axis. iconic.
whenever the scale divisions of the plot widget changes, the grid is synchronized by updateScaleDiv(). literally keeping it in sync at all times ๐ซถ
See also: QwtPolarPlot, QwtPolar::Axis
Definition at line 41 of file qwt_polar_grid.h.
๐ Member Typedef Documentation ๐
typedef QFlags<DisplayFlag > QwtPolarGrid::DisplayFlags
an ORed combination of DisplayFlag values. mix and match, bestie ๐
Definition at line 88 of file qwt_polar_grid.h.
typedef QFlags<GridAttribute > QwtPolarGrid::GridAttributes
an ORed combination of GridAttribute values. same energy โจ
Definition at line 103 of file qwt_polar_grid.h.
๐ Member Enumeration Documentation ๐
enum QwtPolarGrid::DisplayFlag
mysterious flags trying to avoid conflicts when painting the scales and grid lines. the default setting enables all flags. ๐ฆ
See also: setDisplayFlag(), testDisplayFlag()
Enumerator:
SmartOriginLabelโ try to avoid situations where the label of the origin is painted over another axis.HideMaxRadiusLabelโ often the outermost tick of the radial scale is close to the canvas border. withHideMaxRadiusLabelenabled it is not painted.ClipAxisBackgroundโ the tick labels of the radial scales might be hard to read when they are painted on top of the radial grid lines ( or on top of a curve/spectrogram ). whenClipAxisBackgroundthe bounding rect of each label is added to the clip region.SmartScaleDrawโ don't paint the backbone of the radial axes when they are very close to a line of the azimuth grid.ClipGridLinesโ all grid lines are clipped against the plot area before being painted. when the plot is zoomed in this will have an significant impact on the performance of the painting code. so like, performance don't @ me ๐
Definition at line 52 of file qwt_polar_grid.h.
enum QwtPolarGrid::GridAttribute
grid attributes, periodt.
See also: setGridAttributes(), testGridAttributes()
Enumerator:
AutoScalingโ whenAutoScalingis enabled, the radial axes will be adjusted to the interval that is currently visible on the canvas plot. watching it adapt in real time? obsessed ๐ฅ
Definition at line 94 of file qwt_polar_grid.h.
๐ Constructor & Destructor Documentation ๐
QwtPolarGrid::QwtPolarGrid () [explicit]
constructor. enables major and disables minor grid lines. the azimuth and right radial axis are visible, all other axes are hidden. autoscaling is enabled. that's the starting loadout, bestie ๐ฎ
Definition at line 84 of file qwt_polar_grid.cpp.
QwtPolarGrid::~QwtPolarGrid () [virtual]
destructor. bye bestie ๐
Definition at line 157 of file qwt_polar_grid.cpp.
๐ Member Function Documentation ๐
Okay bestie, this is the part where every member function gets its moment, and honestly? Iconic. Letโs go function by function, no cap.
โจ axisFont โจ
QFont QwtPolarGrid::axisFont (int axisId) const
This one gives you the font for the tick labels on a specific axis. Thatโs the whole vibe.
- Returns: Font for the tick labels of a specific axis
- Parameters:
axisIdโ Axis id (QwtPolar::Axis)
Definition at line 556 of file qwt_polar_grid.cpp.
โจ axisPen โจ
QPen QwtPolarGrid::axisPen (int axisId) const
Returns the pen used to paint a specific axis. Very โwhat is this axis wearing todayโ energy.
- Returns: Pen for painting a specific axis
- Parameters:
axisIdโ Axis id (QwtPolar::Axis)
- See also:
setAxisPen()
Definition at line 525 of file qwt_polar_grid.cpp.
๐ azimuthScaleDraw โ non-const ๐ซ
QwtRoundScaleDraw * QwtPolarGrid::azimuthScaleDraw ()
Gives you the scale draw for the azimuth scale. Main character pointer energy.
- Returns: Scale draw for the azimuth scale
- See also:
setAzimuthScaleDraw(),scaleDraw()
Definition at line 1127 of file qwt_polar_grid.cpp.
๐ azimuthScaleDraw โ const ๐ซ
const QwtRoundScaleDraw * QwtPolarGrid::azimuthScaleDraw () const
Same azimuth scale draw, but const. Respect the boundaries, bestie.
- Returns: Scale draw for the azimuth scale
- See also:
setAzimuthScaleDraw(),scaleDraw()
Definition at line 1117 of file qwt_polar_grid.cpp.
๐จ draw ๐จ
void QwtPolarGrid::draw (QPainter * painter, const QwtScaleMap & azimuthMap,
const QwtScaleMap & radialMap, const QPointF & pole, double radius,
const QRectF & canvasRect) const [override], [virtual]
The big one: draw the grid and axes. Lowkey the whole visual serve happens here.
- Tags:
[override],[virtual] - Parameters:
painterโ PainterazimuthMapโ Maps azimuth values to values related to0.0, M_2PIradialMapโ Maps radius values into painter coordinates.poleโ Position of the pole in painter coordinatesradiusโ Radius of the complete plot area in painter coordinatescanvasRectโ Contents rect of the canvas in painter coordinates
Implements QwtPolarItem.
Definition at line 574 of file qwt_polar_grid.cpp.
๐๏ธ drawAxis ๐๏ธ
void QwtPolarGrid::drawAxis (QPainter * painter, int axisId) const [protected]
Paint an axis. Protected, so itโs giving backstage access only.
- Access:
[protected] - Parameters:
painterโ PainteraxisIdโ Axis id (QwtPolar::Axis)
Definition at line 832 of file qwt_polar_grid.cpp.
โญ drawCircles โญ
void QwtPolarGrid::drawCircles (QPainter * painter, const QRectF &
canvasRect, const QPointF & pole, const QwtScaleMap & radialMap, const
QList< double > & values) const [protected]
Draw circles. Itโs literally in the name, and the protected-ness is giving โinner circleโ pun, sorry.
- Access:
[protected] - Parameters:
painterโ PaintercanvasRectโ Contents rect of the canvas in painter coordinatespoleโ Position of the pole in painter coordinatesradialMapโ Maps radius values into painter coordinates.valuesโ Radial values, indicating the distances from the pole
Definition at line 751 of file qwt_polar_grid.cpp.
๐ drawRays ๐
void QwtPolarGrid::drawRays (QPainter * painter, const QRectF & canvasRect,
const QPointF & pole, double radius, const QwtScaleMap & azimuthMap,
const QList< double > & values) const [protected]
Draw lines from the pole. Rays? Lines? Either way, they radiate and they slay.
- Access:
[protected] - Parameters:
painterโ PaintercanvasRectโ Contents rect of the canvas in painter coordinatespoleโ Position of the pole in painter coordinatesradiusโ Length of the lines in painter coordinatesazimuthMapโ Maps azimuth values to values related to0.0, M_2PIvaluesโ Azimuth values, indicating the direction of the lines
Definition at line 681 of file qwt_polar_grid.cpp.
๐ isAxisVisible ๐
bool QwtPolarGrid::isAxisVisible (int axisId) const
Vibe check for an axis: visible or not?
- Returns:
trueif the axis is visible - Parameters:
axisIdโ Axis id (QwtPolar::Axis)
- See also:
showAxis()
Definition at line 343 of file qwt_polar_grid.cpp.
๐ isGridVisible ๐
bool QwtPolarGrid::isGridVisible (int scaleId) const
Checks if grid lines are enabled. Grid visibility check, fr fr.
- Returns:
trueif grid lines are enabled - Parameters:
scaleIdโ Scale id (QwtPolar::Scale)
- See also:
QwtPolar::Scale,showGrid()
Definition at line 272 of file qwt_polar_grid.cpp.
๐ isMinorGridVisible ๐
bool QwtPolarGrid::isMinorGridVisible (int scaleId) const
Checks if the minor grid lines are enabled. Little lines, big attitude.
- Returns:
trueif minor grid lines are enabled - Parameters:
scaleIdโ Scale id (QwtPolar::Scale)
- See also:
showMinorGrid()
Definition at line 308 of file qwt_polar_grid.cpp.
๐ซ majorGridPen ๐ซ
QPen QwtPolarGrid::majorGridPen (int scaleId) const
Returns the pen for painting the major grid lines of a specific scale. Major grid lines deserve major pen energy.
- Returns: Pen for painting the major grid lines of a specific scale
- Parameters:
scaleIdโ Scale id (QwtPolar::Scale)
- See also:
setMajorGridPen(),minorGridPen()
Definition at line 454 of file qwt_polar_grid.cpp.
๐ marginHint ๐
int QwtPolarGrid::marginHint () const [override], [virtual]
Tells you how many pixels are necessary to paint the azimuth scale. Itโs the โhow much room do I need for my fitโ of the grid.
- Tags:
[override],[virtual] - Returns: Number of pixels, that are necessary to paint the azimuth scale
- See also:
QwtRoundScaleDraw::extent()
Reimplemented from QwtPolarItem.
Definition at line 1049 of file qwt_polar_grid.cpp.
๐ซ minorGridPen ๐ซ
QPen QwtPolarGrid::minorGridPen (int scaleId) const
Returns the pen for painting the minor grid lines of a specific scale. Tiny lines, very demure.
- Returns: Pen for painting the minor grid lines of a specific scale
- Parameters:
scaleIdโ Scale id (QwtPolar::Scale)
Definition at line 510 of file qwt_polar_grid.cpp.
๐ชช rtti ๐ชช
int QwtPolarGrid::rtti () const [override], [virtual]
Runtime type info moment. It returns QwtPlotItem::Rtti_PolarGrid.
- Tags:
[override],[virtual] - Returns:
QwtPlotItem::Rtti_PolarGrid
Reimplemented from QwtPolarItem.
Definition at line 163 of file qwt_polar_grid.cpp.
๐ง scaleDraw โ non-const ๐ธ
QwtScaleDraw * QwtPolarGrid::scaleDraw (int axisId)
Returns the scale draw of a specified axis. Itโs giving โwhich axis is this and what is it drawing withโ.
- Parameters:
axisIdโ axis index (QwtPolar::AxisLeft <= axisId <= QwtPolar::AxisBottom)
- Returns: specified
scaleDrawfor axis, orNULLif axis is invalid. - See also:
setScaleDraw(),azimuthScaleDraw()
Definition at line 1083 of file qwt_polar_grid.cpp.
๐ง scaleDraw โ const ๐ธ
const QwtScaleDraw * QwtPolarGrid::scaleDraw (int axisId) const
Same scale draw lookup, const edition. Still returns NULL if the axis is invalid โ yes, the classic.
- Parameters:
axisIdโ axis index (QwtPolar::AxisLeft <= axisId <= QwtPolar::AxisBottom)
- Returns: specified
scaleDrawfor axis, orNULLif axis is invalid. - See also:
azimuthScaleDraw()
Definition at line 1068 of file qwt_polar_grid.cpp.
๐ setAxisFont ๐
void QwtPolarGrid::setAxisFont (int axisId, const QFont & font)
Assigns a font for the tick labels of a specific axis. Font glow-up for one axis only.
- Parameters:
axisIdโ Axis id (QwtPolar::Axis)fontโ new Font
Definition at line 539 of file qwt_polar_grid.cpp.
๐ setAxisPen ๐
void QwtPolarGrid::setAxisPen (int axisId, const QPen & pen)
Assigns a pen for painting an axis. New outfit for the axis.
- Parameters:
axisIdโ Axis id (QwtPolar::Axis)penโ Pen
- See also:
axisPen()
Definition at line 235 of file qwt_polar_grid.cpp.
๐ setAzimuthScaleDraw ๐
void QwtPolarGrid::setAzimuthScaleDraw (QwtRoundScaleDraw * scaleDraw)
Sets a scale draw for the azimuth scale. Passing in the object thatโs responsible for drawing scales.
- Parameters:
scaleDrawโ object responsible for drawing scales.
- See also:
azimuthScaleDraw(),setScaleDraw()
Definition at line 1139 of file qwt_polar_grid.cpp.
๐๏ธ setDisplayFlag ๐๏ธ
void QwtPolarGrid::setDisplayFlag (DisplayFlag flag, bool on = true)
Changes the display flags. Tiny switches, big visual consequences.
- Parameters:
flagโ SeeDisplayFlagonโtrue/false
Definition at line 174 of file qwt_polar_grid.cpp.
๐ setFont ๐
void QwtPolarGrid::setFont (const QFont & font)
Assigns a font for all scale tick labels. Group-chat-wide font update, basically.
- Parameters:
fontโ Font
- See also:
setAxisFont()
Definition at line 390 of file qwt_polar_grid.cpp.
๐ ๏ธ setGridAttribute ๐ ๏ธ
void QwtPolarGrid::setGridAttribute (GridAttribute attribute, bool on =
true)
Specifies an attribute for the grid. Youโre toggling grid behavior, bestie.
- Parameters:
attributeโ Grid attributeonโ On/Off
- See also-ish line (literally
/sain the source):/sa GridAttribute, testGridAttribute(), updateScaleDiv(), QwtPolarPlot::zoom(), QwtPolarPlot::scaleDiv()
Definition at line 205 of file qwt_polar_grid.cpp.
๐ซ setMajorGridPen โ all major grid lines ๐ซ
void QwtPolarGrid::setMajorGridPen (const QPen & pen)
Assigns a pen for the major grid lines. Major lines, major pen, major moment.
- Parameters:
penโ Pen
- See also:
setPen(),setMinorGridPen(),majorGridPen
Definition at line 412 of file qwt_polar_grid.cpp.
๐ซ setMajorGridPen โ one scaleโs major grid lines ๐ซ
void QwtPolarGrid::setMajorGridPen (int scaleId, const QPen & pen)
Assigns a pen for the major grid lines of a specific scale. One scale gets its own pen. VIP treatment.
- Parameters:
scaleIdโ Scale id (QwtPolar::Scale)penโ Pen
- See also:
setPen(),setMinorGridPen(),majorGridPen
Definition at line 436 of file qwt_polar_grid.cpp.
๐ซ setMinorGridPen โ all minor grid lines ๐ซ
void QwtPolarGrid::setMinorGridPen (const QPen & pen)
Assigns a pen for the minor grid lines. The little lines are getting styled too, as they should.
- Parameters:
penโ Pen
- See also:
setPen(),setMajorGridPen(),minorGridPen()
Definition at line 469 of file qwt_polar_grid.cpp.
๐ซ setMinorGridPen โ one scaleโs minor grid lines ๐ซ
void QwtPolarGrid::setMinorGridPen (int scaleId, const QPen & pen)
Assigns a pen for the minor grid lines of a specific scale. Very targeted, very precise.
- Parameters:
scaleIdโ Scale id (QwtPolar::Scale)penโ Pen
- See also:
setPen(),setMajorGridPen(),minorGridPen
Definition at line 493 of file qwt_polar_grid.cpp.
๐๏ธ setPen ๐๏ธ
void QwtPolarGrid::setPen (const QPen & pen)
Assigns a pen for all axes and grid lines. One pen to rule them all, no cap.
- Parameters:
penโ Pen
- See also:
setMajorGridPen(),setMinorGridPen(),setAxisPen()
Definition at line 357 of file qwt_polar_grid.cpp.
๐ setScaleDraw ๐
void QwtPolarGrid::setScaleDraw (int axisId, QwtScaleDraw * scaleDraw)
Sets a scale draw. You hand over the object responsible for drawing scales, and the axis says thank you.
- Parameters:
axisIdโ axis index (QwtPolar::AxisLeft <= axisId <= QwtPolar::AxisBottom)scaleDrawโ object responsible for drawing scales.
- See also:
scaleDraw(),setAzimuthScaleDraw()
Definition at line 1099 of file qwt_polar_grid.cpp.
๐๏ธ showAxis ๐๏ธ
void QwtPolarGrid::showAxis (int axisId, bool show = true)
Show/Hide an axis. Axis visibility toggle, simple and powerful.
- Parameters:
axisIdโ Axis id (QwtPolar::Axis)showโtrue/false
- See also:
isAxisVisible()
Definition at line 324 of file qwt_polar_grid.cpp.
๐๏ธ showGrid ๐๏ธ
void QwtPolarGrid::showGrid (int scaleId, bool show = true)
Show/Hide grid lines for a scale. Grid lines on, grid lines off, the eternal question.
- Parameters:
scaleIdโ Scale id (QwtPolar::Scale)showโtrue/false
Definition at line 254 of file qwt_polar_grid.cpp.
๐๏ธ showMinorGrid ๐๏ธ
void QwtPolarGrid::showMinorGrid (int scaleId, bool show = true)
Show/Hide minor grid lines for a scale.
Heads up, bestie: to display minor grid lines, showGrid() needs to be enabled too. The minor lines cannot show up solo.
- Parameters:
scaleIdโ Scale id (QwtPolar::Scale)showโtrue/false
- See also:
showGrid
Definition at line 290 of file qwt_polar_grid.cpp.
โ
testDisplayFlag โ
bool QwtPolarGrid::testDisplayFlag (DisplayFlag flag) const
Returns true if the flag is enabled. A little display-flag vibe check.
- Returns:
true, if flag is enabled - Parameters:
flagโ SeeDisplayFlag
Definition at line 191 of file qwt_polar_grid.cpp.
โ
testGridAttribute โ
bool QwtPolarGrid::testGridAttribute (GridAttribute attribute) const
Returns true if the attribute is enabled. Grid attribute status: confirmed.
- Returns:
true, if attribute is enabled - See also:
GridAttribute,setGridAttribute()
Definition at line 222 of file qwt_polar_grid.cpp.
๐ updateScaleDiv ๐
void QwtPolarGrid::updateScaleDiv (const QwtScaleDiv & azimuthScaleDiv,
const QwtScaleDiv & radialScaleDiv, const QwtInterval & interval)
[override], [virtual]
Update the item to changes of the axes scale division. If AutoScaling is enabled the radial scale is calculated from the interval, otherwise the scales are adopted to the plot scales.
- Tags:
[override],[virtual] - Parameters:
azimuthScaleDivโ Scale division of the azimuth-scaleradialScaleDivโ Scale division of the radius-axisintervalโ The interval of the radius-axis, that is visible on the canvas
- See also:
QwtPolarPlot::setGridAttributes()
Reimplemented from QwtPolarItem.
Definition at line 952 of file qwt_polar_grid.cpp.
๐ AUTHOR ๐
okay so bestie, nobody wrote this page in the human sense โ it was Generated automatically by Doxygen for Qwt User's Guide from the source code. That's it, that's the whole author credit ๐ Doxygen just vibed through the source code and spat this out, no cap. So if you're looking for a person to thank, the source code is the main character here, and Doxygen is the friend who took the notes โจ
and that's a wrap on QwtPolarGrid(3), bestie!! ๐ You made it to the very bottom, which is honestly iconic of you ๐
This page came to you from the Qwt User's Guide (that's the source/version, mwah ๐ซถ) and got stamped with its date down in the footer the way Doxygen always does โ go peek at it down there if you need the exact one, iykyk ๐
now go forth and slay those polar grids, fr fr ๐ธ๐ฆ๐
๐ฆ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 ยท custom
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms