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
37class QWT_EXPORT QwtPolarItem
38{
39 public:
47 {
49 Rtti_PolarItem = 0,
50
53
56
59
62
67 Rtti_PolarUserItem = 1000
68 };
69
75 {
77 Legend = 0x01,
78
83 AutoScale = 0x02
84 };
85
86 Q_DECLARE_FLAGS( ItemAttributes, ItemAttribute )
87
88
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
A paint device for scalable graphics.
Definition qwt_graphic.h:76
A class representing an interval.
Base class for items on a polar plot.
virtual void draw(QPainter *painter, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, double radius, const QRectF &canvasRect) const =0
Draw the item.
ItemAttribute
Plot Item Attributes.
QFlags< ItemAttribute > ItemAttributes
RttiValues
Runtime type information.
@ Rtti_PolarMarker
For QwtPolarMarker.
@ Rtti_PolarGrid
For QwtPolarGrid.
@ Rtti_PolarCurve
For QwtPolarCurve.
@ Rtti_PolarSpectrogram
For QwtPolarSpectrogram.
QFlags< RenderHint > RenderHints
RenderHint
Render hints.
A plotting widget, displaying a polar coordinate system.
A class representing a scale division.
A scale map.
A class representing a text.
Definition qwt_text.h:52