Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_COMPASS_ROSE_H
00011 #define QWT_COMPASS_ROSE_H 1
00012
00013 #include <qpalette.h>
00014 #include "qwt_global.h"
00015
00016 class QPainter;
00017
00021 class QWT_EXPORT QwtCompassRose
00022 {
00023 public:
00024 virtual ~QwtCompassRose() {};
00025
00027 virtual void setPalette(const QPalette &p) { d_palette = p; }
00028
00030 const QPalette &palette() const { return d_palette; }
00031
00041 virtual void draw(QPainter *painter, const QPoint ¢er,
00042 int radius, double north,
00043 QPalette::ColorGroup colorGroup = QPalette::Active) const = 0;
00044
00045 private:
00046 QPalette d_palette;
00047 };
00048
00052 class QWT_EXPORT QwtSimpleCompassRose: public QwtCompassRose
00053 {
00054 public:
00055 QwtSimpleCompassRose(int numThorns = 8, int numThornLevels = -1);
00056
00057 void setWidth(double w);
00058
00060 double width() const { return d_width; }
00061
00062 void setNumThorns(int count);
00063 int numThorns() const;
00064
00065 void setNumThornLevels(int count);
00066 int numThornLevels() const;
00067
00068 void setShrinkFactor(double factor) { d_shrinkFactor = factor; }
00069 double shrinkFactor() const { return d_shrinkFactor; }
00070
00071 virtual void draw(QPainter *, const QPoint ¢er, int radius,
00072 double north, QPalette::ColorGroup = QPalette::Active) const;
00073
00074 static void drawRose(QPainter *,
00075 #if QT_VERSION < 0x040000
00076 const QColorGroup &,
00077 #else
00078 const QPalette &,
00079 #endif
00080 const QPoint ¢er, int radius, double origin, double width,
00081 int numThorns, int numThornLevels, double shrinkFactor);
00082
00083 private:
00084 double d_width;
00085 int d_numThorns;
00086 int d_numThornLevels;
00087 double d_shrinkFactor;
00088 };
00089
00090 #endif // QWT_COMPASS_ROSE_H