Qwt User's Guide: qwt_polar_item.h Source File

Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
qwt_polar_item.h
1/******************************************************************************
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_global.h"
13#include "qwt_text.h"
14#include "qwt_legend_data.h"
15#include "qwt_graphic.h"
16#include "qwt_interval.h"
17
18class QString;
19class QRect;
20class QPointF;
21class QPainter;
22class QwtPolarPlot;
23class QwtScaleMap;
24class QwtScaleDiv;
25
37 class QWT_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
86 Q_DECLARE_FLAGS( ItemAttributes, ItemAttribute )
87
88
92 enum RenderHint
93 {
95 RenderAntialiased = 0x01
96 };
97
98 Q_DECLARE_FLAGS( RenderHints, RenderHint )
99
100 explicit QwtPolarItem( const QwtText& title = QwtText() );
101 virtual ~QwtPolarItem();
102
103 void attach( QwtPolarPlot* plot );
104 void detach();
105
106 QwtPolarPlot* plot() const;
107
108 void setTitle( const QString& title );
109 void setTitle( const QwtText& title );
110 const QwtText& title() const;
111
112 virtual int rtti() const;
113
114 void setItemAttribute( ItemAttribute, bool on = true );
115 bool testItemAttribute( ItemAttribute ) const;
116
117 void setRenderHint( RenderHint, bool on = true );
118 bool testRenderHint( RenderHint ) const;
119
120 void setRenderThreadCount( uint numThreads );
121 uint renderThreadCount() const;
122
123 double z() const;
124 void setZ( double z );
125
126 void show();
127 void hide();
128 virtual void setVisible( bool );
129 bool isVisible () const;
130
131 virtual void itemChanged();
132 virtual void legendChanged();
133
144 virtual void draw( QPainter* painter,
145 const QwtScaleMap& azimuthMap, const QwtScaleMap& radialMap,
146 const QPointF& pole, double radius,
147 const QRectF& canvasRect ) const = 0;
148
149 virtual QwtInterval boundingInterval( int scaleId ) const;
150
151 virtual void updateScaleDiv( const QwtScaleDiv&,
152 const QwtScaleDiv&, const QwtInterval& );
153
154 virtual int marginHint() const;
155
156 void setLegendIconSize( const QSize& );
157 QSize legendIconSize() const;
158
159 virtual QList< QwtLegendData > legendData() const;
160 virtual QwtGraphic legendIcon( int index, const QSizeF& ) const;
161
162 private:
163 Q_DISABLE_COPY( QwtPolarItem )
164
165 class PrivateData;
166 PrivateData* m_data;
167};
168
169Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarItem::ItemAttributes )
170Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarItem::RenderHints )
171
172Q_DECLARE_METATYPE( QwtPolarItem* )
173
174#endif
QList
Definition qwt_abstract_legend.h:17
QwtGraphic
A paint device for scalable graphics.
Definition qwt_graphic.h:76
QwtInterval
A class representing an interval.
Definition qwt_interval.h:23
QwtPolarItem
Base class for items on a polar plot.
Definition qwt_polar_item.h:38
QwtPolarItem::draw
virtual void draw(QPainter *painter, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, double radius, const QRectF &canvasRect) const =0
Draw the item.
QwtPolarItem::ItemAttribute
ItemAttribute
Plot Item Attributes.
Definition qwt_polar_item.h:75
QwtPolarItem::ItemAttributes
QFlags< ItemAttribute > ItemAttributes
Definition qwt_polar_item.h:86
QwtPolarItem::RttiValues
RttiValues
Runtime type information.
Definition qwt_polar_item.h:47
QwtPolarItem::Rtti_PolarMarker
@ Rtti_PolarMarker
For QwtPolarMarker.
Definition qwt_polar_item.h:55
QwtPolarItem::Rtti_PolarGrid
@ Rtti_PolarGrid
For QwtPolarGrid.
Definition qwt_polar_item.h:52
QwtPolarItem::Rtti_PolarCurve
@ Rtti_PolarCurve
For QwtPolarCurve.
Definition qwt_polar_item.h:58
QwtPolarItem::Rtti_PolarSpectrogram
@ Rtti_PolarSpectrogram
For QwtPolarSpectrogram.
Definition qwt_polar_item.h:61
QwtPolarItem::RenderHints
QFlags< RenderHint > RenderHints
Definition qwt_polar_item.h:98
QwtPolarItem::RenderHint
RenderHint
Render hints.
Definition qwt_polar_item.h:93
QwtPolarPlot
A plotting widget, displaying a polar coordinate system.
Definition qwt_polar_plot.h:47
QwtScaleDiv
A class representing a scale division.
Definition qwt_scale_div.h:34
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtText
A class representing a text.
Definition qwt_text.h:52