QwtPolarPlot(3)

NAME
QwtPolarPlot -

A plotting widget, displaying a polar coordinate system.

SYNOPSIS

#include <qwt_polar_plot.h>

Inherits QFrame, and QwtPolarItemDict.

  Public Types
enum LegendPosition { LeftLegend, RightLegend, BottomLegend, TopLegend, ExternalLegend }

  Public Slots
virtual void replot ()
Redraw the plot.
void autoRefresh ()
Replots the plot if QwtPlot::autoReplot() is true.
void setAzimuthOrigin (double)
Change the origin of the azimuth scale.

  Signals
void itemAttached (QwtPolarItem *plotItem, bool on)
void legendDataChanged (const QVariant &itemInfo, const QList< QwtLegendData > &data)
void layoutChanged ()

  Public Member Functions
QwtPolarPlot (QWidget *parent=NULL)
QwtPolarPlot (const QwtText &title, QWidget *parent=NULL)
virtual ~QwtPolarPlot ()
Destructor.
void setTitle (const QString &)
void setTitle (const QwtText &)
QwtText title () const
QwtTextLabel * titleLabel ()
const QwtTextLabel * titleLabel () const
void setAutoReplot (bool tf=true)
Set or reset the autoReplot option.
bool autoReplot () const
void setAutoScale (int scaleId)
Enable autoscaling.
bool hasAutoScale (int scaleId) const
void setScaleMaxMinor (int scaleId, int maxMinor)
int scaleMaxMinor (int scaleId) const
int scaleMaxMajor (int scaleId) const
void setScaleMaxMajor (int scaleId, int maxMajor)
QwtScaleEngine * scaleEngine (int scaleId)
const QwtScaleEngine * scaleEngine (int scaleId) const
void setScaleEngine (int scaleId, QwtScaleEngine *)
void setScale (int scaleId, double min, double max, double step=0)
Disable autoscaling and specify a fixed scale for a selected scale.
void setScaleDiv (int scaleId, const QwtScaleDiv &)
Disable autoscaling and specify a fixed scale for a selected scale.
const QwtScaleDiv * scaleDiv (int scaleId) const
Return the scale division of a specified scale.
QwtScaleDiv * scaleDiv (int scaleId)
Return the scale division of a specified scale.
QwtScaleMap scaleMap (int scaleId, double radius) const
QwtScaleMap scaleMap (int scaleId) const
void updateScale (int scaleId)
double azimuthOrigin () const
void zoom (const QwtPointPolar &, double factor)
Translate and in/decrease the zoom factor.
void unzoom ()
QwtPointPolar zoomPos () const
double zoomFactor () const
QwtPolarCanvas * canvas ()
const QwtPolarCanvas * canvas () const
void setPlotBackground (const QBrush &c)
Set the background of the plot area.
const QBrush & plotBackground () const
virtual void drawCanvas (QPainter *, const QRectF &) const
void insertLegend (QwtAbstractLegend *, LegendPosition=RightLegend, double ratio=-1.0)
Insert a legend.
QwtAbstractLegend * legend ()
const QwtAbstractLegend * legend () const
void updateLegend ()
void updateLegend (const QwtPolarItem *)
QwtPolarLayout * plotLayout ()
const QwtPolarLayout * plotLayout () const
QwtInterval visibleInterval () const
QRectF plotRect () const
QRectF plotRect (const QRectF &) const
Calculate the bounding rect of the plot area.
int plotMarginHint () const
virtual QVariant itemToInfo (QwtPolarItem *) const
Build an information, that can be used to identify a plot item on the legend.
virtual QwtPolarItem * infoToItem (const QVariant &) const
Identify the plot item according to an item info object, that has bee generated from itemToInfo().

  Protected Member Functions
