Qwt User's Guide 6.3.0

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
10#ifndef QWT_PLOT_INTERVAL_CURVE_H
11#define QWT_PLOT_INTERVAL_CURVE_H
12
13#include "qwt_global.h"
14#include "qwt_plot_seriesitem.h"
15
16 class QwtIntervalSymbol;
17 template< typename T > class QwtSeriesData;
18
27 class QWT_EXPORT QwtPlotIntervalCurve
28 : public QwtPlotSeriesItem
29 , public QwtSeriesStore< QwtIntervalSample >
30{
31 public:
38 enum CurveStyle
39 {
43 NoCurve,
44
50 Tube,
51
57 UserCurve = 100
58 };
59
64 enum PaintAttribute
65 {
71 ClipPolygons = 0x01,
72
74 ClipSymbol = 0x02,
75
95 TubeAsLines = 0x10
96 };
97
98 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
99
100 explicit QwtPlotIntervalCurve( const QString& title = QString() );
101 explicit QwtPlotIntervalCurve( const QwtText& title );
102
103 virtual ~QwtPlotIntervalCurve();
104
105 virtual int rtti() const QWT_OVERRIDE;
106
107 void setPaintAttribute( PaintAttribute, bool on = true );
108 bool testPaintAttribute( PaintAttribute ) const;
109
110 void setSamples( const QVector< QwtIntervalSample >& );
111 void setSamples( QwtSeriesData< QwtIntervalSample >* );
112
113 void setPen( const QColor&,
114 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
115
116 void setPen( const QPen& );
117 const QPen& pen() const;
118
119 void setBrush( const QBrush& );
120 const QBrush& brush() const;
121
122 void setStyle( CurveStyle style );
123 CurveStyle style() const;
124
125 void setSymbol( const QwtIntervalSymbol* );
126 const QwtIntervalSymbol* symbol() const;
127
128 virtual void drawSeries( QPainter*,
129 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
130 const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE;
131
132 virtual QRectF boundingRect() const QWT_OVERRIDE;
133
134 virtual QwtGraphic legendIcon(
135 int index, const QSizeF& ) const QWT_OVERRIDE;
136
137 protected:
138
139 void init();
140
141 virtual void drawTube( QPainter*,
142 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
143 const QRectF& canvasRect, int from, int to ) const;
144
145 virtual void drawSymbols( QPainter*, const QwtIntervalSymbol&,
146 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
147 const QRectF& canvasRect, int from, int to ) const;
148
149 private:
150 class PrivateData;
151 PrivateData* m_data;
152};
153
154Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotIntervalCurve::PaintAttributes )
155
156#endif
QVector
Definition qwt_clipper.h:23
QwtGraphic
A paint device for scalable graphics.
Definition qwt_graphic.h:76
QwtIntervalSample
A sample of the types (x1-x2, y) or (x, y1-y2)
Definition qwt_samples.h:21
QwtIntervalSymbol
A drawing primitive for displaying an interval like an error bar.
Definition qwt_interval_symbol.h:28
QwtPlotIntervalCurve
QwtPlotIntervalCurve represents a series of samples, where each value is associated with an interval ...
Definition qwt_plot_intervalcurve.h:30
QwtPlotIntervalCurve::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Definition qwt_plot_intervalcurve.h:98
QwtPlotIntervalCurve::PaintAttribute
PaintAttribute
Definition qwt_plot_intervalcurve.h:65
QwtPlotIntervalCurve::CurveStyle
CurveStyle
Curve styles. The default setting is QwtPlotIntervalCurve::Tube.
Definition qwt_plot_intervalcurve.h:39
QwtPlotIntervalCurve::NoCurve
@ NoCurve
Definition qwt_plot_intervalcurve.h:43
QwtPlotIntervalCurve::Tube
@ Tube
Definition qwt_plot_intervalcurve.h:50
QwtPlotItem::rtti
virtual int rtti() const
Definition qwt_plot_item.cpp:136
QwtPlotSeriesItem
Base class for plot items representing a series of samples.
Definition qwt_plot_seriesitem.h:26
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtSeriesData
Abstract interface for iterating over samples.
Definition qwt_series_data.h:50
QwtSeriesStore
Class storing a QwtSeriesData object.
Definition qwt_series_store.h:67
QwtText
A class representing a text.
Definition qwt_text.h:52