Changeset 4327 in ntrip


Ignore:
Timestamp:
Jun 23, 2012, 5:46:52 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

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

    r4326 r4327  
    2020#include <qwt_symbol.h>
    2121#include <qwt_polar_grid.h>
     22#include <qwt_color_map.h>
    2223
    2324#include "polarplot.h"
     25
     26class t_colorMap: public QwtLinearColorMap {
     27 public:
     28  t_colorMap() : QwtLinearColorMap(Qt::darkBlue, Qt::yellow) {
     29    addColorStop(0.05, Qt::blue);
     30    addColorStop(0.30, Qt::cyan);
     31    addColorStop(0.60, Qt::green);
     32    addColorStop(0.98, Qt::red);
     33  }
     34};
     35
     36t_colorMap colorMap;
    2437
    2538// Draw Symbols (virtual) - change symbol's color
     
    3346    const t_polarData*  polarData = reinterpret_cast<const t_polarData*>(data());
    3447    const t_polarPoint& point     = polarData->sample(ii);
    35     if (point._value == 1) {
    36       ss.setBrush(QBrush(Qt::red));
    37       ss.setPen(QPen(Qt::red));
    38     }
    39     else {
    40       ss.setBrush(QBrush(Qt::blue));
    41       ss.setPen(QPen(Qt::blue));
    42     }
     48    const QColor color = colorMap.color(QwtInterval(0.0, 1.0), point._value);
     49    ss.setBrush(QBrush(color));
     50    ss.setPen(QPen(color));
    4351    QwtPolarCurve::drawSymbols(painter, ss, azimuthMap, radialMap, pole, ii,ii);
    4452  }
     
    5765  const double rr    = zenithInterval.minValue() + ii * stepR;
    5866
    59   double value = 0.0;
    60   if (ii % 3 == 0) {
    61     value = 1.0;
    62   }
     67  double value = static_cast<double>(ii) / _size;
    6368
    6469  return t_polarPoint(aa, rr, value);
Note: See TracChangeset for help on using the changeset viewer.