virtual bool event (QEvent *)
Qt event handler.
virtual void resizeEvent (QResizeEvent *)
Resize and update internal layout.
virtual void updateLayout ()
Rebuild the layout.
virtual void drawItems (QPainter *painter, const QwtScaleMap &radialMap, const QwtScaleMap &azimuthMap, const QPointF &pole, double radius, const QRectF &canvasRect) const

  Friends
class QwtPolarItem

Detailed Description

A plotting widget, displaying a polar coordinate system. An unlimited number of plot items can be displayed on its canvas. Plot items might be curves (QwtPolarCurve), markers (QwtPolarMarker), the grid (QwtPolarGrid), or anything else derived from QwtPolarItem.

The coordinate system is defined by a radial and a azimuth scale. The scales at the axes can be explicitely set (QwtScaleDiv), or are calculated from the plot items, using algorithms (QwtScaleEngine) which can be configured separately for each axis. Autoscaling is supported for the radial scale.

In opposite to QwtPlot the scales might be different from the view, that is displayed on the canvas. The view can be changed by zooming - f.e. by using QwtPolarPanner or QwtPolarMaginfier.

Member Enumeration Documentation

  enum QwtPolarPlot::LegendPosition
Position of the legend, relative to the canvas.

See Also:
    insertLegend()

Enumerator

LeftLegend
    The legend will be left from the canvas.

RightLegend
    The legend will be right from the canvas.

BottomLegend
    The legend will be below the canvas.

TopLegend
    The legend will be between canvas and title.

ExternalLegend
    External means that only the content of the legend will be handled by QwtPlot, but not its geometry. This might be interesting if an application wants to have a legend in an external window ( or on the canvas ).

Note:
    The legend is not painted by QwtPolarRenderer

Constructor & Destructor Documentation

  QwtPolarPlot::QwtPolarPlot (QWidget *parent = NULL) [explicit]
Constructor

Parameters:
    parent Parent widget

  QwtPolarPlot::QwtPolarPlot (const QwtText &title, QWidget *parent = NULL)
Constructor

Parameters:
    title Title text
    parent Parent widget

Member Function Documentation

  bool QwtPolarPlot::autoReplot () const

Returns:
    true if the autoReplot option is set.

  double QwtPolarPlot::azimuthOrigin () const
The azimuth origin is the angle where the azimuth scale shows the value 0.0.

Returns:
    Origin of the azimuth scale

See Also:
    setAzimuthOrigin()

  QwtPolarCanvas * QwtPolarPlot::canvas ()

Returns:
    the plot's canvas

  const QwtPolarCanvas * QwtPolarPlot::canvas () const

Returns:
    the plot's canvas

  void QwtPolarPlot::drawCanvas (QPainter *painter, const QRectF &canvasRect) const [virtual]
Redraw the canvas.

Parameters:
    painter Painter used for drawing
    canvasRect Contents rect of the canvas

  void QwtPolarPlot::drawItems (QPainter *painter, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, doubleradius, const QRectF &canvasRect) const [protected], [virtual]
Redraw the canvas items.

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

  bool QwtPolarPlot::event (QEvent *e) [protected], [virtual]

Qt event handler. Handles QEvent::LayoutRequest and QEvent::PolishRequest

Parameters:
    e Qt Event

Returns:
    True, when the event was processed

  bool QwtPolarPlot::hasAutoScale (intscaleId) const

Returns:
    true if autoscaling is enabled

Parameters:
    scaleId Scale index

See Also:
    setAutoScale()

  QwtPolarItem * QwtPolarPlot::infoToItem (const QVariant &itemInfo) const [virtual]

Identify the plot item according to an item info object, that has bee generated from itemToInfo(). The default implementation simply tries to unwrap a QwtPlotItem pointer:

if ( itemInfo.canConvert<QwtPlotItem *>() )
    return qvariant_cast<QwtPlotItem *>( itemInfo );

Parameters:
    itemInfo Plot item

Returns:
    A plot item, when successful, otherwise a NULL pointer.

