Changeset 4334 in ntrip for trunk/BNC/src/rinex/polarplot.cpp
- Timestamp:
- Jun 24, 2012, 10:34:29 AM (12 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.