Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

qwt_symbol.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_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

Generated on Sun Nov 21 11:12:44 2004 for Qwt User's Guide by doxygen 1.3.5