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
Display flags.
typedef QFlags< GridAttribute > GridAttributes
Grid attributes.

  Public Member Functions
QwtPolarGrid ()
Constructor.
virtual ~QwtPolarGrid ()
Destructor.
virtual int rtti () const
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
virtual void updateScaleDiv (const QwtScaleDiv &azimuthMap, const QwtScaleDiv &radialMap, const QwtInterval &)
Update the item to changes of the axes scale division.
virtual int marginHint () const

  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:
    QwtPolarPlot, QwtPolar::Axis

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

  enum QwtPolarGrid::GridAttribute

Grid attributes.

See Also:
    setGridAttributes(), testGridAttributes()

Enumerator

AutoScaling
    When AutoScaling is enabled, the radial axes will be adjusted to the interval, that is currently visible on the canvas plot.

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.

Member Function Documentation

  QFont QwtPolarGrid::axisFont (intaxisId) const

Returns:
    Font for the tick labels of a specific axis

Parameters:
    axisId Axis id (QwtPolar::Axis)

  QPen QwtPolarGrid::axisPen (intaxisId) const

Returns:
    Pen for painting a specific axis

Parameters:
    axisId Axis id (QwtPolar::Axis)

See Also:
    setAxisPen()

  const QwtRoundScaleDraw * QwtPolarGrid::azimuthScaleDraw () const

Returns:
    Scale draw for the azimuth scale

See Also:
    setAzimuthScaleDraw(), scaleDraw()

  QwtRoundScaleDraw * QwtPolarGrid::azimuthScaleDraw ()

Returns:
    Scale draw for the azimuth scale

See Also:
    setAzimuthScaleDraw(), scaleDraw()

  void QwtPolarGrid::draw (QPainter *painter, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, doubleradius, const QRectF &canvasRect) const [virtual]
Draw the grid and axes

Parameters:
    painter Painter
    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.

  void QwtPolarGrid::drawAxis (QPainter *painter, intaxisId) const [protected]
Paint an axis

Parameters:
    painter Painter
    axisId Axis id (QwtPolar::Axis)

  void QwtPolarGrid::drawCircles (QPainter *painter, const QRectF &canvasRect, const QPointF &pole, const QwtScaleMap &radialMap, const QList< double > &values) const [protected]
Draw circles

Parameters:
    painter Painter
    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

  void QwtPolarGrid::drawRays (QPainter *painter, const QRectF &canvasRect, const QPointF &pole, doubleradius, const QwtScaleMap &azimuthMap, const QList< double > &values) const [protected]
Draw lines from the pole

Parameters:
    painter Painter
    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

  bool QwtPolarGrid::isAxisVisible (intaxisId) const

Returns:
    true if the axis is visible

Parameters:
    axisId Axis id (QwtPolar::Axis)

See Also:
    showAxis()

  bool QwtPolarGrid::isGridVisible (intscaleId) const

Returns:
    true if grid lines are enabled

Parameters:
    scaleId Scale id ( QwtPolar::Scale )

See Also:
    QwtPolar::Scale, showGrid()

  bool QwtPolarGrid::isMinorGridVisible (intscaleId) const

Returns:
    true if minor grid lines are enabled

Parameters:
    scaleId Scale id ( QwtPolar::Scale )

See Also:
    showMinorGrid()

  QPen QwtPolarGrid::majorGridPen (intscaleId) const

Returns:
    Pen for painting the major grid lines of a specific scale

Parameters:
    scaleId Scale id ( QwtPolar::Scale )

See Also:
    setMajorGridPen(), minorGridPen()

  int QwtPolarGrid::marginHint () const [virtual]

Returns:
    Number of pixels, that are necessary to paint the azimuth scale

See Also:
    QwtRoundScaleDraw::extent()

Reimplemented from QwtPolarItem.

  QPen QwtPolarGrid::minorGridPen (intscaleId) const

Returns:
    Pen for painting the minor grid lines of a specific scale

Parameters:
    scaleId Scale id ( QwtPolar::Scale )

  int QwtPolarGrid::rtti () const [virtual]

Returns:
    QwtPlotItem::Rtti_PolarGrid

Reimplemented from QwtPolarItem.

  const QwtScaleDraw * QwtPolarGrid::scaleDraw (intaxisId) const
Returns the scale draw of a specified axis

Parameters:
    axisId axis index ( QwtPolar::AxisLeft <= axisId <= QwtPolar::AxisBottom)

Returns:
    specified scaleDraw for axis, or NULL if axis is invalid.

See Also:
    azimuthScaleDraw()

  QwtScaleDraw * QwtPolarGrid::scaleDraw (intaxisId)
Returns the scale draw of a specified axis

Parameters:
    axisId axis index ( QwtPolar::AxisLeft <= axisId <= QwtPolar::AxisBottom)

