Changeset 4321 in ntrip
- Timestamp:
- Jun 23, 2012, 4:44:17 PM (12 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/polarplot.cpp
r4320 r4321 23 23 #include "polarplot.h" 24 24 25 // Constructor26 ////////////////////////////////////////////////////////////////////////////27 t_polarCurve::t_polarCurve() {28 }29 30 // Destructor (virtual)31 ////////////////////////////////////////////////////////////////////////////32 t_polarCurve::~t_polarCurve() {33 }34 35 25 // Draw Symbols (virtual) - change symbol's color 36 26 //////////////////////////////////////////////////////////////////////////// … … 53 43 } 54 44 55 // Constructor56 ////////////////////////////////////////////////////////////////////////////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 }64 65 45 // Sample (virtual) 66 46 //////////////////////////////////////////////////////////////////////////// 67 47 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;48 const QwtInterval zenithInterval(0.0, 90.0); 49 const QwtInterval azimuthInterval(0.0, 360.0 ); 70 50 71 const double stepR = _zenithInterval.width() / _size; 72 const double rr = _zenithInterval.minValue() + ii * stepR; 51 const double stepA = 4 * azimuthInterval.width() / _size; 52 const double aa = azimuthInterval.minValue() + ii * stepA; 53 54 const double stepR = zenithInterval.width() / _size; 55 const double rr = zenithInterval.minValue() + ii * stepR; 73 56 74 57 return t_polarPoint(aa, rr); 75 58 } 76 59 77 // Bounding Box (virtual)60 // 78 61 //////////////////////////////////////////////////////////////////////////// 79 QRectF t_polarData::boundingRect() const { 80 return d_boundingRect; 62 t_polarCurve* t_polarPlot::createCurve() const { 63 const int numPoints = 200; 64 t_polarCurve* curve = new t_polarCurve(); 65 curve->setStyle(QwtPolarCurve::NoCurve); // draw only symbols 66 curve->setSymbol(new QwtSymbol(QwtSymbol::Ellipse, 67 QBrush(Qt::red), QPen(Qt::red), 68 QSize(3, 3))); 69 QwtSeriesData<t_polarPoint>* data = new t_polarData(numPoints); 70 curve->setData((QwtSeriesData<QwtPointPolar>*) data); 71 return curve; 81 72 } 82 73 83 74 // Constructor 84 75 //////////////////////////////////////////////////////////////////////////// 85 t_polarPlot::t_polarPlot( QWidget *parent) :86 QwtPolarPlot(QwtText("Polar Plot"), parent) {76 t_polarPlot::t_polarPlot(QWidget* parent) : 77 QwtPolarPlot(QwtText("Polar Plot"), parent) { 87 78 88 79 setPlotBackground(Qt::white); … … 122 113 } 123 114 124 // Destructor125 ////////////////////////////////////////////////////////////////////////////126 t_polarPlot::~t_polarPlot() {127 }128 129 //130 ////////////////////////////////////////////////////////////////////////////131 t_polarCurve* t_polarPlot::createCurve() const {132 const int numPoints = 200;133 t_polarCurve* curve = new t_polarCurve();134 curve->setStyle(QwtPolarCurve::NoCurve); // draw only symbols135 curve->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,136 QBrush(Qt::red), QPen(Qt::red),137 QSize(3, 3)));138 QwtSeriesData<t_polarPoint>* data = new t_polarData(numPoints);139 curve->setData((QwtSeriesData<QwtPointPolar>*) data);140 return curve;141 } -
trunk/BNC/src/rinex/polarplot.h
r4320 r4321 10 10 class t_polarCurve : public QwtPolarCurve { 11 11 public: 12 t_polarCurve() ;13 virtual ~t_polarCurve() ;12 t_polarCurve() {} 13 virtual ~t_polarCurve() {} 14 14 protected: 15 15 virtual void drawSymbols (QPainter* painter, const QwtSymbol& symbol, … … 32 32 class t_polarData: public QwtSeriesData<t_polarPoint> { 33 33 public: 34 t_polarData(size_t size); 34 t_polarData(size_t size) { 35 _size = size; 36 } 35 37 virtual t_polarPoint sample(size_t ii) const; 36 38 virtual size_t size() const {return _size;} 37 virtual QRectF boundingRect() const; 39 virtual QRectF boundingRect() const { 40 return d_boundingRect; 41 } 38 42 protected: 39 QwtInterval _zenithInterval;40 QwtInterval _azimuthInterval;41 43 size_t _size; 42 44 }; … … 49 51 public: 50 52 t_polarPlot(QWidget* = 0); 51 ~t_polarPlot();52 53 public slots:54 53 55 54 private:
Note:
See TracChangeset
for help on using the changeset viewer.