Changeset 4321 in ntrip


Ignore:
Timestamp:
Jun 23, 2012, 4:44:17 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/rinex
Files:
2 edited

Legend:

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

    r4320 r4321  
    2323#include "polarplot.h"
    2424
    25 // Constructor
    26 ////////////////////////////////////////////////////////////////////////////
    27 t_polarCurve::t_polarCurve() {
    28 }
    29 
    30 // Destructor (virtual)
    31 ////////////////////////////////////////////////////////////////////////////
    32 t_polarCurve::~t_polarCurve() {
    33 }
    34 
    3525// Draw Symbols (virtual) - change symbol's color
    3626////////////////////////////////////////////////////////////////////////////
     
    5343}
    5444
    55 // Constructor
    56 ////////////////////////////////////////////////////////////////////////////
    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 
    6545// Sample (virtual)
    6646////////////////////////////////////////////////////////////////////////////
    6747t_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 );
    7050
    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;
    7356
    7457  return t_polarPoint(aa, rr);
    7558}
    7659
    77 // Bounding Box (virtual)
     60//
    7861////////////////////////////////////////////////////////////////////////////
    79 QRectF t_polarData::boundingRect() const {
    80   return d_boundingRect;
     62t_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;
    8172}
    8273
    8374// Constructor
    8475////////////////////////////////////////////////////////////////////////////
    85 t_polarPlot::t_polarPlot( QWidget *parent ) :
    86 QwtPolarPlot(QwtText("Polar Plot"), parent) {
     76t_polarPlot::t_polarPlot(QWidget* parent) :
     77  QwtPolarPlot(QwtText("Polar Plot"), parent) {
    8778
    8879  setPlotBackground(Qt::white);
     
    122113}
    123114
    124 // Destructor
    125 ////////////////////////////////////////////////////////////////////////////
    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 symbols
    135   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  
    1010class t_polarCurve : public QwtPolarCurve {
    1111 public:
    12   t_polarCurve();
    13   virtual ~t_polarCurve();
     12  t_polarCurve() {}
     13  virtual ~t_polarCurve() {}
    1414 protected:
    1515   virtual void drawSymbols (QPainter* painter, const QwtSymbol& symbol,
     
    3232class t_polarData: public QwtSeriesData<t_polarPoint> {
    3333 public:
    34   t_polarData(size_t size);
     34  t_polarData(size_t size) {
     35    _size = size;
     36  }
    3537  virtual t_polarPoint sample(size_t ii) const;
    3638  virtual size_t size() const {return _size;}
    37   virtual QRectF boundingRect() const;
     39  virtual QRectF boundingRect() const {
     40    return d_boundingRect;
     41  }
    3842 protected:
    39   QwtInterval _zenithInterval;
    40   QwtInterval _azimuthInterval;
    4143  size_t      _size;
    4244};
     
    4951 public:
    5052  t_polarPlot(QWidget* = 0);
    51   ~t_polarPlot();
    52 
    53  public slots:
    5453
    5554 private:
Note: See TracChangeset for help on using the changeset viewer.