Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
QwtPolarItem Class Referenceabstract

Base class for items on a polar plot. More...

#include <qwt_polar_item.h>

Inheritance diagram for QwtPolarItem:
Inheritance graph
[legend]

Classes

class  PrivateData
 

Public Types

enum  ItemAttribute { Legend = 0x01, AutoScale = 0x02 }
 Plot Item Attributes. More...
 
typedef QFlags< ItemAttributeItemAttributes
 Item attributes. More...
 
enum  RenderHint { RenderAntialiased = 0x01 }
 Render hints. More...
 
typedef QFlags< RenderHintRenderHints
 Item attributes. More...
 
enum  RttiValues {
  Rtti_PolarItem = 0, Rtti_PolarGrid, Rtti_PolarMarker, Rtti_PolarCurve,
  Rtti_PolarSpectrogram, Rtti_PolarUserItem = 1000
}
 Runtime type information. More...
 

Public Member Functions

void attach (QwtPolarPlot *plot)
 Attach the item to a plot. More...
 
virtual QwtInterval boundingInterval (int scaleId) const
 
void detach ()
 This method detaches a QwtPolarItem from the QwtPolarPlot it has been associated with. More...
 
virtual void draw (QPainter *painter, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, double radius, const QRectF &canvasRect) const =0
 Draw the item. More...
 
void hide ()
 Hide the item. More...
 
bool isVisible () const
 
virtual void itemChanged ()
 
virtual void legendChanged ()
 
virtual QList< QwtLegendDatalegendData () const
 Return all information, that is needed to represent the item on the legend. More...
 
virtual QwtGraphic legendIcon (int index, const QSizeF &) const
 
QSize legendIconSize () const
 
virtual int marginHint () const
 
QwtPolarPlotplot () const
 
 QwtPolarItem (const QwtText &title=QwtText())
 
uint renderThreadCount () const
 
virtual int rtti () const
 
void setItemAttribute (ItemAttribute, bool on=true)
 
void setLegendIconSize (const QSize &)
 
void setRenderHint (RenderHint, bool on=true)
 
void setRenderThreadCount (uint numThreads)
 
void setTitle (const QString &title)
 
void setTitle (const QwtText &title)
 
virtual void setVisible (bool)
 
void setZ (double z)
 Set the z value. More...
 
void show ()
 Show the item. More...
 
bool testItemAttribute (ItemAttribute) const
 
bool testRenderHint (RenderHint) const
 
const QwtTexttitle () const
 
virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &, const QwtInterval &)
 Update the item to changes of the axes scale division. More...
 
double z () const
 
virtual ~QwtPolarItem ()
 Destroy the QwtPolarItem. More...
 

Private Member Functions

QwtPolarItemoperator= (const QwtPolarItem &)
 
 QwtPolarItem (const QwtPolarItem &)
 

Private Attributes

PrivateDatad_data
 

Detailed Description

Base class for items on a polar plot.

A QwtPolarItem is "something that can be painted on the canvas". It is connected to the QwtPolar framework by a couple of virtual methods, that are individually implemented in derived item classes.

QwtPolar offers an implementation of the most common types of items, but deriving from QwtPolarItem makes it easy to implement additional types of items.

Definition at line 37 of file qwt_polar_item.h.

Member Typedef Documentation

Item attributes.

Definition at line 87 of file qwt_polar_item.h.

Item attributes.

Definition at line 100 of file qwt_polar_item.h.

Member Enumeration Documentation

Plot Item Attributes.

See also
setItemAttribute(), testItemAttribute()
Enumerator
Legend 

The item is represented on the legend.

AutoScale 

The boundingRect() of the item is included in the autoscaling calculation.

Definition at line 74 of file qwt_polar_item.h.

Render hints.

See also
setRenderHint(), testRenderHint()
Enumerator
RenderAntialiased 

Enable antialiasing.

Definition at line 93 of file qwt_polar_item.h.

Runtime type information.

RttiValues is used to cast plot items, without having to enable runtime type information of the compiler.

Enumerator
Rtti_PolarItem 

Unspecific value, that can be used, when it doesn't matter.

Rtti_PolarGrid 

For QwtPolarGrid.

Rtti_PolarMarker 

For QwtPolarMarker.

Rtti_PolarCurve 

For QwtPolarCurve.

Rtti_PolarSpectrogram 

For QwtPolarSpectrogram.

Rtti_PolarUserItem 

Values >= Rtti_PolarUserItem are reserved for plot items not implemented in the QwtPolar library.

Definition at line 46 of file qwt_polar_item.h.

Constructor & Destructor Documentation

QwtPolarItem::QwtPolarItem ( const QwtText title = QwtText())
explicit

Constructor

Parameters
titleItem title, f.e used on a legend
See also
setTitle()

