source: ntrip/trunk/BNC/src/rinex/polarplot.h@ 9158

Last change on this file since 9158 was 8127, checked in by stoecker, 8 years ago

update qwt and qwtpolar, many QT5 fixes (unfinished)

File size: 2.0 KB
Line 
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//////////////////////////////////////////////////////////////////////////////
10class t_polarCurve : public QwtPolarCurve {
11 public:
12 t_polarCurve() {}
13 virtual ~t_polarCurve() {}
14 void setScaleInterval(const QwtInterval& scaleInterval) {
15 _scaleInterval = scaleInterval;
16 }
17 protected:
18 virtual void drawSymbols(QPainter* painter, const QwtSymbol& symbol,
19 const QwtScaleMap& azimuthMap,
20 const QwtScaleMap& radialMap,
21 const QPointF& pole, int from, int to) const;
22 private:
23 QwtInterval _scaleInterval;
24};
25
26//
27//////////////////////////////////////////////////////////////////////////////
28class t_polarPoint {
29 public:
30 t_polarPoint(double az, double zen, double value) :
31 _az(az), _zen(zen), _value(value) {}
32 double _az;
33 double _zen;
34 double _value;
35};
36
37//
38//////////////////////////////////////////////////////////////////////////////
39class t_polarData: public QwtSeriesData<QwtPointPolar> {
40 public:
41 t_polarData(QVector<t_polarPoint*>* data) {
42 _data = data;
43 _size = data->size();
44 }
45 ~t_polarData() {
46 for (int ii = 0; ii < _data->size(); ii++) {
47 delete _data->at(ii);
48 }
49 delete _data;
50 }
51 virtual QwtPointPolar sample(size_t ii) const {
52 const t_polarPoint* point = _data->at(ii);
53 QwtPointPolar qp(point->_az, point->_zen); qp._value = point->_value;
54 return qp;
55 }
56 virtual size_t size() const {return _size;}
57 virtual QRectF boundingRect() const {return d_boundingRect;}
58 protected:
59 size_t _size;
60 private:
61 QVector<t_polarPoint*>* _data;
62};
63
64//
65//////////////////////////////////////////////////////////////////////////////
66class t_polarPlot: public QwtPolarPlot {
67 Q_OBJECT
68
69 public:
70 t_polarPlot(const QwtText& title, const QwtInterval& scaleInterval,
71 QWidget* = 0);
72 void addCurve(QVector<t_polarPoint*>* data);
73
74 private:
75 QwtInterval _scaleInterval;
76};
77
78#endif
Note: See TracBrowser for help on using the repository browser.