See Also:
    itemToInfo()

  void QwtPolarPlot::insertLegend (QwtAbstractLegend *legend, QwtPolarPlot::LegendPositionpos = RightLegend, doubleratio = -1.0)

Insert a legend. If the position legend is QwtPolarPlot::LeftLegend or QwtPolarPlot::RightLegend the legend will be organized in one column from top to down. Otherwise the legend items will be placed in a table with a best fit number of columns from left to right.

If pos != QwtPolarPlot::ExternalLegend the plot widget will become parent of the legend. It will be deleted when the plot is deleted, or another legend is set with insertLegend().

Parameters:
    legend Legend
    pos The legend's position. For top/left position the number of colums will be limited to 1, otherwise it will be set to unlimited.
    ratio Ratio between legend and the bounding rect of title, canvas and axes. The legend will be shrinked if it would need more space than the given ratio. The ratio is limited to ]0.0 .. 1.0]. In case of <= 0.0 it will be reset to the default ratio. The default vertical/horizontal ratio is 0.33/0.5.

See Also:
    legend(), QwtPolarLayout::legendPosition(), QwtPolarLayout::setLegendPosition()

  void QwtPolarPlot::itemAttached (QwtPolarItem *plotItem, boolon) [signal]
A signal indicating, that an item has been attached/detached

Parameters:
    plotItem Plot item
    on Attached/Detached

  QVariant QwtPolarPlot::itemToInfo (QwtPolarItem *plotItem) const [virtual]

Build an information, that can be used to identify a plot item on the legend. The default implementation simply wraps the plot item into a QVariant object. When overloading itemToInfo() usually infoToItem() needs to reimplemeted too.

QVariant itemInfo;
qVariantSetValue( itemInfo, plotItem );

Parameters:
    plotItem Plot item

See Also:
    infoToItem()

  void QwtPolarPlot::layoutChanged () [signal]
A signal that is emitted, whenever the layout of the plot has been recalculated.

  QwtAbstractLegend * QwtPolarPlot::legend ()

Returns:
    the plot's legend

See Also:
    insertLegend()

  const QwtAbstractLegend * QwtPolarPlot::legend () const

Returns:
    the plot's legend

See Also:
    insertLegend()

  void QwtPolarPlot::legendDataChanged (const QVariant &itemInfo, const QList< QwtLegendData > &data) [signal]
A signal with the attributes how to update the legend entries for a plot item.

Parameters:
    itemInfo Info about a plot, build from itemToInfo()

See Also:
    itemToInfo(), infoToItem(), QwtAbstractLegend::updateLegend()

  const QBrush & QwtPolarPlot::plotBackground () const

Returns:
    plot background brush

See Also:
    plotBackground(), plotArea()

  QwtPolarLayout * QwtPolarPlot::plotLayout ()

Returns:
    Layout, responsible for the geometry of the plot components

  const QwtPolarLayout * QwtPolarPlot::plotLayout () const

Returns:
    Layout, responsible for the geometry of the plot components

  int QwtPolarPlot::plotMarginHint () const

Returns:
    Maximum of all item margin hints.

See Also:
    QwtPolarItem::marginHint()

  QRectF QwtPolarPlot::plotRect () const
The plot area depends on the size of the canvas and the zoom parameters.

Returns:
    Bounding rect of the plot area

  QRectF QwtPolarPlot::plotRect (const QRectF &canvasRect) const

Calculate the bounding rect of the plot area. The plot area depends on the zoom parameters.

Parameters:
    canvasRect Rectangle of the canvas

Returns:
    Rectangle for displaying 100% of the plot

  void QwtPolarPlot::replot () [virtual], [slot]

Redraw the plot. If the autoReplot option is not set (which is the default) or if any curves are attached to raw data, the plot has to be refreshed explicitly in order to make changes visible.

See Also:
    setAutoReplot()