Definition at line 48 of file qwt_polar_item.cpp.

QwtPolarItem::~QwtPolarItem ( )
virtual

Destroy the QwtPolarItem.

Definition at line 55 of file qwt_polar_item.cpp.

QwtPolarItem::QwtPolarItem ( const QwtPolarItem )
private

Member Function Documentation

void QwtPolarItem::attach ( QwtPolarPlot plot)

Attach the item to a plot.

This method will attach a QwtPolarItem to the QwtPolarPlot argument. It will first detach the QwtPolarItem from any plot from a previous call to attach (if necessary). If a NULL argument is passed, it will detach from any QwtPolarPlot it was attached to.

Parameters
plotPlot widget
See also
QwtPolarItem::detach()

Definition at line 74 of file qwt_polar_item.cpp.

QwtInterval QwtPolarItem::boundingInterval ( int  scaleId) const
virtual

Interval, that is necessary to display the item

This interval can be useful for operations like clipping or autoscaling For items ( like the grid ), where a bounding interval makes no sense an invalid interval is returned.

Parameters
scaleIdScale id ( QwtPolar::Scale )
Returns
Bounding interval of the plot item for a specific scale

Reimplemented in QwtPolarCurve, QwtPolarSpectrogram, and QwtPolarMarker.

Definition at line 381 of file qwt_polar_item.cpp.

void QwtPolarItem::detach ( )

This method detaches a QwtPolarItem from the QwtPolarPlot it has been associated with.

detach() is equivalent to calling attach( NULL )

See also
attach()

Definition at line 95 of file qwt_polar_item.cpp.

virtual void QwtPolarItem::draw ( QPainter *  painter,
const QwtScaleMap azimuthMap,
const QwtScaleMap radialMap,
const QPointF &  pole,
double  radius,
const QRectF &  canvasRect 
) const
pure virtual

Draw the item.

Parameters
painterPainter
azimuthMapMaps azimuth values to values related to 0.0, M_2PI
radialMapMaps radius values into painter coordinates.
polePosition of the pole in painter coordinates
radiusRadius of the complete plot area in painter coordinates
canvasRectContents rect of the canvas in painter coordinates

Implemented in QwtPolarGrid, QwtPolarCurve, QwtPolarSpectrogram, and QwtPolarMarker.

void QwtPolarItem::hide ( )

Hide the item.

Definition at line 320 of file qwt_polar_item.cpp.

bool QwtPolarItem::isVisible ( ) const
Returns
true if visible
See also
setVisible(), show(), hide()

Definition at line 344 of file qwt_polar_item.cpp.

void QwtPolarItem::itemChanged ( )
virtual

Update the legend and call QwtPolarPlot::autoRefresh for the parent plot.

See also
updateLegend()

Definition at line 355 of file qwt_polar_item.cpp.

void QwtPolarItem::legendChanged ( )
virtual

Update the legend of the parent plot.

See also
QwtPolarPlot::updateLegend(), itemChanged()

Definition at line 365 of file qwt_polar_item.cpp.

QList< QwtLegendData > QwtPolarItem::legendData ( ) const
virtual

Return all information, that is needed to represent the item on the legend.

Most items are represented by one entry on the legend showing an icon and a text.

QwtLegendData is basically a list of QVariants that makes it possible to overload and reimplement legendData() to return almost any type of information, that is understood by the receiver that acts as the legend.

The default implementation returns one entry with the title() of the item and the legendIcon().

See also
title(), legendIcon(), QwtLegend

Definition at line 428 of file qwt_polar_item.cpp.

QwtGraphic QwtPolarItem::legendIcon ( int  index,
const QSizeF &  size 
) const
virtual
Returns
Icon representing the item on the legend

The default implementation returns an invalid icon

Parameters
indexIndex of the legend entry ( usually there is only one )
sizeIcon size
See also
setLegendIconSize(), legendData()

Reimplemented in QwtPolarCurve.

Definition at line 462 of file qwt_polar_item.cpp.

QSize QwtPolarItem::legendIconSize ( ) const
Returns
Legend icon size
See also
setLegendIconSize(), legendIcon()

Definition at line 308 of file qwt_polar_item.cpp.

int QwtPolarItem::marginHint ( ) const
virtual

Some items like to display something (f.e. the azimuth axis) outside of the area of the interval of the radial scale. The default implementation returns 0 pixels

Returns
Hint for the margin

Reimplemented in QwtPolarGrid.

Definition at line 478 of file qwt_polar_item.cpp.

QwtPolarItem& QwtPolarItem::operator= ( const QwtPolarItem )
private
QwtPolarPlot * QwtPolarItem::plot ( ) const
Returns
Attached plot

Definition at line 118 of file qwt_polar_item.cpp.

