# qwt_plot_intervalcurve.h

    00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
    00002  * Qwt Widget Library
    00003  * Copyright (C) 1997   Josef Wilgen
    00004  * Copyright (C) 2002   Uwe Rathmann
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the Qwt License, Version 1.0
    00008  *****************************************************************************/
    00009
    00010 #ifndef QWT_PLOT_INTERVAL_CURVE_H
    00011 #define QWT_PLOT_INTERVAL_CURVE_H
    00012
    00013 #include "qwt_global.h"
    00014 #include "qwt_plot_seriesitem.h"
    00015 #include "qwt_series_data.h"
    00016
    00017 class QwtIntervalSymbol;
    00018
    00028 class QWT_EXPORT QwtPlotIntervalCurve: public QwtPlotSeriesItem<QwtIntervalSample>
    00029 {
    00030 public:
    00038     enum CurveStyle
    00039     {
    00043         NoCurve,
    00044
    00050         Tube,
    00051
    00057         UserCurve = 100
    00058     };
    00059
    00064     enum PaintAttribute
    00065     {
    00071         ClipPolygons = 0x01,
    00072
    00074         ClipSymbol   = 0x02
    00075     };
    00076
    00078     typedef QFlags<PaintAttribute> PaintAttributes;
    00079
    00080     explicit QwtPlotIntervalCurve( const QString &title = QString::null );
    00081     explicit QwtPlotIntervalCurve( const QwtText &title );
    00082
    00083     virtual ~QwtPlotIntervalCurve();
    00084
    00085     virtual int rtti() const;
    00086
    00087     void setPaintAttribute( PaintAttribute, bool on = true );
    00088     bool testPaintAttribute( PaintAttribute ) const;
    00089
    00090     void setSamples( const QVector<QwtIntervalSample> & );
    00091
    00092     void setPen( const QPen & );
    00093     const QPen &pen() const;
    00094
    00095     void setBrush( const QBrush & );
    00096     const QBrush &brush() const;
    00097
    00098     void setStyle( CurveStyle style );
    00099     CurveStyle style() const;
    00100
    00101     void setSymbol( const QwtIntervalSymbol * );
    00102     const QwtIntervalSymbol *symbol() const;
    00103
    00104     virtual void drawSeries( QPainter *p,
    00105         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    00106         const QRectF &canvasRect, int from, int to ) const;
    00107
    00108     virtual QRectF boundingRect() const;
    00109     virtual void drawLegendIdentifier( QPainter *, const QRectF & ) const;
    00110
    00111 protected:
    00112
    00113     void init();
    00114
    00115     virtual void drawTube( QPainter *,
    00116         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    00117         const QRectF &canvasRect, int from, int to ) const;
    00118
    00119     virtual void drawSymbols( QPainter *, const QwtIntervalSymbol &,
    00120         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    00121         const QRectF &canvasRect, int from, int to ) const;
    00122
    00123 private:
    00124     class PrivateData;
    00125     PrivateData *d_data;
    00126 };
    00127
    00128 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotIntervalCurve::PaintAttributes )
    00129
    00130 #endif