Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

qwt_compass_rose.h

Go to the documentation of this file.
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
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 
00018 class QWT_EXPORT QwtCompassRose
00019 {
00020 public:
00021     virtual ~QwtCompassRose() {};
00022 
00023     virtual void setPalette(const QPalette &p) { d_palette = p; }
00024     const QPalette &palette() const { return d_palette; }
00025 
00026   virtual void draw(QPainter *, const QPoint &center, 
00027     int radius, double north, 
00028     QPalette::ColorGroup = QPalette::Active) const = 0;
00029 
00030 private:
00031   QPalette d_palette;
00032 };
00033 
00034 class QWT_EXPORT QwtSimpleCompassRose: public QwtCompassRose
00035 {
00036 public:
00037   QwtSimpleCompassRose(int numThorns = 8, int numThornLevels = -1);
00038 
00039   void setWidth(double w);
00040   double width() const { return d_width; }
00041 
00042   void setNumThorns(int count);
00043   int numThorns() const;
00044 
00045   void setNumThornLevels(int count);
00046   int numThornLevels() const;
00047 
00048   void setShrinkFactor(double factor) { d_shrinkFactor = factor; }
00049   double shrinkFactor() const { return d_shrinkFactor; }
00050 
00051   virtual void draw(QPainter *, const QPoint &center, int radius, 
00052     double north, QPalette::ColorGroup = QPalette::Active) const;
00053 
00054   static void drawRose(QPainter *, const QPoint &center, 
00055     int radius, double origin, double width, 
00056     int numThorns, int numThornLevels,
00057     double shrinkFactor, const QColor &light, const QColor &dark);
00058 
00059 private:
00060   double d_width;     
00061   int d_numThorns;        
00062   int d_numThornLevels; 
00063   double d_shrinkFactor;
00064 };
00065 
00066 #endif // QWT_COMPASS_ROSE_H

Generated on Fri Nov 7 14:11:45 2003 for Qwt Developer's Guide by doxygen 1.3.2