uint QwtPolarItem::renderThreadCount ( ) const
Returns
Number of threads to be used for rendering. If numThreads() is set to 0, the system specific ideal thread count is used.

Definition at line 282 of file qwt_polar_item.cpp.

int QwtPolarItem::rtti ( ) const
virtual

Return rtti for the specific class represented. QwtPolarItem is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them.

The rtti value is useful for environments, where the runtime type information is disabled and it is not possible to do a dynamic_cast<...>.

Returns
rtti value
See also
RttiValues

Reimplemented in QwtPolarGrid, QwtPolarCurve, QwtPolarSpectrogram, and QwtPolarMarker.

Definition at line 112 of file qwt_polar_item.cpp.

void QwtPolarItem::setItemAttribute ( ItemAttribute  attribute,
bool  on = true 
)

Toggle an item attribute

Parameters
attributeAttribute type
ontrue/false
See also
testItemAttribute(), ItemAttribute

Definition at line 201 of file qwt_polar_item.cpp.

void QwtPolarItem::setLegendIconSize ( const QSize &  size)

Set the size of the legend icon

The default setting is 8x8 pixels

Parameters
sizeSize
See also
legendIconSize(), legendIcon()

Definition at line 295 of file qwt_polar_item.cpp.

void QwtPolarItem::setRenderHint ( RenderHint  hint,
bool  on = true 
)

Toggle an render hint

Parameters
hintRender hint
ontrue/false
See also
testRenderHint(), RenderHint

Definition at line 234 of file qwt_polar_item.cpp.

void QwtPolarItem::setRenderThreadCount ( uint  numThreads)

On multi core systems rendering of certain plot item ( f.e QwtPolarSpectrogram ) can be done in parallel in several threads.

The default setting is set to 1.

Parameters
numThreadsNumber of threads to be used for rendering. If numThreads is set to 0, the system specific ideal thread count is used.

The default thread count is 1 ( = no additional threads )

Definition at line 272 of file qwt_polar_item.cpp.

void QwtPolarItem::setTitle ( const QString &  title)

Set a new title

Parameters
titleTitle
See also
title()

Definition at line 164 of file qwt_polar_item.cpp.

void QwtPolarItem::setTitle ( const QwtText title)

Set a new title

Parameters
titleTitle
See also
title()

Definition at line 175 of file qwt_polar_item.cpp.

void QwtPolarItem::setVisible ( bool  on)
virtual

Show/Hide the item

Parameters
onShow if true, otherwise hide
See also
isVisible(), show(), hide()

Definition at line 331 of file qwt_polar_item.cpp.

void QwtPolarItem::setZ ( double  z)

Set the z value.

Plot items are painted in increasing z-order.

Parameters
zZ-value
See also
z(), QwtPolarItemDict::itemList()

Definition at line 142 of file qwt_polar_item.cpp.

void QwtPolarItem::show ( )

Show the item.

Definition at line 314 of file qwt_polar_item.cpp.

bool QwtPolarItem::testItemAttribute ( ItemAttribute  attribute) const

Test an item attribute

Parameters
attributeAttribute type
Returns
true/false
See also
setItemAttribute(), ItemAttribute

Definition at line 221 of file qwt_polar_item.cpp.

bool QwtPolarItem::testRenderHint ( RenderHint  hint) const

Test a render hint

Parameters
hintRender hint
Returns
true/false
See also
setRenderHint(), RenderHint

Definition at line 254 of file qwt_polar_item.cpp.

const QwtText & QwtPolarItem::title ( ) const
Returns
Title of the item
See also
setTitle()

Definition at line 188 of file qwt_polar_item.cpp.

void QwtPolarItem::updateScaleDiv ( const QwtScaleDiv azimuthScaleDiv,
const QwtScaleDiv radialScaleDiv,
const QwtInterval interval 
)
virtual

Update the item to changes of the axes scale division.

Update the item, when the axes of plot have changed. The default implementation does nothing, but items that depend on the scale division (like QwtPolarGrid()) have to reimplement updateScaleDiv()

Parameters
azimuthScaleDivScale division of the azimuth-scale
radialScaleDivScale division of the radius-axis
intervalThe interval of the radius-axis, that is visible on the canvas
See also
QwtPolarPlot::updateAxes()

Reimplemented in QwtPolarGrid.

Definition at line 403 of file qwt_polar_item.cpp.

double QwtPolarItem::z ( ) const

Plot items are painted in increasing z-order.

Returns
Z value
See also
setZ(), QwtPolarItemDict::itemList()

Definition at line 129 of file qwt_polar_item.cpp.

Member Data Documentation

PrivateData* QwtPolarItem::d_data
private

Definition at line 169 of file qwt_polar_item.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:50