QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_polar_plot.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_PLOT_H
10#define QWT_POLAR_PLOT_H
11
12#include "qwt_global.h"
13#include "qwt_polar.h"
14#include "qwt_polar_itemdict.h"
15#include "qwt_interval.h"
16#include "qwt_scale_map.h"
17#include "qwt_point_polar.h"
18#include <qframe.h>
19
21class QwtScaleEngine;
22class QwtScaleDiv;
23class QwtTextLabel;
24class QwtPolarCanvas;
25class QwtPolarLayout;
27
60class QWT_EXPORT QwtPolarPlot : public QFrame, public QwtPolarItemDict
61{
62 Q_OBJECT
63
64 Q_PROPERTY(QBrush plotBackground READ plotBackground WRITE setPlotBackground)
65 Q_PROPERTY(double azimuthOrigin READ azimuthOrigin WRITE setAzimuthOrigin)
66
67public:
80 {
83
86
89
92
110 ExternalLegend
111 };
112
114 explicit QwtPolarPlot(QWidget* parent = nullptr);
116 QwtPolarPlot(const QwtText& title, QWidget* parent = nullptr);
117
119 virtual ~QwtPolarPlot();
120
122 void setTitle(const QString&);
124 void setTitle(const QwtText&);
125
127 QwtText title() const;
128
130 QwtTextLabel* titleLabel();
132 const QwtTextLabel* titleLabel() const;
133
135 void setAutoReplot(bool tf = true);
137 bool autoReplot() const;
138
140 void setAutoScale(int scaleId);
142 bool hasAutoScale(int scaleId) const;
143
145 void setScaleMaxMinor(int scaleId, int maxMinor);
147 int scaleMaxMinor(int scaleId) const;
148
150 int scaleMaxMajor(int scaleId) const;
152 void setScaleMaxMajor(int scaleId, int maxMajor);
153
155 QwtScaleEngine* scaleEngine(int scaleId);
157 const QwtScaleEngine* scaleEngine(int scaleId) const;
159 void setScaleEngine(int scaleId, QwtScaleEngine*);
160
162 void setScale(int scaleId, double min, double max, double step = 0);
163
165 void setScaleDiv(int scaleId, const QwtScaleDiv&);
167 const QwtScaleDiv* scaleDiv(int scaleId) const;
169 QwtScaleDiv* scaleDiv(int scaleId);
170
172 QwtScaleMap scaleMap(int scaleId, double radius) const;
174 QwtScaleMap scaleMap(int scaleId) const;
175
177 void updateScale(int scaleId);
178
180 double azimuthOrigin() const;
181
183 void zoom(const QwtPointPolar&, double factor);
185 void unzoom();
186
188 QwtPointPolar zoomPos() const;
190 double zoomFactor() const;
191
192 // Canvas
193
195 QwtPolarCanvas* canvas();
197 const QwtPolarCanvas* canvas() const;
198
200 void setPlotBackground(const QBrush& c);
202 const QBrush& plotBackground() const;
203
205 virtual void drawCanvas(QPainter*, const QRectF&) const;
206
207 // Legend
208
210 void insertLegend(QwtAbstractLegend*, LegendPosition = RightLegend, double ratio = -1.0);
211
213 QwtAbstractLegend* legend();
215 const QwtAbstractLegend* legend() const;
216
218 void updateLegend();
220 void updateLegend(const QwtPolarItem*);
221
222 // Layout
224 QwtPolarLayout* plotLayout();
226 const QwtPolarLayout* plotLayout() const;
227
229 QwtInterval visibleInterval() const;
231 QRectF plotRect() const;
233 QRectF plotRect(const QRectF&) const;
234
236 int plotMarginHint() const;
237
239 virtual QVariant itemToInfo(QwtPolarItem*) const;
241 virtual QwtPolarItem* infoToItem(const QVariant&) const;
242
243Q_SIGNALS:
250 void itemAttached(QwtPolarItem* plotItem, bool on);
251
259 void legendDataChanged(const QVariant& itemInfo, const QList< QwtLegendData >& data);
260
266
267public Q_SLOTS:
269 virtual void replot();
271 void autoRefresh();
273 void setAzimuthOrigin(double);
274
275protected:
277 virtual bool event(QEvent*) override;
279 virtual void resizeEvent(QResizeEvent*) override;
280
282 virtual void updateLayout();
283
285 virtual void drawItems(QPainter* painter,
286 const QwtScaleMap& radialMap,
287 const QwtScaleMap& azimuthMap,
288 const QPointF& pole,
289 double radius,
290 const QRectF& canvasRect) const;
291
292private:
293 friend class QwtPolarItem;
294 void attachItem(QwtPolarItem*, bool);
295
296 void initPlot(const QwtText&);
297
298 class PrivateData;
299 PrivateData* m_data;
300};
301
302#endif
Definition qwt_dyngrid_layout.h:33
图例控件的抽象基类
Definition qwt_abstract_legend.h:57
表示区间的类
Definition qwt_interval.h:45
极坐标点
Definition qwt_point_polar.h:52
QwtPolarPlot 的画布
Definition qwt_polar_canvas.h:36
极坐标绘图项的字典
Definition qwt_polar_itemdict.h:38
极坐标绘图项的基类
Definition qwt_polar_item.h:44
QwtPolarPlot 的布局类
Definition qwt_polar_layout.h:33
显示极坐标系的绘图控件
Definition qwt_polar_plot.h:61
void layoutChanged()
A signal that is emitted, whenever the layout of the plot has been recalculated 当绘图的布局重新计算时发出的信号
void itemAttached(QwtPolarItem *plotItem, bool on)
A signal indicating, that an item has been attached/detached 表示绘图项已附加/分离的信号
void legendDataChanged(const QVariant &itemInfo, const QList< QwtLegendData > &data)
A signal with the attributes how to update the legend entries for a plot item 包含如何更新绘图项图例条目属性的信号
LegendPosition
图例相对于画布的位置
Definition qwt_polar_plot.h:80
@ BottomLegend
The legend will be below the canvas
Definition qwt_polar_plot.h:88
@ LeftLegend
The legend will be left from the canvas
Definition qwt_polar_plot.h:82
@ TopLegend
The legend will be between canvas and title
Definition qwt_polar_plot.h:91
@ RightLegend
The legend will be right from the canvas
Definition qwt_polar_plot.h:85
用于绘制圆形刻度的类
Definition qwt_round_scale_draw.h:58
A class representing a scale division/表示刻度划分的类
Definition qwt_scale_div.h:53
刻度引擎的基类
Definition qwt_scale_engine.h:76
刻度映射
Definition qwt_scale_map.h:52
显示 QwtText 的控件
Definition qwt_text_label.h:55
表示文本的类
Definition qwt_text.h:93