Returns:
    specified scaleDraw for axis, or NULL if axis is invalid.

See Also:
    setScaleDraw(), azimuthScaleDraw()

  void QwtPolarGrid::setAxisFont (intaxisId, const QFont &font)
Assign a font for the tick labels of a specific axis

Parameters:
    axisId Axis id (QwtPolar::Axis)
    font new Font

  void QwtPolarGrid::setAxisPen (intaxisId, const QPen &pen)
Assign a pen for painting an axis

Parameters:
    axisId Axis id (QwtPolar::Axis)
    pen Pen

See Also:
    axisPen()

  void QwtPolarGrid::setAzimuthScaleDraw (QwtRoundScaleDraw *scaleDraw)

Set a scale draw for the azimuth scale.

Parameters:
    scaleDraw object responsible for drawing scales.

See Also:
    azimuthScaleDraw(), setScaleDraw()

  void QwtPolarGrid::setDisplayFlag (DisplayFlagflag, boolon = true)
Change the display flags

Parameters:
    flag See DisplayFlag
    on true/false

  void QwtPolarGrid::setFont (const QFont &font)
Assign a font for all scale tick labels

Parameters:
    font Font

See Also:
    setAxisFont()

  void QwtPolarGrid::setGridAttribute (GridAttributeattribute, boolon = true)

Specify an attribute for the grid.

Parameters:
    attribute Grid attribute
    on On/Off

/sa GridAttribute, testGridAttribute(), updateScaleDiv(), QwtPolarPlot::zoom(), QwtPolarPlot::scaleDiv()

  void QwtPolarGrid::setMajorGridPen (const QPen &pen)
Assign a pen for the major grid lines

Parameters:
    pen Pen

See Also:
    setPen(), setMinorGridPen(), majorGridPen

  void QwtPolarGrid::setMajorGridPen (intscaleId, const QPen &pen)
Assign a pen for the major grid lines of a specific scale

Parameters:
    scaleId Scale id ( QwtPolar::Scale )
    pen Pen

See Also:
    setPen(), setMinorGridPen(), majorGridPen

  void QwtPolarGrid::setMinorGridPen (const QPen &pen)
Assign a pen for the minor grid lines

Parameters:
    pen Pen

See Also:
    setPen(), setMajorGridPen(), minorGridPen()

  void QwtPolarGrid::setMinorGridPen (intscaleId, const QPen &pen)
Assign a pen for the minor grid lines of a specific scale

Parameters:
    scaleId Scale id ( QwtPolar::Scale )
    pen Pen

See Also:
    setPen(), setMajorGridPen(), minorGridPen

  void QwtPolarGrid::setPen (const QPen &pen)
Assign a pen for all axes and grid lines

Parameters:
    pen Pen

See Also:
    setMajorGridPen(), setMinorGridPen(), setAxisPen()

  void QwtPolarGrid::setScaleDraw (intaxisId, QwtScaleDraw *scaleDraw)

Set a scale draw.

Parameters:
    axisId axis index ( QwtPolar::AxisLeft <= axisId <= QwtPolar::AxisBottom)
    scaleDraw object responsible for drawing scales.

See Also:
    scaleDraw(), setAzimuthScaleDraw()

  void QwtPolarGrid::showAxis (intaxisId, boolshow = true)
Show/Hide an axis

Parameters:
    axisId Axis id (QwtPolar::Axis)
    show true/false

See Also:
    isAxisVisible()

  void QwtPolarGrid::showGrid (intscaleId, boolshow = true)
Show/Hide grid lines for a scale

Parameters:
    scaleId Scale id ( QwtPolar::Scale )
    show true/false

  void QwtPolarGrid::showMinorGrid (intscaleId, boolshow = true)
Show/Hide minor grid lines for a scale

To display minor grid lines. showGrid() needs to be enabled too.

Parameters:
    scaleId Scale id ( QwtPolar::Scale )
    show true/false

See Also:
    showGrid

  bool QwtPolarGrid::testDisplayFlag (DisplayFlagflag) const

Returns:
    true, if flag is enabled

Parameters:
    flag See DisplayFlag

  bool QwtPolarGrid::testGridAttribute (GridAttributeattribute) const

Returns:
    true, if attribute is enabled

See Also:
    GridAttribute, setGridAttribute()

  void QwtPolarGrid::updateScaleDiv (const QwtScaleDiv &azimuthScaleDiv, const QwtScaleDiv &radialScaleDiv, const QwtInterval &interval) [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:
    azimuthScaleDiv Scale division of the azimuth-scale
    radialScaleDiv Scale division of the radius-axis
    interval The interval of the radius-axis, that is visible on the canvas

See Also:
    QwtPolarPlot::setGridAttributes()

Reimplemented from QwtPolarItem.

Author

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