Changeset 4334 in ntrip for trunk/BNC/src/rinex
- Timestamp:
- Jun 24, 2012, 10:34:29 AM (12 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/polarplot.cpp
r4333 r4334 34 34 for (int ii = from; ii <= to; ii++) { 35 35 QwtSymbol ss(symbol); 36 const QwtPointPolar& point 36 const QwtPointPolar& point = sample(ii); 37 37 const QColor color = colorMap.color(QwtInterval(0.0, 1.0), point._value); 38 38 ss.setBrush(QBrush(color)); … … 40 40 QwtPolarCurve::drawSymbols(painter, ss, azimuthMap, radialMap, pole, ii,ii); 41 41 } 42 }43 44 // Sample (virtual) - this is for testing only45 ////////////////////////////////////////////////////////////////////////////46 QwtPointPolar t_polarData::sample(size_t ii) const {47 const QwtInterval zenithInterval(0.0, 90.0);48 const QwtInterval azimuthInterval(0.0, 360.0 );49 50 const double stepA = 4 * azimuthInterval.width() / _size;51 const double aa = azimuthInterval.minValue() + ii * stepA;52 53 const double stepR = zenithInterval.width() / _size;54 const double rr = zenithInterval.minValue() + ii * stepR;55 56 double value = static_cast<double>(ii) / _size;57 58 QwtPointPolar point(aa,rr);59 point._value = value;60 61 return point;62 }63 64 //65 ////////////////////////////////////////////////////////////////////////////66 t_polarCurve* t_polarPlot::createCurve() const {67 const int numPoints = 1000;68 t_polarCurve* curve = new t_polarCurve();69 curve->setStyle(QwtPolarCurve::NoCurve); // draw only symbols70 curve->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,71 QBrush(Qt::red), QPen(Qt::red),72 QSize(3, 3)));73 t_polarData* data = new t_polarData(numPoints);74 curve->setData(data);75 return curve;76 42 } 77 43 … … 110 76 111 77 grid->attach(this); 78 } 112 79 113 // Curves 114 // ------ 115 t_polarCurve* curve = createCurve(); 80 // 81 //////////////////////////////////////////////////////////////////////////// 82 void t_polarPlot::addCurve(QVector<t_polarPoint*>* data) { 83 t_polarCurve* curve = new t_polarCurve(); 84 curve->setStyle(QwtPolarCurve::NoCurve); // draw only symbols 85 curve->setSymbol(new QwtSymbol(QwtSymbol::Ellipse, 86 QBrush(Qt::red), QPen(Qt::red), 87 QSize(3, 3))); 88 t_polarData* polarData = new t_polarData(data); 89 curve->setData(polarData); 116 90 curve->attach(this); 117 91 } 118 -
trunk/BNC/src/rinex/polarplot.h
r4331 r4334 20 20 // 21 21 ////////////////////////////////////////////////////////////////////////////// 22 class t_polarPoint { 23 public: 24 t_polarPoint(double az, double zen, double value) { 25 _az = az; 26 _zen = zen; 27 _value = value; 28 } 29 double _az; 30 double _zen; 31 double _value; 32 }; 33 34 // 35 ////////////////////////////////////////////////////////////////////////////// 22 36 class t_polarData: public QwtSeriesData<QwtPointPolar> { 23 37 public: 24 t_polarData(size_t size) { 25 _size = size; 38 t_polarData(QVector<t_polarPoint*>* data) { 39 _data = data; 40 _size = data->size(); 26 41 } 27 virtual QwtPointPolar sample(size_t ii) const; 42 ~t_polarData() { 43 for (int ii = 0; ii < _data->size(); ii++) { 44 delete _data->at(ii); 45 } 46 } 47 virtual QwtPointPolar sample(size_t ii) const { 48 const t_polarPoint* point = _data->at(ii); 49 QwtPointPolar qp(point->_az, point->_zen); qp._value = point->_value; 50 return qp; 51 } 28 52 virtual size_t size() const {return _size;} 29 virtual QRectF boundingRect() const { 30 return d_boundingRect; 31 } 53 virtual QRectF boundingRect() const {return d_boundingRect;} 32 54 protected: 33 55 size_t _size; 56 private: 57 QVector<t_polarPoint*>* _data; 34 58 }; 35 59 … … 41 65 public: 42 66 t_polarPlot(QWidget* = 0); 67 void addCurve(QVector<t_polarPoint*>* data); 43 68 44 69 private: 45 t_polarCurve* createCurve() const;46 70 }; 47 71 -
trunk/BNC/src/rinex/reqcanalyze.cpp
r4310 r4334 85 85 void t_reqcAnalyze::slotDisplayGraph() { 86 86 if (((bncApp*) qApp)->mode() == bncApp::interactive) { 87 88 QVector<t_polarPoint*>* data1 = new QVector<t_polarPoint*>; 89 90 //// beg test 91 { 92 const QwtInterval zenithInterval(0.0, 90.0); 93 const QwtInterval azimuthInterval(0.0, 360.0 ); 94 const int numPoints = 1000; 95 const double stepA = 4 * azimuthInterval.width() / numPoints; 96 const double stepR = zenithInterval.width() / numPoints; 97 for (int ii = 0; ii < numPoints; ii++) { 98 double aa = azimuthInterval.minValue() + ii * stepA; 99 double rr = zenithInterval.minValue() + ii * stepR; 100 double vv = static_cast<double>(ii) / numPoints; 101 (*data1) << (new t_polarPoint(aa, rr, vv)); 102 } 103 } 104 //// end test 105 106 t_polarPlot* plotMP1 = new t_polarPlot(0); 107 plotMP1->addCurve(data1); 108 109 QVector<t_polarPoint*>* data2 = new QVector<t_polarPoint*>; 110 111 //// beg test 112 { 113 const QwtInterval zenithInterval(0.0, 90.0); 114 const QwtInterval azimuthInterval(0.0, 360.0 ); 115 const int numPoints = 1000; 116 const double stepA = 4 * azimuthInterval.width() / numPoints; 117 const double stepR = zenithInterval.width() / numPoints; 118 for (int ii = 0; ii < numPoints; ii++) { 119 double aa = azimuthInterval.minValue() + ii * stepA; 120 double rr = zenithInterval.minValue() + ii * stepR; 121 double vv = static_cast<double>(ii) / numPoints; 122 (*data2) << (new t_polarPoint(aa, rr, vv)); 123 } 124 } 125 //// end test 126 127 t_polarPlot* plotMP2 = new t_polarPlot(0); 128 plotMP2->addCurve(data2); 129 87 130 QVector<QWidget*> plots; 88 t_polarPlot* plotMP1 = new t_polarPlot(0);plots << plotMP1;89 t_polarPlot* plotMP2 = new t_polarPlot(0);plots << plotMP2;90 131 plots << plotMP1; 132 plots << plotMP2; 133 91 134 t_graphWin* graphWin = new t_graphWin(0, plots); 135 92 136 graphWin->show(); 93 137 }
Note:
See TracChangeset
for help on using the changeset viewer.