| 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_INTERVAL_SYMBOL_H
|
|---|
| 11 | #define QWT_INTERVAL_SYMBOL_H
|
|---|
| 12 |
|
|---|
| 13 | #include "qwt_global.h"
|
|---|
| 14 | #include <qpen.h>
|
|---|
| 15 | #include <qsize.h>
|
|---|
| 16 |
|
|---|
| 17 | class QPainter;
|
|---|
| 18 | class QRect;
|
|---|
| 19 | class QPointF;
|
|---|
| 20 |
|
|---|
| 21 | /*!
|
|---|
| 22 | \brief A drawing primitive for displaying an interval like an error bar
|
|---|
| 23 |
|
|---|
| 24 | \sa QwtPlotIntervalCurve
|
|---|
| 25 | */
|
|---|
| 26 | class QWT_EXPORT QwtIntervalSymbol
|
|---|
| 27 | {
|
|---|
| 28 | public:
|
|---|
| 29 | //! Symbol style
|
|---|
| 30 | enum Style
|
|---|
| 31 | {
|
|---|
| 32 | //! No Style. The symbol cannot be drawn.
|
|---|
| 33 | NoSymbol = -1,
|
|---|
| 34 |
|
|---|
| 35 | /*!
|
|---|
| 36 | The symbol displays a line with caps at the beginning/end.
|
|---|
| 37 | The size of the caps depends on the symbol width().
|
|---|
| 38 | */
|
|---|
| 39 | Bar,
|
|---|
| 40 |
|
|---|
| 41 | /*!
|
|---|
| 42 | The symbol displays a plain rectangle using pen() and brush().
|
|---|
| 43 | The size of the rectangle depends on the translated interval and
|
|---|
| 44 | the width(),
|
|---|
| 45 | */
|
|---|
| 46 | Box,
|
|---|
| 47 |
|
|---|
| 48 | /*!
|
|---|
| 49 | Styles >= UserSymbol are reserved for derived
|
|---|
| 50 | classes of QwtIntervalSymbol that overload draw() with
|
|---|
| 51 | additional application specific symbol types.
|
|---|
| 52 | */
|
|---|
| 53 | UserSymbol = 1000
|
|---|
| 54 | };
|
|---|
| 55 |
|
|---|
| 56 | public:
|
|---|
| 57 | QwtIntervalSymbol( Style = NoSymbol );
|
|---|
| 58 | QwtIntervalSymbol( const QwtIntervalSymbol & );
|
|---|
| 59 | virtual ~QwtIntervalSymbol();
|
|---|
| 60 |
|
|---|
| 61 | QwtIntervalSymbol &operator=( const QwtIntervalSymbol & );
|
|---|
| 62 | bool operator==( const QwtIntervalSymbol & ) const;
|
|---|
| 63 | bool operator!=( const QwtIntervalSymbol & ) const;
|
|---|
| 64 |
|
|---|
| 65 | void setWidth( int );
|
|---|
| 66 | int width() const;
|
|---|
| 67 |
|
|---|
| 68 | void setBrush( const QBrush & );
|
|---|
| 69 | const QBrush& brush() const;
|
|---|
| 70 |
|
|---|
| 71 | void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
|
|---|
| 72 | void setPen( const QPen & );
|
|---|
| 73 | const QPen& pen() const;
|
|---|
| 74 |
|
|---|
| 75 | void setStyle( Style );
|
|---|
| 76 | Style style() const;
|
|---|
| 77 |
|
|---|
| 78 | virtual void draw( QPainter *, Qt::Orientation,
|
|---|
| 79 | const QPointF& from, const QPointF& to ) const;
|
|---|
| 80 |
|
|---|
| 81 | private:
|
|---|
| 82 | class PrivateData;
|
|---|
| 83 | PrivateData* d_data;
|
|---|
| 84 | };
|
|---|
| 85 |
|
|---|
| 86 | #endif
|
|---|