Qwt User's Guide 6.1.3

- Main Page
- Classes

qwt_compass_rose.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_COMPASS_ROSE_H
11 #define QWT_COMPASS_ROSE_H 1
12
13 #include "qwt_global.h"
14 #include <qpalette.h>
15
16 class QPainter;
17
21 class QWT_EXPORT QwtCompassRose
22 {
23 public:
25 virtual ~QwtCompassRose() {};
26
28 virtual void setPalette( const QPalette &p )
29 {
30 d_palette = p;
31 }
32
34 const QPalette &palette() const
35 {
36 return d_palette;
37 }
38
48 virtual void draw( QPainter *painter,
49 const QPointF &center, double radius, double north,
50 QPalette::ColorGroup colorGroup = QPalette::Active ) const = 0;
51
52 private:
53 QPalette d_palette;
54 };
55
59 class QWT_EXPORT QwtSimpleCompassRose: public QwtCompassRose
60 {
61 public:
62 QwtSimpleCompassRose( int numThorns = 8, int numThornLevels = -1 );
63 virtual ~QwtSimpleCompassRose();
64
65 void setWidth( double w );
66 double width() const;
67
68 void setNumThorns( int count );
69 int numThorns() const;
70
71 void setNumThornLevels( int count );
72 int numThornLevels() const;
73
74 void setShrinkFactor( double factor );
75 double shrinkFactor() const;
76
77 virtual void draw( QPainter *, const QPointF &center, double radius,
78 double north, QPalette::ColorGroup = QPalette::Active ) const;
79
80 static void drawRose( QPainter *, const QPalette &,
81 const QPointF &center, double radius, double origin, double width,
82 int numThorns, int numThornLevels, double shrinkFactor );
83
84 private:
85 class PrivateData;
86 PrivateData *d_data;
87 };
88
89 #endif
QwtCompassRose::draw
virtual void draw(QPainter *painter, const QPointF &center, double radius, double north, QPalette::ColorGroup colorGroup=QPalette::Active) const =0
QwtCompassRose
Abstract base class for a compass rose.
Definition: qwt_compass_rose.h:21
QwtCompassRose::setPalette
virtual void setPalette(const QPalette &p)
Assign a palette.
Definition: qwt_compass_rose.h:28
QwtCompassRose::~QwtCompassRose
virtual ~QwtCompassRose()
Destructor.
Definition: qwt_compass_rose.h:25
QwtSimpleCompassRose
A simple rose for QwtCompass.
Definition: qwt_compass_rose.h:59
QwtCompassRose::palette
const QPalette & palette() const
Definition: qwt_compass_rose.h:34