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 azimuth, double zenith) : QwtPointPolar(azimuth, zenith) {}
|
---|
26 | ~t_polarPoint() {}
|
---|
27 | double zz; // the third coordinate
|
---|
28 | };
|
---|
29 |
|
---|
30 | //
|
---|
31 | //////////////////////////////////////////////////////////////////////////////
|
---|
32 | class t_polarData: public QwtSeriesData<t_polarPoint> {
|
---|
33 | public:
|
---|
34 | t_polarData(size_t size) {
|
---|
35 | _size = size;
|
---|
36 | }
|
---|
37 | virtual t_polarPoint sample(size_t ii) const;
|
---|
38 | virtual size_t size() const {return _size;}
|
---|
39 | virtual QRectF boundingRect() const {
|
---|
40 | return d_boundingRect;
|
---|
41 | }
|
---|
42 | protected:
|
---|
43 | size_t _size;
|
---|
44 | };
|
---|
45 |
|
---|
46 | //
|
---|
47 | //////////////////////////////////////////////////////////////////////////////
|
---|
48 | class t_polarPlot: public QwtPolarPlot {
|
---|
49 | Q_OBJECT
|
---|
50 |
|
---|
51 | public:
|
---|
52 | t_polarPlot(QWidget* = 0);
|
---|
53 |
|
---|
54 | private:
|
---|
55 | t_polarCurve* createCurve() const;
|
---|
56 | };
|
---|
57 |
|
---|
58 | #endif
|
---|