source: ntrip/trunk/BNC/src/rinex/polarplot.h@ 4328

Last change on this file since 4328 was 4328, checked in by mervart, 12 years ago
File size: 1.9 KB
Line 
1
2#ifndef POLARPLOT_H
3#define POLARPLOT_H
4
5#include <qwt_polar_plot.h>
6#include <qwt_polar_curve.h>
7#include <qwt_color_map.h>
8
9//
10//////////////////////////////////////////////////////////////////////////////
11class t_colorMap: public QwtLinearColorMap {
12 public:
13 t_colorMap() : QwtLinearColorMap(Qt::darkBlue, Qt::yellow) {
14 addColorStop(0.05, Qt::blue);
15 addColorStop(0.30, Qt::cyan);
16 addColorStop(0.60, Qt::green);
17 addColorStop(0.98, Qt::red);
18 }
19};
20
21//
22//////////////////////////////////////////////////////////////////////////////
23class t_polarCurve : public QwtPolarCurve {
24 public:
25 t_polarCurve() {}
26 virtual ~t_polarCurve() {}
27 protected:
28 virtual void drawSymbols (QPainter* painter, const QwtSymbol& symbol,
29 const QwtScaleMap& azimuthMap,
30 const QwtScaleMap& radialMap,
31 const QPointF& pole, int from, int to) const;
32};
33
34//
35//////////////////////////////////////////////////////////////////////////////
36class t_polarPoint : public QwtPointPolar {
37 public:
38 t_polarPoint(double az, double zen, double value) : QwtPointPolar(az, zen) {
39 _value = value;
40 }
41 ~t_polarPoint() {}
42 double _value; // the third coordinate
43};
44
45//
46//////////////////////////////////////////////////////////////////////////////
47class t_polarData: public QwtSeriesData<t_polarPoint> {
48 public:
49 t_polarData(size_t size) {
50 _size = size;
51 }
52 virtual t_polarPoint sample(size_t ii) const;
53 virtual size_t size() const {return _size;}
54 virtual QRectF boundingRect() const {
55 return d_boundingRect;
56 }
57 protected:
58 size_t _size;
59};
60
61//
62//////////////////////////////////////////////////////////////////////////////
63class t_polarPlot: public QwtPolarPlot {
64 Q_OBJECT
65
66 public:
67 t_polarPlot(QWidget* = 0);
68
69 private:
70 t_polarCurve* createCurve() const;
71 t_colorMap* _colorMap;
72};
73
74#endif
Note: See TracBrowser for help on using the repository browser.