QWT 7.0.1
Loading...
Searching...
No Matches
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
44class QWT_EXPORT QwtPlotIntervalCurve
45 : public QwtPlotSeriesItem
46 , public QwtSeriesStore< QwtIntervalSample >
47{
48 public:
56 {
61
68
74 UserCurve = 100
75 };
76
82 {
88 ClipPolygons = 0x01,
89
91 ClipSymbol = 0x02
92 };
93
94 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
95
96 explicit QwtPlotIntervalCurve( const QString& title = QString() );
97 explicit QwtPlotIntervalCurve( const QwtText& title );
98
99 virtual ~QwtPlotIntervalCurve();
100
101 virtual int rtti() const QWT_OVERRIDE;
102
103 void setPaintAttribute( PaintAttribute, bool on = true );
104 bool testPaintAttribute( PaintAttribute ) const;
105
106 void setSamples( const QVector< QwtIntervalSample >& );
107 void setSamples( QwtSeriesData< QwtIntervalSample >* );
108
109 void setPen( const QColor&,
110 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
111
112 void setPen( const QPen& );
113 const QPen& pen() const;
114
115 void setBrush( const QBrush& );
116 const QBrush& brush() const;
117
118 void setStyle( CurveStyle style );
119 CurveStyle style() const;
120
121 void setSymbol( const QwtIntervalSymbol* );
122 const QwtIntervalSymbol* symbol() const;
123
124 virtual void drawSeries( QPainter*,
125 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
126 const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
127
128 virtual QRectF boundingRect() const QWT_OVERRIDE;
129
130 virtual QwtGraphic legendIcon(
131 int index, const QSizeF& ) const QWT_OVERRIDE;
132
133 protected:
134
135 void init();
136
137 virtual void drawTube( QPainter*,
138 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
139 const QRectF& canvasRect, int from, int to ) const;
140
141 virtual void drawSymbols( QPainter*, const QwtIntervalSymbol&,
142 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
143 const QRectF& canvasRect, int from, int to ) const;
144
145 private:
146 class PrivateData;
147 PrivateData* m_data;
148};
149
150Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotIntervalCurve::PaintAttributes )
151
152#endif
Definition qwt_clipper.h:40
A paint device for scalable graphics.
Definition qwt_graphic.h:93
A sample of the types (x1-x2, y) or (x, y1-y2)
Definition qwt_samples.h:38
A drawing primitive for displaying an interval like an error bar.
Definition qwt_interval_symbol.h:45
QwtPlotIntervalCurve represents a series of samples, where each value is associated with an interval ...
Definition qwt_plot_intervalcurve.h:47
PaintAttribute
Attributes to modify the drawing algorithm.
Definition qwt_plot_intervalcurve.h:82
CurveStyle
Curve styles.
Definition qwt_plot_intervalcurve.h:56
@ NoCurve
Don't draw a curve.
Definition qwt_plot_intervalcurve.h:60
@ Tube
Build 2 curves from the upper and lower limits of the intervals and draw them with the pen().
Definition qwt_plot_intervalcurve.h:67
virtual int rtti() const
Return rtti for the specific class represented.
Definition qwt_plot_item.cpp:153
Base class for plot items representing a series of samples.
Definition qwt_plot_seriesitem.h:43
A scale map.
Definition qwt_scale_map.h:44
Abstract interface for iterating over samples.
Definition qwt_series_data.h:67
Class storing a QwtSeriesData object.
Definition qwt_series_store.h:96
A class representing a text.
Definition qwt_text.h:69