[4302] | 1 |
|
---|
| 2 | #ifndef POLARPLOT_H
|
---|
| 3 | #define POLARPLOT_H
|
---|
| 4 |
|
---|
| 5 | #include <qwt_polar_plot.h>
|
---|
[4314] | 6 | #include <qwt_polar_curve.h>
|
---|
[4336] | 7 |
|
---|
[4320] | 8 | //
|
---|
| 9 | //////////////////////////////////////////////////////////////////////////////
|
---|
[4316] | 10 | class t_polarCurve : public QwtPolarCurve {
|
---|
| 11 | public:
|
---|
[4321] | 12 | t_polarCurve() {}
|
---|
| 13 | virtual ~t_polarCurve() {}
|
---|
[4316] | 14 | protected:
|
---|
[4336] | 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;
|
---|
[4316] | 19 | };
|
---|
| 20 |
|
---|
[4320] | 21 | //
|
---|
| 22 | //////////////////////////////////////////////////////////////////////////////
|
---|
[4334] | 23 | class t_polarPoint {
|
---|
| 24 | public:
|
---|
[4336] | 25 | t_polarPoint(double az, double zen, double value) :
|
---|
| 26 | _az(az), _zen(zen), _value(value) {}
|
---|
[4334] | 27 | double _az;
|
---|
| 28 | double _zen;
|
---|
| 29 | double _value;
|
---|
| 30 | };
|
---|
| 31 |
|
---|
| 32 | //
|
---|
| 33 | //////////////////////////////////////////////////////////////////////////////
|
---|
[4331] | 34 | class t_polarData: public QwtSeriesData<QwtPointPolar> {
|
---|
[4320] | 35 | public:
|
---|
[4334] | 36 | t_polarData(QVector<t_polarPoint*>* data) {
|
---|
| 37 | _data = data;
|
---|
| 38 | _size = data->size();
|
---|
[4321] | 39 | }
|
---|
[4334] | 40 | ~t_polarData() {
|
---|
| 41 | for (int ii = 0; ii < _data->size(); ii++) {
|
---|
| 42 | delete _data->at(ii);
|
---|
| 43 | }
|
---|
[4335] | 44 | delete _data;
|
---|
[4334] | 45 | }
|
---|
| 46 | virtual QwtPointPolar sample(size_t ii) const {
|
---|
| 47 | const t_polarPoint* point = _data->at(ii);
|
---|
| 48 | QwtPointPolar qp(point->_az, point->_zen); qp._value = point->_value;
|
---|
| 49 | return qp;
|
---|
| 50 | }
|
---|
[4320] | 51 | virtual size_t size() const {return _size;}
|
---|
[4334] | 52 | virtual QRectF boundingRect() const {return d_boundingRect;}
|
---|
[4320] | 53 | protected:
|
---|
[4322] | 54 | size_t _size;
|
---|
[4334] | 55 | private:
|
---|
| 56 | QVector<t_polarPoint*>* _data;
|
---|
[4320] | 57 | };
|
---|
| 58 |
|
---|
| 59 | //
|
---|
| 60 | //////////////////////////////////////////////////////////////////////////////
|
---|
[4302] | 61 | class t_polarPlot: public QwtPolarPlot {
|
---|
| 62 | Q_OBJECT
|
---|
| 63 |
|
---|
| 64 | public:
|
---|
| 65 | t_polarPlot(QWidget* = 0);
|
---|
[4334] | 66 | void addCurve(QVector<t_polarPoint*>* data);
|
---|
[4302] | 67 |
|
---|
| 68 | private:
|
---|
| 69 | };
|
---|
| 70 |
|
---|
| 71 | #endif
|
---|