QWT API (中文) 7.3.0
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 >
35class QwtSeriesData;
36
45class QWT_EXPORT QwtPlotIntervalCurve : public QwtPlotSeriesItem, public QwtSeriesStore< QwtIntervalSample >
46{
47public:
55 {
61
69
76 UserCurve = 100
77 };
78
85 {
92 ClipPolygons = 0x01,
93
95 ClipSymbol = 0x02
96 };
97
98 Q_DECLARE_FLAGS(PaintAttributes, PaintAttribute)
99
100 // Constructor
101 explicit QwtPlotIntervalCurve(const QString& title = QString());
102
103 // Constructor with QwtText title
104 explicit QwtPlotIntervalCurve(const QwtText& title);
105
106 // Destructor
107 ~QwtPlotIntervalCurve() override;
108
109 // Get the runtime type information
110 virtual int rtti() const override;
111
112 // Attach the interval curve to a plot (applies color cycle if pen not user-set)
113 void attach(QwtPlot* plot) override;
114
115 // Set paint attribute
116 void setPaintAttribute(PaintAttribute, bool on = true);
117
118 // Test paint attribute
119 bool testPaintAttribute(PaintAttribute) const;
120
121 // Set samples from a vector
122 void setSamples(const QVector< QwtIntervalSample >&);
123
124 // Set samples from a series data
125 void setSamples(QwtSeriesData< QwtIntervalSample >*);
126
127 // Set pen with color, width and style
128 void setPen(const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine);
129
130 // Set pen
131 void setPen(const QPen&);
132
133 // Get pen
134 const QPen& pen() const;
135
136 // Set brush
137 void setBrush(const QBrush&);
138
139 // Get brush
140 const QBrush& brush() const;
141
142 // Set curve style
143 void setStyle(CurveStyle style);
144
145 // Get curve style
146 CurveStyle style() const;
147
148 // Set symbol
149 void setSymbol(const QwtIntervalSymbol*);
150
151 // Get symbol
152 const QwtIntervalSymbol* symbol() const;
153
154 // Draw the series
155 virtual void drawSeries(QPainter*,
156 const QwtScaleMap& xMap,
157 const QwtScaleMap& yMap,
158 const QRectF& canvasRect,
159 int from,
160 int to) const override;
161
162 // Get the bounding rectangle
163 virtual QRectF boundingRect() const override;
164
165 // Get the legend icon
166 virtual QwtGraphic legendIcon(int index, const QSizeF&) const override;
167
168protected:
172 void init();
173
177 virtual void
178 drawTube(QPainter*, const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QRectF& canvasRect, int from, int to) const;
179
183 virtual void drawSymbols(QPainter*,
184 const QwtIntervalSymbol&,
185 const QwtScaleMap& xMap,
186 const QwtScaleMap& yMap,
187 const QRectF& canvasRect,
188 int from,
189 int to) const;
190
191private:
192 QWT_DECLARE_PRIVATE(QwtPlotIntervalCurve)
193};
194
195Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPlotIntervalCurve::PaintAttributes)
196
197#endif
A paint device for scalable graphics
Definition qwt_graphic.h:85
A drawing primitive for displaying an interval like an error bar
Definition qwt_interval_symbol.h:44
QwtPlotIntervalCurve represents a series of samples, where each value is associated with an interval ...
Definition qwt_plot_intervalcurve.h:46
PaintAttribute
Attributes to modify the drawing algorithm
Definition qwt_plot_intervalcurve.h:85
CurveStyle
Curve styles
Definition qwt_plot_intervalcurve.h:55
@ NoCurve
Definition qwt_plot_intervalcurve.h:60
@ Tube
Definition qwt_plot_intervalcurve.h:68
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
Return a legend icon
Definition qwt_plot_item.cpp:420
virtual int rtti() const
Runtime type information
Definition qwt_plot_item.cpp:155
virtual void attach(QwtPlot *plot)
Attach the item to a plot
Definition qwt_plot_item.cpp:118
Base class for plot items representing a series of samples
Definition qwt_plot_seriesitem.h:44
virtual QRectF boundingRect() const override
Get the bounding rectangle
Definition qwt_plot_seriesitem.cpp:114
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
Draw a subset of the samples
A 2-D plotting widget
Definition qwt_plot.h:99
A scale map
Definition qwt_scale_map.h:44
Abstract interface for iterating over samples
Definition qwt_series_data.h:88
Class storing a QwtSeriesData object
Definition qwt_series_store.h:91
A class representing a text
Definition qwt_text.h:70