Loading...
Searching...
No Matches
qwt_polar_curve.h
/******************************************************************************
* QwtPolar Widget Library
* Copyright (C) 2008 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_POLAR_CURVE_H
#define QWT_POLAR_CURVE_H
#include "qwt_global.h"
#include "qwt_polar_item.h"
#include "qwt_point_polar.h"
#include "qwt_series_data.h"
class QPainter;
class QwtSymbol;
class QwtCurveFitter;
class QWT_EXPORT QwtPolarCurve : public QwtPolarItem
{
public:
enum CurveStyle
{
NoCurve,
Lines,
UserCurve = 100
};
enum LegendAttribute
{
LegendShowLine = 0x01,
LegendShowSymbol = 0x02
};
Q_DECLARE_FLAGS( LegendAttributes, LegendAttribute )
explicit QwtPolarCurve();
explicit QwtPolarCurve( const QwtText& title );
explicit QwtPolarCurve( const QString& title );
virtual ~QwtPolarCurve();
virtual int rtti() const QWT_OVERRIDE;
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( 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 QWT_OVERRIDE;
virtual void draw( QPainter* p,
const QwtScaleMap& azimuthMap, const QwtScaleMap& radialMap,
const QPointF& pole, int from, int to ) const;
virtual QwtInterval boundingInterval( int scaleId ) const QWT_OVERRIDE;
virtual QwtGraphic legendIcon( int index, const QSizeF& ) const QWT_OVERRIDE;
protected:
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;
private:
QwtSeriesData< QwtPointPolar >* m_series;
class PrivateData;
PrivateData* m_data;
};
inline const QwtSeriesData< QwtPointPolar >* QwtPolarCurve::data() const
{
return m_series;
}
inline QwtPointPolar QwtPolarCurve::sample( int i ) const
{
return m_series->sample( i );
}
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarCurve::LegendAttributes )
#endif
QwtCurveFitter
Abstract base class for a curve fitter.
Definition qwt_curve_fitter.h:22
QwtGraphic
A paint device for scalable graphics.
Definition qwt_graphic.h:76
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtPointPolar
A point in polar coordinates.
Definition qwt_point_polar.h:29
QwtPolarCurve
An item, that represents a series of points.
Definition qwt_polar_curve.h:31
QwtPolarCurve::LegendAttribute
LegendAttribute
Attributes how to represent the curve on the legend.
Definition qwt_polar_curve.h:64
QwtPolarCurve::LegendAttributes
QFlags< LegendAttribute > LegendAttributes
Definition qwt_polar_curve.h:75
QwtPolarCurve::CurveStyle
CurveStyle
Definition qwt_polar_curve.h:38
QwtPolarCurve::NoCurve
@ NoCurve
Don't draw a curve. Note: This doesn't affect the symbols.
Definition qwt_polar_curve.h:40
QwtPolarCurve::Lines
@ Lines
Definition qwt_polar_curve.h:47
QwtPolarCurve::sample
QwtPointPolar sample(int i) const
Definition qwt_polar_curve.h:153
QwtPolarItem
Base class for items on a polar plot.
Definition qwt_polar_item.h:38
QwtPolarItem::rtti
virtual int rtti() const
Definition qwt_polar_item.cpp:112
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtSeriesData
Abstract interface for iterating over samples.
Definition qwt_series_data.h:50
QwtSymbol
A class for drawing symbols.
Definition qwt_symbol.h:32
QwtText
A class representing a text.
Definition qwt_text.h:52