Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PLOT_MARKER_H
00011 #define QWT_PLOT_MARKER_H
00012
00013 #include <qpen.h>
00014 #include <qfont.h>
00015 #include <qstring.h>
00016 #include <qbrush.h>
00017 #include "qwt_global.h"
00018 #include "qwt_plot_item.h"
00019
00020 class QRectF;
00021 class QwtText;
00022 class QwtSymbol;
00023
00048 class QWT_EXPORT QwtPlotMarker: public QwtPlotItem
00049 {
00050 public:
00051
00056 enum LineStyle
00057 {
00059 NoLine,
00060
00062 HLine,
00063
00065 VLine,
00066
00068 Cross
00069 };
00070
00071 explicit QwtPlotMarker( const QString &title = QString::null );
00072 explicit QwtPlotMarker( const QwtText &title );
00073
00074 virtual ~QwtPlotMarker();
00075
00076 virtual int rtti() const;
00077
00078 double xValue() const;
00079 double yValue() const;
00080 QPointF value() const;
00081
00082 void setXValue( double );
00083 void setYValue( double );
00084 void setValue( double, double );
00085 void setValue( const QPointF & );
00086
00087 void setLineStyle( LineStyle st );
00088 LineStyle lineStyle() const;
00089
00090 void setLinePen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
00091 void setLinePen( const QPen &p );
00092 const QPen &linePen() const;
00093
00094 void setSymbol( const QwtSymbol * );
00095 const QwtSymbol *symbol() const;
00096
00097 void setLabel( const QwtText& );
00098 QwtText label() const;
00099
00100 void setLabelAlignment( Qt::Alignment );
00101 Qt::Alignment labelAlignment() const;
00102
00103 void setLabelOrientation( Qt::Orientation );
00104 Qt::Orientation labelOrientation() const;
00105
00106 void setSpacing( int );
00107 int spacing() const;
00108
00109 virtual void draw( QPainter *,
00110 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00111 const QRectF & ) const;
00112
00113 virtual QRectF boundingRect() const;
00114
00115 virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
00116
00117 protected:
00118 virtual void drawLines( QPainter *,
00119 const QRectF &, const QPointF & ) const;
00120
00121 virtual void drawSymbol( QPainter *,
00122 const QRectF &, const QPointF & ) const;
00123
00124 virtual void drawLabel( QPainter *,
00125 const QRectF &, const QPointF & ) const;
00126
00127 private:
00128
00129 class PrivateData;
00130 PrivateData *d_data;
00131 };
00132
00133 #endif