Qwt Polar User's Guide: qwt_polar_item.h Source File

Qwt Polar User's Guide 1.1.1

- Main Page
- Related Pages
- Classes

All Classes Functions Typedefs Enumerations Enumerator Pages
qwt_polar_item.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * QwtPolar Widget Library
3 * Copyright (C) 2008 Uwe Rathmann
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the Qwt License, Version 1.0
7 *****************************************************************************/
8
9 #ifndef QWT_POLAR_ITEM_H
10 #define QWT_POLAR_ITEM_H
11
12 #include "qwt_polar_global.h"
13 #include <qwt_text.h>
14 #include <qwt_legend_data.h>
15 #include <qwt_graphic.h>
16 #include <qwt_interval.h>
17
18 class QString;
19 class QRect;
20 class QPointF;
21 class QPainter;
22 class QwtPolarPlot;
23 class QwtScaleMap;
24 class QwtScaleDiv;
25
37 class QWT_POLAR_EXPORT QwtPolarItem
38 {
39 public:
46 enum RttiValues
47 {
49 Rtti_PolarItem = 0,
50
52 Rtti_PolarGrid,
53
55 Rtti_PolarMarker,
56
58 Rtti_PolarCurve,
59
61 Rtti_PolarSpectrogram,
62
67 Rtti_PolarUserItem = 1000
68 };
69
74 enum ItemAttribute
75 {
77 Legend = 0x01,
78
83 AutoScale = 0x02
84 };
85
87 typedef QFlags<ItemAttribute> ItemAttributes;
88
93 enum RenderHint
94 {
96 RenderAntialiased = 0x01
97 };
98
100 typedef QFlags<RenderHint> RenderHints;
101
102 explicit QwtPolarItem( const QwtText &title = QwtText() );
103 virtual ~QwtPolarItem();
104
105 void attach( QwtPolarPlot *plot );
106 void detach();
107
108 QwtPolarPlot *plot() const;
109
110 void setTitle( const QString &title );
111 void setTitle( const QwtText &title );
112 const QwtText &title() const;
113
114 virtual int rtti() const;
115
116 void setItemAttribute( ItemAttribute, bool on = true );
117 bool testItemAttribute( ItemAttribute ) const;
118
119 void setRenderHint( RenderHint, bool on = true );
120 bool testRenderHint( RenderHint ) const;
121
122 void setRenderThreadCount( uint numThreads );
123 uint renderThreadCount() const;
124
125 double z() const;
126 void setZ( double z );
127
128 void show();
129 void hide();
130 virtual void setVisible( bool );
131 bool isVisible () const;
132
133 virtual void itemChanged();
134 virtual void legendChanged();
135
146 virtual void draw( QPainter *painter,
147 const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap,
148 const QPointF &pole, double radius,
149 const QRectF &canvasRect ) const = 0;
150
151 virtual QwtInterval boundingInterval( int scaleId ) const;
152
153 virtual void updateScaleDiv( const QwtScaleDiv &,
154 const QwtScaleDiv &, const QwtInterval & );
155
156 virtual int marginHint() const;
157
158 void setLegendIconSize( const QSize & );
159 QSize legendIconSize() const;
160
161 virtual QList<QwtLegendData> legendData() const;
162 virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
163
164 private:
165 // Disabled copy constructor and operator=
166 QwtPolarItem( const QwtPolarItem & );
167 QwtPolarItem &operator=( const QwtPolarItem & );
168
169 class PrivateData;
170 PrivateData *d_data;
171 };
172
173 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarItem::ItemAttributes )
174 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarItem::RenderHints )
175
176 Q_DECLARE_METATYPE( QwtPolarItem * )
177
178 #endif
QwtPolarItem::Rtti_PolarGrid
For QwtPolarGrid.
Definition: qwt_polar_item.h:52
QwtPolarItem::ItemAttribute
ItemAttribute
Plot Item Attributes.
Definition: qwt_polar_item.h:74
QwtPolarItem::RttiValues
RttiValues
Runtime type information.
Definition: qwt_polar_item.h:46
QwtPolarItem::RenderHint
RenderHint
Render hints.
Definition: qwt_polar_item.h:93
QwtPolarItem::ItemAttributes
QFlags< ItemAttribute > ItemAttributes
Item attributes.
Definition: qwt_polar_item.h:87
QwtPolarItem::RenderHints
QFlags< RenderHint > RenderHints
Item attributes.
Definition: qwt_polar_item.h:100
QwtPolarItem::Rtti_PolarMarker
For QwtPolarMarker.
Definition: qwt_polar_item.h:55
QwtPolarItem
Base class for items on a polar plot.
Definition: qwt_polar_item.h:37
QwtPolarItem::Rtti_PolarCurve
For QwtPolarCurve.
Definition: qwt_polar_item.h:58
QwtPolarPlot
A plotting widget, displaying a polar coordinate system.
Definition: qwt_polar_plot.h:46
QwtPolarItem::Rtti_PolarSpectrogram
For QwtPolarSpectrogram.
Definition: qwt_polar_item.h:61