- experimental 6.2.0-1
QwtPolarGrid(3) | Qwt User's Guide | QwtPolarGrid(3) |
NAME¶
QwtPolarGrid - An item which draws scales and grid lines on a polar plot.
SYNOPSIS¶
#include <qwt_polar_grid.h>
Inherits QwtPolarItem.
Public Types¶
enum DisplayFlag { SmartOriginLabel = 1,
HideMaxRadiusLabel = 2, ClipAxisBackground = 4,
SmartScaleDraw = 8, ClipGridLines = 16 }
enum GridAttribute { AutoScaling = 0x01 }
Grid attributes. typedef QFlags< DisplayFlag >
DisplayFlags
typedef QFlags< GridAttribute > GridAttributes
Public Member Functions¶
QwtPolarGrid ()
Constructor. virtual ~QwtPolarGrid ()
Destructor. virtual int rtti () const override
void setDisplayFlag (DisplayFlag, bool on=true)
bool testDisplayFlag (DisplayFlag) const
void setGridAttribute (GridAttribute, bool on=true)
Specify an attribute for the grid. bool testGridAttribute
(GridAttribute) const
void showGrid (int scaleId, bool show=true)
bool isGridVisible (int scaleId) const
void showMinorGrid (int scaleId, bool show=true)
bool isMinorGridVisible (int scaleId) const
void showAxis (int axisId, bool show=true)
bool isAxisVisible (int axisId) const
void setPen (const QPen &p)
void setFont (const QFont &)
void setMajorGridPen (const QPen &p)
void setMajorGridPen (int scaleId, const QPen &p)
QPen majorGridPen (int scaleId) const
void setMinorGridPen (const QPen &p)
void setMinorGridPen (int scaleId, const QPen &p)
QPen minorGridPen (int scaleId) const
void setAxisPen (int axisId, const QPen &p)
QPen axisPen (int axisId) const
void setAxisFont (int axisId, const QFont &p)
QFont axisFont (int axisId) const
void setScaleDraw (int axisId, QwtScaleDraw *)
Set a scale draw. const QwtScaleDraw * scaleDraw (int axisId)
const
QwtScaleDraw * scaleDraw (int axisId)
void setAzimuthScaleDraw (QwtRoundScaleDraw *)
Set a scale draw for the azimuth scale. const QwtRoundScaleDraw *
azimuthScaleDraw () const
QwtRoundScaleDraw * azimuthScaleDraw ()
virtual void draw (QPainter *p, const QwtScaleMap
&azimuthMap, const QwtScaleMap &radialMap, const QPointF
&pole, double radius, const QRectF &rect) const override
virtual 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
Protected Member Functions¶
void drawRays (QPainter *, const QRectF &, const
QPointF &pole, double radius, const QwtScaleMap &azimuthMap,
const QList< double > &) const
void drawCircles (QPainter *, const QRectF &, const QPointF
&pole, const QwtScaleMap &radialMap, const QList<
double > &) const
void drawAxis (QPainter *, int axisId) const
Detailed Description¶
An item which draws scales and grid lines on a polar plot.
The QwtPolarGrid class can be used to draw a coordinate grid. A coordinate grid consists of major and minor gridlines. The locations of the gridlines are determined by the azimuth and radial scale divisions.
QwtPolarGrid is also responsible for drawing the axis representing the scales. It is possible to display 4 radial and one azimuth axis.
Whenever the scale divisions of the plot widget changes the grid is synchronized by updateScaleDiv().
See also
Definition at line 41 of file qwt_polar_grid.h.
Member Typedef Documentation¶
typedef QFlags<DisplayFlag > QwtPolarGrid::DisplayFlags¶
An ORed combination of DisplayFlag values.
Definition at line 88 of file qwt_polar_grid.h.
typedef QFlags<GridAttribute > QwtPolarGrid::GridAttributes¶
An ORed combination of GridAttribute values.
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
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. With HideMaxRadiusLabel enabled 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 ). When ClipAxisBackground the 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.
Definition at line 52 of file qwt_polar_grid.h.
enum QwtPolarGrid::GridAttribute¶
Grid attributes.
See also
Enumerator
- AutoScaling
- When AutoScaling is enabled, the radial axes will be adjusted to the interval, that is currently visible on the canvas plot.
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.
Definition at line 84 of file qwt_polar_grid.cpp.
Member Function Documentation¶
QFont QwtPolarGrid::axisFont (int axisId) const¶
Returns
Parameters
Definition at line 556 of file qwt_polar_grid.cpp.
QPen QwtPolarGrid::axisPen (int axisId) const¶
Returns
Parameters
See also
Definition at line 525 of file qwt_polar_grid.cpp.
QwtRoundScaleDraw * QwtPolarGrid::azimuthScaleDraw ()¶
Returns
See also
Definition at line 1127 of file qwt_polar_grid.cpp.
const QwtRoundScaleDraw * QwtPolarGrid::azimuthScaleDraw () const¶
Returns
See also
Definition at line 1117 of file qwt_polar_grid.cpp.
void QwtPolarGrid::draw (QPainter * painter, const QwtScaleMap & azimuthMap, const QwtScaleMap & radialMap, const QPointF & pole, double radius, const QRectF & canvasRect) const [override], [virtual]¶
Draw the grid and axes
Parameters
azimuthMap Maps azimuth values to values related to 0.0, M_2PI
radialMap Maps radius values into painter coordinates.
pole Position of the pole in painter coordinates
radius Radius of the complete plot area in painter coordinates
canvasRect Contents rect of the canvas in painter coordinates
Implements QwtPolarItem.
Definition at line 574 of file qwt_polar_grid.cpp.
void QwtPolarGrid::drawAxis (QPainter * painter, int axisId) const [protected]¶
Paint an axis
Parameters
axisId Axis id (QwtPolar::Axis)
Definition at line 832 of file qwt_polar_grid.cpp.
void QwtPolarGrid::drawCircles (QPainter * painter, const QRectF & canvasRect, const QPointF & pole, const QwtScaleMap & radialMap, const QList< double > & values) const [protected]¶
Draw circles
Parameters
canvasRect Contents rect of the canvas in painter coordinates
pole Position of the pole in painter coordinates
radialMap 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.
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
Parameters
canvasRect Contents rect of the canvas in painter coordinates
pole Position of the pole in painter coordinates
radius Length of the lines in painter coordinates
azimuthMap Maps azimuth values to values related to 0.0, M_2PI
values Azimuth values, indicating the direction of the lines
Definition at line 681 of file qwt_polar_grid.cpp.
bool QwtPolarGrid::isAxisVisible (int axisId) const¶
Returns
Parameters
See also
Definition at line 343 of file qwt_polar_grid.cpp.
bool QwtPolarGrid::isGridVisible (int scaleId) const¶
Returns
Parameters
See also
Definition at line 272 of file qwt_polar_grid.cpp.
bool QwtPolarGrid::isMinorGridVisible (int scaleId) const¶
Returns
Parameters
See also
Definition at line 308 of file qwt_polar_grid.cpp.
QPen QwtPolarGrid::majorGridPen (int scaleId) const¶
Returns
Parameters
See also
Definition at line 454 of file qwt_polar_grid.cpp.
int QwtPolarGrid::marginHint () const [override], [virtual]¶
Returns
See also
Reimplemented from QwtPolarItem.
Definition at line 1049 of file qwt_polar_grid.cpp.
QPen QwtPolarGrid::minorGridPen (int scaleId) const¶
Returns
Parameters
Definition at line 510 of file qwt_polar_grid.cpp.
int QwtPolarGrid::rtti () const [override], [virtual]¶
Returns
Reimplemented from QwtPolarItem.
Definition at line 163 of file qwt_polar_grid.cpp.
QwtScaleDraw * QwtPolarGrid::scaleDraw (int axisId)¶
Returns the scale draw of a specified axis
Parameters
Returns
See also
Definition at line 1083 of file qwt_polar_grid.cpp.
const QwtScaleDraw * QwtPolarGrid::scaleDraw (int axisId) const¶
Returns the scale draw of a specified axis
Parameters
Returns
See also
Definition at line 1068 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setAxisFont (int axisId, const QFont & font)¶
Assign a font for the tick labels of a specific axis
Parameters
font new Font
Definition at line 539 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setAxisPen (int axisId, const QPen & pen)¶
Assign a pen for painting an axis
Parameters
pen Pen
See also
Definition at line 235 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setAzimuthScaleDraw (QwtRoundScaleDraw * scaleDraw)¶
Set a scale draw for the azimuth scale.
Parameters
See also
Definition at line 1139 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setDisplayFlag (DisplayFlag flag, bool on = true)¶
Change the display flags
Parameters
on true/false
Definition at line 174 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setFont (const QFont & font)¶
Assign a font for all scale tick labels
Parameters
See also
Definition at line 390 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setGridAttribute (GridAttribute attribute, bool on = true)¶
Specify an attribute for the grid.
Parameters
on On/Off
/sa GridAttribute, testGridAttribute(), updateScaleDiv(), QwtPolarPlot::zoom(), QwtPolarPlot::scaleDiv()
Definition at line 205 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setMajorGridPen (const QPen & pen)¶
Assign a pen for the major grid lines
Parameters
See also
Definition at line 412 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setMajorGridPen (int scaleId, const QPen & pen)¶
Assign a pen for the major grid lines of a specific scale
Parameters
pen Pen
See also
Definition at line 436 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setMinorGridPen (const QPen & pen)¶
Assign a pen for the minor grid lines
Parameters
See also
Definition at line 469 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setMinorGridPen (int scaleId, const QPen & pen)¶
Assign a pen for the minor grid lines of a specific scale
Parameters
pen Pen
See also
Definition at line 493 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setPen (const QPen & pen)¶
Assign a pen for all axes and grid lines
Parameters
See also
Definition at line 357 of file qwt_polar_grid.cpp.
void QwtPolarGrid::setScaleDraw (int axisId, QwtScaleDraw * scaleDraw)¶
Set a scale draw.
Parameters
scaleDraw object responsible for drawing scales.
See also
Definition at line 1099 of file qwt_polar_grid.cpp.
void QwtPolarGrid::showAxis (int axisId, bool show = true)¶
Show/Hide an axis
Parameters
show true/false
See also
Definition at line 324 of file qwt_polar_grid.cpp.
void QwtPolarGrid::showGrid (int scaleId, bool show = true)¶
Show/Hide grid lines for a scale
Parameters
show true/false
Definition at line 254 of file qwt_polar_grid.cpp.
void QwtPolarGrid::showMinorGrid (int scaleId, bool show = true)¶
Show/Hide minor grid lines for a scale
To display minor grid lines. showGrid() needs to be enabled too.
Parameters
show true/false
See also
Definition at line 290 of file qwt_polar_grid.cpp.
bool QwtPolarGrid::testDisplayFlag (DisplayFlag flag) const¶
Returns
Parameters
Definition at line 191 of file qwt_polar_grid.cpp.
bool QwtPolarGrid::testGridAttribute (GridAttribute attribute) const¶
Returns
See also
Definition at line 222 of file qwt_polar_grid.cpp.
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.
Parameters
radialScaleDiv Scale division of the radius-axis
interval The interval of the radius-axis, that is visible on the canvas
See also
Reimplemented from QwtPolarItem.
Definition at line 952 of file qwt_polar_grid.cpp.
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Sun Jul 18 2021 | Version 6.2.0 |