Qwt User's Guide  6.0.2
qwt_plot_intervalcurve.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
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 #include "qwt_series_data.h"
16 
17 class QwtIntervalSymbol;
18 
28 class QWT_EXPORT QwtPlotIntervalCurve: public QwtPlotSeriesItem<QwtIntervalSample>
29 {
30 public:
39  {
44 
51 
57  UserCurve = 100
58  };
59 
65  {
71  ClipPolygons = 0x01,
72 
74  ClipSymbol = 0x02
75  };
76 
78  typedef QFlags<PaintAttribute> PaintAttributes;
79 
80  explicit QwtPlotIntervalCurve( const QString &title = QString::null );
81  explicit QwtPlotIntervalCurve( const QwtText &title );
82 
83  virtual ~QwtPlotIntervalCurve();
84 
85  virtual int rtti() const;
86 
87  void setPaintAttribute( PaintAttribute, bool on = true );
88  bool testPaintAttribute( PaintAttribute ) const;
89 
90  void setSamples( const QVector<QwtIntervalSample> & );
91 
92  void setPen( const QPen & );
93  const QPen &pen() const;
94 
95  void setBrush( const QBrush & );
96  const QBrush &brush() const;
97 
98  void setStyle( CurveStyle style );
99  CurveStyle style() const;
100 
101  void setSymbol( const QwtIntervalSymbol * );
102  const QwtIntervalSymbol *symbol() const;
103 
104  virtual void drawSeries( QPainter *p,
105  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
106  const QRectF &canvasRect, int from, int to ) const;
107 
108  virtual QRectF boundingRect() const;
109  virtual void drawLegendIdentifier( QPainter *, const QRectF & ) const;
110 
111 protected:
112 
113  void init();
114 
115  virtual void drawTube( QPainter *,
116  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
117  const QRectF &canvasRect, int from, int to ) const;
118 
119  virtual void drawSymbols( QPainter *, const QwtIntervalSymbol &,
120  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
121  const QRectF &canvasRect, int from, int to ) const;
122 
123 private:
124  class PrivateData;
125  PrivateData *d_data;
126 };
127 
128 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotIntervalCurve::PaintAttributes )
129 
130 #endif