Qwt User's Guide
|
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_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 *p, 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 drawLabel( QPainter *, 00122 const QRectF &, const QPointF & ) const; 00123 00124 private: 00125 00126 class PrivateData; 00127 PrivateData *d_data; 00128 }; 00129 00130 #endif