Changeset 4320 in ntrip
- Timestamp:
- Jun 23, 2012, 4:32:49 PM (12 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/polarplot.cpp
r4319 r4320 53 53 } 54 54 55 // Constructor 56 //////////////////////////////////////////////////////////////////////////// 57 t_polarData::t_polarData(size_t size) { 58 _zenithInterval.setMinValue(0.0); 59 _zenithInterval.setMaxValue(90.0); 60 _azimuthInterval.setMinValue(0.0); 61 _azimuthInterval.setMaxValue(360.0); 62 _size = size; 63 } 55 64 56 const QwtInterval zenithInterval(0.0, 90.0); 57 const QwtInterval azimuthInterval(0.0, 360.0); 65 // Sample (virtual) 66 //////////////////////////////////////////////////////////////////////////// 67 t_polarPoint t_polarData::sample(size_t ii) const { 68 const double stepA = 4 * _azimuthInterval.width() / _size; 69 const double aa = _azimuthInterval.minValue() + ii * stepA; 58 70 59 // Data Class 71 const double stepR = _zenithInterval.width() / _size; 72 const double rr = _zenithInterval.minValue() + ii * stepR; 73 74 return t_polarPoint(aa, rr); 75 } 76 77 // Bounding Box (virtual) 60 78 //////////////////////////////////////////////////////////////////////////// 61 class Data: public QwtSeriesData<QwtPointPolar> { 62 public: 63 Data(const QwtInterval &zenithInterval, 64 const QwtInterval &azimuthInterval, size_t size) : 65 _zenithInterval(zenithInterval), _azimuthInterval(azimuthInterval), 66 _size(size) {} 67 68 virtual size_t size() const {return _size;} 69 70 protected: 71 QwtInterval _zenithInterval; 72 QwtInterval _azimuthInterval; 73 size_t _size; 74 }; 75 76 // Spiral Data Class 77 //////////////////////////////////////////////////////////////////////////// 78 class SpiralData: public Data { 79 public: 80 SpiralData(const QwtInterval &zenithInterval, 81 const QwtInterval &azimuthInterval, size_t size) : 82 Data(zenithInterval, azimuthInterval, size) {} 83 84 virtual QwtPointPolar sample(size_t ii) const { 85 const double stepA = 4 * _azimuthInterval.width() / _size; 86 const double aa = _azimuthInterval.minValue() + ii * stepA; 87 88 const double stepR = _zenithInterval.width() / _size; 89 const double rr = _zenithInterval.minValue() + ii * stepR; 90 91 return QwtPointPolar(aa, rr); 92 } 93 94 virtual QRectF boundingRect() const { 95 if (d_boundingRect.width() < 0.0) { 96 d_boundingRect = qwtBoundingRect(*this); 97 } 98 return d_boundingRect; 99 } 100 }; 79 QRectF t_polarData::boundingRect() const { 80 return d_boundingRect; 81 } 101 82 102 83 // Constructor … … 111 92 // Scales 112 93 // ------ 113 setScale(QwtPolar::Radius, 114 zenithInterval.minValue(), zenithInterval.maxValue()); 115 116 setScale(QwtPolar::Azimuth, 117 azimuthInterval.maxValue(), azimuthInterval.minValue(), 118 azimuthInterval.width() / 12); 94 setScale(QwtPolar::Radius, 0.0, 90.0); 95 setScale(QwtPolar::Azimuth, 360.0, 0, 30.0); 119 96 120 97 // Grids, Axes … … 159 136 QBrush(Qt::red), QPen(Qt::red), 160 137 QSize(3, 3))); 161 curve->setData(new SpiralData(zenithInterval, azimuthInterval, numPoints)); 138 QwtSeriesData<t_polarPoint>* data = new t_polarData(numPoints); 139 curve->setData((QwtSeriesData<QwtPointPolar>*) data); 162 140 return curve; 163 141 } -
trunk/BNC/src/rinex/polarplot.h
r4316 r4320 6 6 #include <qwt_polar_curve.h> 7 7 8 // 9 ////////////////////////////////////////////////////////////////////////////// 8 10 class t_polarCurve : public QwtPolarCurve { 9 11 public: … … 17 19 }; 18 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 virtual t_polarPoint sample(size_t ii) const; 36 virtual size_t size() const {return _size;} 37 virtual QRectF boundingRect() const; 38 protected: 39 QwtInterval _zenithInterval; 40 QwtInterval _azimuthInterval; 41 size_t _size; 42 }; 43 44 // 45 ////////////////////////////////////////////////////////////////////////////// 19 46 class t_polarPlot: public QwtPolarPlot { 20 47 Q_OBJECT … … 31 58 32 59 #endif 33 34
Note:
See TracChangeset
for help on using the changeset viewer.