source: pacpusframework/branches/2.0-beta1/include/extlib/qwt-5.2.1/qwt_compass_rose.h@ 89

Last change on this file since 89 was 89, checked in by morasjul, 11 years ago

PACPUS 2.0 Beta deployed in new branch

Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support

  • Property svn:executable set to *
File size: 2.4 KB
Line 
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 <qpalette.h>
14#include "qwt_global.h"
15
16class QPainter;
17
18/*!
19 \brief Abstract base class for a compass rose
20*/
21class QWT_EXPORT QwtCompassRose
22{
23public:
24 virtual ~QwtCompassRose() {};
25
26 //! Assign a palette
27 virtual void setPalette(const QPalette &p) { d_palette = p; }
28
29 //! \return Current palette
30 const QPalette &palette() const { return d_palette; }
31
32 /*!
33 Draw the rose
34
35 \param painter Painter
36 \param center Center point
37 \param radius Radius of the rose
38 \param north Position
39 \param colorGroup Color group
40 */
41 virtual void draw(QPainter *painter, const QPoint &center,
42 int radius, double north,
43 QPalette::ColorGroup colorGroup = QPalette::Active) const = 0;
44
45private:
46 QPalette d_palette;
47};
48
49/*!
50 \brief A simple rose for QwtCompass
51*/
52class QWT_EXPORT QwtSimpleCompassRose: public QwtCompassRose
53{
54public:
55 QwtSimpleCompassRose(int numThorns = 8, int numThornLevels = -1);
56
57 void setWidth(double w);
58
59 //! \sa setWidth()
60 double width() const { return d_width; }
61
62 void setNumThorns(int count);
63 int numThorns() const;
64
65 void setNumThornLevels(int count);
66 int numThornLevels() const;
67
68 void setShrinkFactor(double factor) { d_shrinkFactor = factor; }
69 double shrinkFactor() const { return d_shrinkFactor; }
70
71 virtual void draw(QPainter *, const QPoint &center, int radius,
72 double north, QPalette::ColorGroup = QPalette::Active) const;
73
74 static void drawRose(QPainter *,
75#if QT_VERSION < 0x040000
76 const QColorGroup &,
77#else
78 const QPalette &,
79#endif
80 const QPoint &center, int radius, double origin, double width,
81 int numThorns, int numThornLevels, double shrinkFactor);
82
83private:
84 double d_width;
85 int d_numThorns;
86 int d_numThornLevels;
87 double d_shrinkFactor;
88};
89
90#endif // QWT_COMPASS_ROSE_H
Note: See TracBrowser for help on using the repository browser.