QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_intervalcurve.h
1/******************************************************************************
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 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_PLOT_INTERVAL_CURVE_H
28#define QWT_PLOT_INTERVAL_CURVE_H
29
30#include "qwt_global.h"
31#include "qwt_plot_seriesitem.h"
32
34template< typename T > class QwtSeriesData;
35
51class QWT_EXPORT QwtPlotIntervalCurve
52 : public QwtPlotSeriesItem
53 , public QwtSeriesStore< QwtIntervalSample >
54{
55 public:
70 {
81
95
108 UserCurve = 100
109 };
110
123 {
136 ClipPolygons = 0x01,
137
139 ClipSymbol = 0x02
140 };
141
142 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
143
144// Constructor
145 explicit QwtPlotIntervalCurve( const QString& title = QString() );
146
147 // Constructor with QwtText title
148 explicit QwtPlotIntervalCurve( const QwtText& title );
149
150 // Destructor
151 virtual ~QwtPlotIntervalCurve();
152
153 // Get the runtime type information
154 virtual int rtti() const override;
155
156 // Set paint attribute
157 void setPaintAttribute( PaintAttribute, bool on = true );
158
159 // Test paint attribute
160 bool testPaintAttribute( PaintAttribute ) const;
161
162// Set samples from a vector
163 void setSamples( const QVector< QwtIntervalSample >& );
164
165 // Set samples from a series data
166 void setSamples( QwtSeriesData< QwtIntervalSample >* );
167
168 // Set pen with color, width and style
169 void setPen( const QColor&,
170 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
171
172 // Set pen
173 void setPen( const QPen& );
174
175 // Get pen
176 const QPen& pen() const;
177
178// Set brush
179 void setBrush( const QBrush& );
180
181 // Get brush
182 const QBrush& brush() const;
183
184 // Set curve style
185 void setStyle( CurveStyle style );
186
187 // Get curve style
188 CurveStyle style() const;
189
190 // Set symbol
191 void setSymbol( const QwtIntervalSymbol* );
192
193 // Get symbol
194 const QwtIntervalSymbol* symbol() const;
195
196// Draw the series
197 virtual void drawSeries( QPainter*,
198 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
199 const QRectF& canvasRect, int from, int to ) const override;
200
201 // Get the bounding rectangle
202 virtual QRectF boundingRect() const override;
203
204 // Get the legend icon
205 virtual QwtGraphic legendIcon(
206 int index, const QSizeF& ) const override;
207
208 protected:
209
215void init();
216
222virtual void drawTube( QPainter*,
223 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
224 const QRectF& canvasRect, int from, int to ) const;
225
231virtual void drawSymbols( QPainter*, const QwtIntervalSymbol&,
232 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
233 const QRectF& canvasRect, int from, int to ) const;
234
235 private:
236 class PrivateData;
237 PrivateData* m_data;
238};
239
240Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotIntervalCurve::PaintAttributes )
241
242#endif
可缩放图形的绘制设备
Definition qwt_graphic.h:128
用于显示区间(如误差条)的绘图基元
Definition qwt_interval_symbol.h:50
QwtPlotIntervalCurve 表示一系列样本,其中每个值都与一个区间相关联 ( )
Definition qwt_plot_intervalcurve.h:54
PaintAttribute
修改绘制算法的属性
Definition qwt_plot_intervalcurve.h:123
CurveStyle
曲线样式
Definition qwt_plot_intervalcurve.h:70
@ NoCurve
Definition qwt_plot_intervalcurve.h:80
@ Tube
Definition qwt_plot_intervalcurve.h:94
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
Return a legend icon
Definition qwt_plot_item.cpp:621
virtual int rtti() const
Runtime type information
Definition qwt_plot_item.cpp:215
表示一系列样本的绘图项的基类
Definition qwt_plot_seriesitem.h:53
virtual QRectF boundingRect() const override
获取边界矩形
Definition qwt_plot_seriesitem.cpp:174
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
绘制样本的子集
刻度映射
Definition qwt_scale_map.h:52
遍历样本的抽象接口
Definition qwt_series_data.h:72
存储 QwtSeriesData 对象的类
Definition qwt_series_store.h:109
表示文本的类
Definition qwt_text.h:93