Qwt Polar User's Guide 1.0.0
Public Types | Public Member Functions | Protected Member Functions

QwtPolarCurve Class Reference

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

#include <qwt_polar_curve.h>

Inheritance diagram for QwtPolarCurve:
Inheritance graph
[legend]

List of all members.

Public Types

enum  CurveStyle {
  NoCurve,
  Lines,
  UserCurve = 100
}
enum  LegendAttribute {
  LegendShowLine = 0x01,
  LegendShowSymbol = 0x02
}
typedef QFlags< LegendAttributeLegendAttributes

Public Member Functions

 QwtPolarCurve ()
 QwtPolarCurve (const QwtText &title)
 QwtPolarCurve (const QString &title)
virtual ~QwtPolarCurve ()
virtual int rtti () const
void setLegendAttribute (LegendAttribute, bool on=true)
bool testLegendAttribute (LegendAttribute) const
void setData (QwtSeriesData< QwtPointPolar > *data)
const QwtSeriesData
< QwtPointPolar > * 
data () const
size_t dataSize () const
QwtPointPolar sample (int i) const
void setPen (const QPen &)
const QPen & pen () const
void setStyle (CurveStyle style)
CurveStyle style () const
void setSymbol (const QwtSymbol *)
const QwtSymbol * symbol () const
void setCurveFitter (QwtCurveFitter *)
QwtCurveFitter * curveFitter () const
virtual void draw (QPainter *p, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, double radius, const QRectF &canvasRect) const
virtual void draw (QPainter *p, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
virtual void updateLegend (QwtLegend *) const
virtual QwtInterval boundingInterval (int scaleId) const
virtual void drawLegendIdentifier (QPainter *, const QRectF &) const

Protected Member Functions

void init ()
virtual void drawCurve (QPainter *, int style, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
virtual void drawSymbols (QPainter *, const QwtSymbol &, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
void drawLines (QPainter *, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const

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 Typedef Documentation

Legend attributes.


Member Enumeration Documentation

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.

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(), drawLegendIdentifier()
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::QwtPolarCurve ( ) [explicit]

Constructor.

QwtPolarCurve::QwtPolarCurve ( const QwtText &  title) [explicit]

Constructor

Parameters:
titletitle of the curve
QwtPolarCurve::QwtPolarCurve ( const QString &  title) [explicit]

Constructor

Parameters:
titletitle of the curve
QwtPolarCurve::~QwtPolarCurve ( ) [virtual]

Destructor.


Member Function Documentation

QwtInterval QwtPolarCurve::boundingInterval ( int  scaleId) const [virtual]

Interval, that is necessary to display the item This interval can be useful for operations like clipping or autoscaling

Parameters:
scaleIdScale index
Returns:
bounding interval
See also:
QwtData::boundingRect()

Reimplemented from QwtPolarItem.

QwtCurveFitter * QwtPolarCurve::curveFitter ( ) const
Returns:
The curve fitter
See also:
setCurveFitter()
const QwtSeriesData< QwtPointPolar > * QwtPolarCurve::data ( ) const [inline]
Returns:
the the curve data
size_t QwtPolarCurve::dataSize ( ) const
Returns:
Number of points
See also:
setData()
void QwtPolarCurve::draw ( QPainter *  painter,
const QwtScaleMap &  azimuthMap,
const QwtScaleMap &  radialMap,
const QPointF &  pole,
double  radius,
const QRectF &  canvasRect 
) const [virtual]

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.

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

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(),
void QwtPolarCurve::drawCurve ( QPainter *  painter,
int  style,
const QwtScaleMap &  azimuthMap,
const QwtScaleMap &  radialMap,
const QPointF &  pole,
int  from,
int  to 
) const [protected, virtual]

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()
void QwtPolarCurve::drawLegendIdentifier ( QPainter *  painter,
const QRectF &  rect 
) const [virtual]

Draw the identifier representing the curve on the legend.

Parameters:
painterQt Painter
rectBounding rectangle for the identifier
See also:
setLegendAttribute
void QwtPolarCurve::drawLines ( QPainter *  painter,
const QwtScaleMap &  azimuthMap,
const QwtScaleMap &  radialMap,
const QPointF &  pole,
int  from,
int  to 
) const [protected]

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()
void QwtPolarCurve::drawSymbols ( QPainter *  painter,
const QwtSymbol &  symbol,
const QwtScaleMap &  azimuthMap,
const QwtScaleMap &  radialMap,
const QPointF &  pole,
int  from,
int  to 
) const [protected, virtual]

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()
void QwtPolarCurve::init ( ) [protected]

Initialize data members.

const QPen & QwtPolarCurve::pen ( ) const
Returns:
Pen used to draw the lines
See also:
setPen()
int QwtPolarCurve::rtti ( ) const [virtual]
Returns:
QwtPolarCurve::Rtti_PolarCurve

Reimplemented from QwtPolarItem.

QwtPointPolar QwtPolarCurve::sample ( int  i) const [inline]
Parameters:
iindex
Returns:
point at position i
void QwtPolarCurve::setCurveFitter ( QwtCurveFitter *  curveFitter)

Insert a curve fitter.

Parameters:
curveFitterCurve fitter

A curve fitter interpolates the curve points. F.e QwtPolarFitter adds equidistant points so that the connection gets rounded instead of having straight lines. If curveFitter is NULL fitting is disabled.

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

Initialize data with a pointer to QwtSeriesData<QwtPointPolar>.

The x-values of the data object represent the azimuth, the y-value respresent the radius.

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

Specify an attribute how to draw the legend identifier

Parameters:
attributeAttribute
onOn/Off /sa LegendAttribute, testLegendAttribute()
void QwtPolarCurve::setPen ( const QPen &  pen)

Assign a pen.

Parameters:
penNew pen
See also:
pen()
void QwtPolarCurve::setStyle ( CurveStyle  style)

Set the curve's drawing style

Parameters:
styleCurve style
See also:
CurveStyle, style()
void QwtPolarCurve::setSymbol ( const QwtSymbol *  symbol)

Assign a symbol.

Parameters:
symbolSymbol
See also:
symbol()
QwtPolarCurve::CurveStyle QwtPolarCurve::style ( ) const
Returns:
Current style
See also:
CurveStyle, setStyle()
const QwtSymbol * QwtPolarCurve::symbol ( ) const
Returns:
The current symbol
See also:
setSymbol()
bool QwtPolarCurve::testLegendAttribute ( LegendAttribute  attribute) const

Test if a lefend attribute is enables.

Parameters:
attributeLegend attribute
Returns:
True if attribute is enabled
See also:
LegendAttribute, setLegendAttribute()
void QwtPolarCurve::updateLegend ( QwtLegend *  legend) const [virtual]

Update the widget that represents the curve on the legend.

Reimplemented from QwtPolarItem.