00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_SYMBOL_H
00011 #define QWT_SYMBOL_H
00012
00013 #include <qbrush.h>
00014 #include <qpen.h>
00015 #include <qsize.h>
00016 #include "qwt_global.h"
00017 #include "qwt.h"
00018
00019 class QPainter;
00020
00022 class QWT_EXPORT QwtSymbol
00023 {
00024 public:
00029 enum Style { None, Ellipse, Rect, Diamond, Triangle, DTriangle,
00030 UTriangle, LTriangle, RTriangle, Cross, XCross, StyleCnt };
00031
00032 public:
00033 QwtSymbol();
00034 QwtSymbol(Style st, const QBrush &bd, const QPen &pn, const QSize &s);
00035 virtual ~QwtSymbol();
00036
00037 bool operator!=(const QwtSymbol &) const;
00038 bool operator==(const QwtSymbol &) const;
00039
00040 void setSize(const QSize &s);
00041 void setSize(int a, int b = -1);
00042 void setBrush(const QBrush& b);
00043 void setPen(const QPen &p);
00044 void setStyle (Style s);
00045
00047 const QBrush& brush() const { return d_brush; }
00049 const QPen& pen() const { return d_pen; }
00051 const QSize& size() const { return d_size; }
00053 Style style() const { return d_style; }
00054
00055 void draw(QPainter *p, const QPoint &pt) const;
00056 void draw(QPainter *p, int x, int y) const;
00057 virtual void draw(QPainter *p, const QRect &r) const;
00058
00059 private:
00060 QBrush d_brush;
00061 QPen d_pen;
00062 QSize d_size;
00063 Style d_style;
00064 };
00065
00066 #endif