QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
QwtPolarCurve Class Reference

An item, that represents a series of points. More...

#include <qwt_polar_curve.h>

Inheritance diagram for QwtPolarCurve:
QwtPolarItem

Classes

class  PrivateData
 

Public Types

enum  CurveStyle { NoCurve , Lines , UserCurve = 100 }
 Curve styles. More...
 
enum  LegendAttribute { LegendShowLine = 0x01 , LegendShowSymbol = 0x02 }
 Attributes how to represent the curve on the legend. More...
 
- Public Types inherited from QwtPolarItem
enum  RttiValues {
  Rtti_PolarItem = 0 , Rtti_PolarGrid , Rtti_PolarMarker , Rtti_PolarCurve ,
  Rtti_PolarSpectrogram , Rtti_PolarUserItem = 1000
}
 Runtime type information. More...
 
enum  ItemAttribute { Legend = 0x01 , AutoScale = 0x02 }
 Plot Item Attributes. More...
 
enum  RenderHint { RenderAntialiased = 0x01 }
 Render hints. More...
 

Public Member Functions

 QwtPolarCurve ()
 Constructor.
 
 QwtPolarCurve (const QwtText &title)
 Constructor with title.
 
 QwtPolarCurve (const QString &title)
 Constructor with title string.
 
 ~QwtPolarCurve () override
 Destructor.
 
virtual int rtti () const override
 Get the runtime type information.
 
void setLegendAttribute (LegendAttribute, bool on=true)
 Set a legend attribute.
 
bool testLegendAttribute (LegendAttribute) const
 Test a legend attribute.
 
void setData (QwtSeriesData< QwtPointPolar > *data)
 Set the data.
 
const QwtSeriesData< QwtPointPolar > * data () const
 Get the data.
 
size_t dataSize () const
 Get the data size.
 
QwtPointPolar sample (int i) const
 Get a sample.
 
void setPen (const QPen &)
 Set the pen.
 
const QPen & pen () const
 Get the pen.
 
void setStyle (CurveStyle style)
 Set the curve style.
 
CurveStyle style () const
 Get the curve style.
 
void setSymbol (QwtSymbol *)
 Set the symbol.
 
const QwtSymbolsymbol () const
 Get the symbol.
 
void setCurveFitter (QwtCurveFitter *)
 Set the curve fitter.
 
QwtCurveFittercurveFitter () const
 Get the curve fitter.
 
virtual void draw (QPainter *p, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, double radius, const QRectF &canvasRect) const override
 Draw the curve.
 
virtual void draw (QPainter *p, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
 Draw the curve from index to index.
 
virtual QwtInterval boundingInterval (int scaleId) const override
 Get the bounding interval for a scale.
 
virtual QwtGraphic legendIcon (int index, const QSizeF &) const override
 Get the legend icon.
 
- Public Member Functions inherited from QwtPolarItem
 QwtPolarItem (const QwtText &title=QwtText())
 Constructor.
 
virtual ~QwtPolarItem ()
 Destructor.
 
void attach (QwtPolarPlot *plot)
 Attach the item to a plot.
 
void detach ()
 Detach the item from its plot.
 
QwtPolarPlotplot () const
 Get the attached plot.
 
void setTitle (const QString &title)
 Set the title from a QString.
 
void setTitle (const QwtText &title)
 Set the title from a QwtText.
 
const QwtTexttitle () const
 Get the title.
 
void setItemAttribute (ItemAttribute, bool on=true)
 Set an item attribute.
 
bool testItemAttribute (ItemAttribute) const
 Test an item attribute.
 
void setRenderHint (RenderHint, bool on=true)
 Set a render hint.
 
bool testRenderHint (RenderHint) const
 Test a render hint.
 
void setRenderThreadCount (uint numThreads)
 Set the number of render threads.
 
uint renderThreadCount () const
 Get the number of render threads.
 
double z () const
 Get the z value.
 
void setZ (double z)
 Set the z value.
 
void show ()
 Show the item.
 
void hide ()
 Hide the item.
 
virtual void setVisible (bool)
 Set the visibility.
 
bool isVisible () const
 Get the visibility.
 
virtual void itemChanged ()
 Update the item and trigger autoRefresh.
 
virtual void legendChanged ()
 Update the legend.
 
virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &, const QwtInterval &)
 Update the scale division.
 
virtual int marginHint () const
 Get the margin hint.
 