Warning:
    Calls canvas()->repaint, take care of infinite recursions

  const QwtScaleDiv * QwtPolarPlot::scaleDiv (intscaleId) const

Return the scale division of a specified scale. scaleDiv(scaleId)->lBound(), scaleDiv(scaleId)->hBound() are the current limits of the scale.

Parameters:
    scaleId Scale index

Returns:
    Scale division

See Also:
    QwtScaleDiv, setScaleDiv(), setScale()

  QwtScaleDiv * QwtPolarPlot::scaleDiv (intscaleId)

Return the scale division of a specified scale. scaleDiv(scaleId)->lBound(), scaleDiv(scaleId)->hBound() are the current limits of the scale.

Parameters:
    scaleId Scale index

Returns:
    Scale division

See Also:
    QwtScaleDiv, setScaleDiv(), setScale()

  QwtScaleEngine * QwtPolarPlot::scaleEngine (intscaleId)

Returns:
    Scale engine for a specific scale

Parameters:
    scaleId Scale index

See Also:
    setScaleEngine()

  const QwtScaleEngine * QwtPolarPlot::scaleEngine (intscaleId) const

Returns:
    Scale engine for a specific scale

Parameters:
    scaleId Scale index

See Also:
    setScaleEngine()

  QwtScaleMap QwtPolarPlot::scaleMap (intscaleId, doubleradius) const
Build a scale map

