Changeset 4334 in ntrip for trunk/BNC/src/rinex/polarplot.cpp


Ignore:
Timestamp:
Jun 24, 2012, 10:34:29 AM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/rinex/polarplot.cpp

    r4333 r4334  
    3434  for (int ii = from; ii <= to; ii++) {
    3535    QwtSymbol ss(symbol);
    36     const QwtPointPolar& point    = sample(ii);
     36    const QwtPointPolar& point = sample(ii);
    3737    const QColor color = colorMap.color(QwtInterval(0.0, 1.0), point._value);
    3838    ss.setBrush(QBrush(color));
     
    4040    QwtPolarCurve::drawSymbols(painter, ss, azimuthMap, radialMap, pole, ii,ii);
    4141  }
    42 }
    43 
    44 // Sample (virtual) - this is for testing only
    45 ////////////////////////////////////////////////////////////////////////////
    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 symbols
    70   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;
    7642}
    7743
     
    11076
    11177  grid->attach(this);
     78}
    11279
    113   // Curves
    114   // ------
    115   t_polarCurve* curve = createCurve();
     80//
     81////////////////////////////////////////////////////////////////////////////
     82void 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);
    11690  curve->attach(this);
    11791}
    118 
Note: See TracChangeset for help on using the changeset viewer.