void setLegendIconSize (const QSize &)
 Set the legend icon size.
 
QSize legendIconSize () const
 Get the legend icon size.
 
virtual QList< QwtLegendDatalegendData () const
 Get the legend data.
 

Protected Member Functions

void init ()
 Initialize the curve.
 
virtual void drawCurve (QPainter *, int style, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
 Draw the curve.
 
virtual void drawSymbols (QPainter *, const QwtSymbol &, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
 Draw the symbols.
 
void drawLines (QPainter *, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
 Draw the lines.
 

Detailed Description

An item, that represents a series of points.

A curve is the representation of a series of points in polar coordinates. The points are connected to the curve using the abstract QwtData interface.

See also
QwtPolarPlot, QwtSymbol, QwtScaleMap

Member Enumeration Documentation

◆ CurveStyle

Curve styles.

See also
setStyle(), style()
Enumerator
NoCurve 

Don't draw a curve. Note: This doesn't affect the symbols.

Lines 

Connect the points with straight lines. The lines might be interpolated depending on the 'Fitted' attribute. Curve fitting can be configured using setCurveFitter().

UserCurve 

Values > 100 are reserved for user specific curve styles.

◆ LegendAttribute

Attributes how to represent the curve on the legend.

If none of the flags is activated QwtPlotCurve tries to find a color representing the curve and paints a rectangle with it. In the default setting all attributes are off.

See also
setLegendAttribute(), testLegendAttribute()
Enumerator
LegendShowLine 

If the curveStyle() is not NoCurve a line is painted with the curvePen().

LegendShowSymbol 

If the curve has a valid symbol it is painted.

Constructor & Destructor Documentation

◆ QwtPolarCurve() [1/2]

QwtPolarCurve::QwtPolarCurve ( const QwtText title)
explicit

Constructor with title.

Parameters
titleTitle of the curve

◆ QwtPolarCurve() [2/2]

QwtPolarCurve::QwtPolarCurve ( const QString &  title)
explicit

Constructor with title string.

Parameters
titleTitle of the curve as string

Member Function Documentation

◆ boundingInterval()

QwtInterval QwtPolarCurve::boundingInterval ( int  scaleId) const
overridevirtual

Get the bounding interval for a scale.

Get the bounding interval necessary to display the item.

Parameters
scaleIdScale index
Returns
Bounding interval

This interval can be useful for operations like clipping or autoscaling.

See also
QwtData::boundingRect()

Reimplemented from QwtPolarItem.

◆ curveFitter()

QwtCurveFitter * QwtPolarCurve::curveFitter ( ) const

Get the curve fitter.

Returns
The curve fitter
See also
setCurveFitter()

◆ data()

const QwtSeriesData< QwtPointPolar > * QwtPolarCurve::data ( ) const
inline

Get the data.

Returns
the the curve data

◆ dataSize()

size_t QwtPolarCurve::dataSize ( ) const

Get the data size.

Get the number of data points.

Returns
Number of points
See also
setData()

◆ draw() [1/2]

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

Draw the curve.

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

Implements QwtPolarItem.

◆ draw() [2/2]

void QwtPolarCurve::draw ( QPainter *  painter,
const QwtScaleMap azimuthMap,
const QwtScaleMap radialMap,
const QPointF &  pole,
int  from,
int  to 
) const
virtual

Draw the curve from index to index.

Draw an interval of the curve.

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
fromIndex of the first point to be painted
toIndex of the last point to be painted. If to < 0, the curve will be painted to its last point.
See also
drawCurve(), drawSymbols()

◆ drawCurve()

void QwtPolarCurve::drawCurve ( QPainter *  painter,
int  style,
const QwtScaleMap azimuthMap,
const QwtScaleMap radialMap,
const QPointF &  pole,
int  from,
int  to 
) const
protectedvirtual

Draw the curve.

Draw the line part (without symbols) of a curve interval.

Parameters
painterPainter
styleCurve style, see QwtPolarCurve::CurveStyle
azimuthMapMaps azimuth values to values related to 0.0, M_2PI
radialMapMaps radius values into painter coordinates.
polePosition of the pole in painter coordinates
fromindex of the first point to be painted
toindex of the last point to be painted.
See also
draw(), drawLines()

◆ drawLines()

void QwtPolarCurve::drawLines ( QPainter *  painter,
const QwtScaleMap azimuthMap,
const QwtScaleMap radialMap,
const QPointF &  pole,
int  from,
int  to 
) const
protected

Draw the lines.

Draw lines.

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
fromindex of the first point to be painted
toindex of the last point to be painted.
See also
draw(), drawLines(), setCurveFitter()

◆ drawSymbols()

void QwtPolarCurve::drawSymbols ( QPainter *  painter,
const QwtSymbol symbol,
const QwtScaleMap azimuthMap,
const QwtScaleMap radialMap,
const QPointF &  pole,
int  from,
int  to 
) const
protectedvirtual

Draw the symbols.

Draw symbols.

Parameters
painterPainter
symbolCurve symbol
azimuthMapMaps azimuth values to values related to 0.0, M_2PI
radialMapMaps radius values into painter coordinates.
polePosition of the pole in painter coordinates
fromindex of the first point to be painted
toindex of the last point to be painted.
See also
setSymbol(), draw(), drawCurve()

◆ init()

void QwtPolarCurve::init ( )
protected

Initialize the curve.

Initialize data members.

◆ legendIcon()

QwtGraphic QwtPolarCurve::legendIcon ( int  index,
const QSizeF &  size 
) const
overridevirtual

Get the legend icon.

Get the icon representing the curve on the legend.

Parameters
indexIndex of the legend entry (ignored as there is only one)
sizeIcon size
Returns
Icon representing the curve on the legend
See also
QwtPolarItem::setLegendIconSize(), QwtPolarItem::legendData()

Reimplemented from QwtPolarItem.

◆ pen()

const QPen & QwtPolarCurve::pen ( ) const

Get the pen.

Get the pen used to draw the lines.

Returns
Pen used to draw the lines
See also
setPen()

◆ rtti()

int QwtPolarCurve::rtti ( ) const
overridevirtual

Get the runtime type information.

Returns
QwtPolarCurve::Rtti_PolarCurve

Reimplemented from QwtPolarItem.

◆ sample()

QwtPointPolar QwtPolarCurve::sample ( int  i) const
inline

Get a sample.

Parameters
iindex
Returns
point at position i

◆ setCurveFitter()

void QwtPolarCurve::setCurveFitter ( QwtCurveFitter curveFitter)

Set the curve fitter.

Insert a curve fitter.

Parameters
curveFitterCurve fitter (ownership is transferred)

A curve fitter interpolates the curve points. For example, QwtPolarFitter adds equidistant points so that the connection gets rounded instead of having straight lines. If curveFitter is nullptr, fitting is disabled.

See also
curveFitter()

◆ setData()

void QwtPolarCurve::setData ( QwtSeriesData< QwtPointPolar > *  data)

Set the data.

Initialize data with a pointer to QwtSeriesData<QwtPointPolar>

Parameters
dataSeries data. The x-values represent azimuth, y-values represent radius.

Ownership of the data is transferred to the curve.

See also
data()

◆ setLegendAttribute()

void QwtPolarCurve::setLegendAttribute ( LegendAttribute  attribute,
bool  on = true 
)

Set a legend attribute.

Specify an attribute for how to draw the legend identifier.

Parameters
attributeLegend attribute to set
onTrue to enable, false to disable
See also
LegendAttribute, testLegendAttribute()

◆ setPen()

void QwtPolarCurve::setPen ( const QPen &  pen)

Set the pen.

Assign a pen.

Parameters
penNew pen
See also
pen()

◆ setStyle()

void QwtPolarCurve::setStyle ( CurveStyle  style)

Set the curve style.

Set the curve's drawing style.

Parameters
styleCurve style
See also
CurveStyle, style()

◆ setSymbol()

void QwtPolarCurve::setSymbol ( QwtSymbol symbol)

Set the symbol.

Assign a symbol.

Parameters
symbolNew symbol (ownership is transferred)
See also
symbol()

◆ style()

QwtPolarCurve::CurveStyle QwtPolarCurve::style ( ) const

Get the curve style.

Get the current style.

Returns
Current style
See also
CurveStyle, setStyle()

◆ symbol()

const QwtSymbol * QwtPolarCurve::symbol ( ) const

Get the symbol.

Get the current symbol.

Returns
The current symbol
See also
setSymbol()

◆ testLegendAttribute()

bool QwtPolarCurve::testLegendAttribute ( LegendAttribute  attribute) const

Test a legend attribute.

Test if a legend attribute is enabled.

Parameters
attributeLegend attribute to test
Returns
True if attribute is enabled
See also
LegendAttribute, setLegendAttribute()

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