The azimuth map translates between the scale values and angles from [0.0, 2 * PI[. The radial map translates scale values into the distance from the pole.

Parameters:
    scaleId Scale index
    radius Radius of the plot are in pixels

Returns:
    Map for the scale on the canvas. With this map pixel coordinates can translated to plot coordinates and vice versa.

See Also:
    QwtScaleMap, transform(), invTransform()

  QwtScaleMap QwtPolarPlot::scaleMap (intscaleId) const
Build a scale map

The azimuth map translates between the scale values and angles from [0.0, 2 * PI[. The radial map translates scale values into the distance from the pole. The radial map is calculated from the current geometry of the canvas.

Parameters:
    scaleId Scale index

Returns:
    Map for the scale on the canvas. With this map pixel coordinates can translated to plot coordinates and vice versa.

See Also:
    QwtScaleMap, transform(), invTransform()

  int QwtPolarPlot::scaleMaxMajor (intscaleId) const

Returns:
    the maximum number of major ticks for a specified axis

Parameters:
    scaleId Scale index

See Also:
    setScaleMaxMajor()

  int QwtPolarPlot::scaleMaxMinor (intscaleId) const

Returns:
    the maximum number of minor ticks for a specified axis

Parameters:
    scaleId Scale index

See Also:
    setScaleMaxMinor()

  void QwtPolarPlot::setAutoReplot (boolenable = true)

Set or reset the autoReplot option. If the autoReplot option is set, the plot will be updated implicitly by manipulating member functions. Since this may be time-consuming, it is recommended to leave this option switched off and call replot() explicitly if necessary.

The autoReplot option is set to false by default, which means that the user has to call replot() in order to make changes visible.

Parameters:
    enable true or false. Defaults to true.

See Also:
    replot()

  void QwtPolarPlot::setAutoScale (intscaleId)

Enable autoscaling. This member function is used to switch back to autoscaling mode after a fixed scale has been set. Autoscaling calculates a useful scale division from the bounding interval of all plot items with the QwtPolarItem::AutoScale attribute.

Autoscaling is only supported for the radial scale and enabled as default.

Parameters:
    scaleId Scale index

See Also:
    hasAutoScale(), setScale(), setScaleDiv(), QwtPolarItem::boundingInterval()

  void QwtPolarPlot::setAzimuthOrigin (doubleorigin) [slot]

Change the origin of the azimuth scale. The azimuth origin is the angle where the azimuth scale shows the value 0.0. The default origin is 0.0.

Parameters:
    origin New origin

See Also:
    azimuthOrigin()

  void QwtPolarPlot::setPlotBackground (const QBrush &brush)

Set the background of the plot area. The plot area is the circle around the pole. It's radius is defined by the radial scale.

Parameters:
    brush Background Brush

See Also:
    plotBackground(), plotArea()

  void QwtPolarPlot::setScale (intscaleId, doublemin, doublemax, doublestepSize = 0)

Disable autoscaling and specify a fixed scale for a selected scale.

Parameters:
    scaleId Scale index
    min
    max minimum and maximum of the scale
    stepSize Major step size. If step == 0, the step size is calculated automatically using the maxMajor setting.

See Also:
    setScaleMaxMajor(), setAutoScale()

  void QwtPolarPlot::setScaleDiv (intscaleId, const QwtScaleDiv &scaleDiv)

Disable autoscaling and specify a fixed scale for a selected scale.

Parameters:
    scaleId Scale index
    scaleDiv Scale division

See Also:
    setScale(), setAutoScale()

  void QwtPolarPlot::setScaleEngine (intscaleId, QwtScaleEngine *scaleEngine)
Change the scale engine for an axis

Parameters:
    scaleId Scale index
    scaleEngine Scale engine

See Also:
    axisScaleEngine()

  void QwtPolarPlot::setScaleMaxMajor (intscaleId, intmaxMajor)
Set the maximum number of major scale intervals for a specified scale

Parameters:
    scaleId Scale index
    maxMajor maximum number of major steps

See Also:
    scaleMaxMajor()

  void QwtPolarPlot::setScaleMaxMinor (intscaleId, intmaxMinor)
Set the maximum number of major scale intervals for a specified scale

Parameters:
    scaleId Scale index
    maxMinor maximum number of minor steps

See Also:
    scaleMaxMajor()

  void QwtPolarPlot::setTitle (const QString &title)
Change the plot's title

Parameters:
    title New title

  void QwtPolarPlot::setTitle (const QwtText &title)
Change the plot's title

Parameters:
    title New title

  QwtText QwtPolarPlot::title () const

Returns:
    the plot's title

  QwtTextLabel * QwtPolarPlot::titleLabel ()

Returns:
    the plot's title

  const QwtTextLabel * QwtPolarPlot::titleLabel () const

Returns:
    the plot's titel label.

  void QwtPolarPlot::unzoom ()
Unzoom the plot

See Also:
    zoom()

  void QwtPolarPlot::updateLegend ()
Emit legendDataChanged() for all plot item

See Also:
    QwtPlotItem::legendData(), legendDataChanged()

  void QwtPolarPlot::updateLegend (const QwtPolarItem *plotItem)
Emit legendDataChanged() for a plot item

Parameters:
    plotItem Plot item

See Also:
    QwtPlotItem::legendData(), legendDataChanged()

  void QwtPolarPlot::updateScale (intscaleId)
Rebuild the scale

Parameters:
    scaleId Scale index

  QwtInterval QwtPolarPlot::visibleInterval () const

Returns:
    Bounding interval of the radial scale that is visible on the canvas.

  void QwtPolarPlot::zoom (const QwtPointPolar &zoomPos, doublezoomFactor)

Translate and in/decrease the zoom factor. In zoom mode the zoom position is in the center of the canvas. The radius of the circle depends on the size of the plot canvas, that is devided by the zoom factor. Thus a factor < 1.0 zoom in.

Setting an invalid zoom position disables zooming.

Parameters:
    zoomPos Center of the translation
    zoomFactor Zoom factor

See Also:
    unzoom(), zoomPos(), zoomFactor()

  double QwtPolarPlot::zoomFactor () const

Returns:
    Zoom factor

See Also:
    zoom(), zoomPos()

  QwtPointPolar QwtPolarPlot::zoomPos () const

Returns:
    Zoom position

See Also:
    zoom(), zoomFactor()

Author

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