1 |
|
---|
2 | #ifndef POLARPLOT_H
|
---|
3 | #define POLARPLOT_H
|
---|
4 |
|
---|
5 | #include <qwt_polar_plot.h>
|
---|
6 | #include <qwt_polar_curve.h>
|
---|
7 |
|
---|
8 | //
|
---|
9 | //////////////////////////////////////////////////////////////////////////////
|
---|
10 | class t_polarCurve : public QwtPolarCurve {
|
---|
11 | public:
|
---|
12 | t_polarCurve() {}
|
---|
13 | virtual ~t_polarCurve() {}
|
---|
14 | protected:
|
---|
15 | virtual void drawSymbols (QPainter* painter, const QwtSymbol& symbol,
|
---|
16 | const QwtScaleMap& azimuthMap,
|
---|
17 | const QwtScaleMap& radialMap,
|
---|
18 | const QPointF& pole, int from, int to) const;
|
---|
19 | };
|
---|
20 |
|
---|
21 | //
|
---|
22 | //////////////////////////////////////////////////////////////////////////////
|
---|
23 | class t_polarPoint : public QwtPointPolar {
|
---|
24 | public:
|
---|
25 | t_polarPoint(double az, double zen, double value) : QwtPointPolar(az, zen) {
|
---|
26 | _value = value;
|
---|
27 | }
|
---|
28 | ~t_polarPoint() {}
|
---|
29 | double _value; // the third coordinate
|
---|
30 | };
|
---|
31 |
|
---|
32 | //
|
---|
33 | //////////////////////////////////////////////////////////////////////////////
|
---|
34 | class t_polarData: public QwtSeriesData<t_polarPoint> {
|
---|
35 | public:
|
---|
36 | t_polarData(size_t size) {
|
---|
37 | _size = size;
|
---|
38 | }
|
---|
39 | virtual t_polarPoint sample(size_t ii) const;
|
---|
40 | virtual size_t size() const {return _size;}
|
---|
41 | virtual QRectF boundingRect() const {
|
---|
42 | return d_boundingRect;
|
---|
43 | }
|
---|
44 | protected:
|
---|
45 | size_t _size;
|
---|
46 | };
|
---|
47 |
|
---|
48 | //
|
---|
49 | //////////////////////////////////////////////////////////////////////////////
|
---|
50 | class t_polarPlot: public QwtPolarPlot {
|
---|
51 | Q_OBJECT
|
---|
52 |
|
---|
53 | public:
|
---|
54 | t_polarPlot(QWidget* = 0);
|
---|
55 |
|
---|
56 | private:
|
---|
57 | t_polarCurve* createCurve() const;
|
---|
58 | };
|
---|
59 |
|
---|
60 | #endif
|
---|