Qwt User's Guide: qwt_symbol.h Source File

- Main Page
- Related Pages
- Classes
- Files

- File List

# 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
    00018 class QPainter;
    00019 class QRect;
    00020
    00022 class QWT_EXPORT QwtSymbol
    00023 {
    00024 public:
    00029     enum Style
    00030     {
    00031         NoSymbol = -1,
    00032
    00033         Ellipse,
    00034         Rect,
    00035         Diamond,
    00036         Triangle,
    00037         DTriangle,
    00038         UTriangle,
    00039         LTriangle,
    00040         RTriangle,
    00041         Cross,
    00042         XCross,
    00043         HLine,
    00044         VLine,
    00045         Star1,
    00046         Star2,
    00047         Hexagon,
    00048
    00049         StyleCnt
    00050     };
    00051
    00052 public:
    00053     QwtSymbol();
    00054     QwtSymbol(Style st, const QBrush &bd, const QPen &pn, const QSize &s);
    00055     virtual ~QwtSymbol();
    00056
    00057     bool operator!=(const QwtSymbol &) const;
    00058     virtual bool operator==(const QwtSymbol &) const;
    00059
    00060     virtual QwtSymbol *clone() const;
    00061
    00062     void setSize(const QSize &s);
    00063     void setSize(int a, int b = -1);
    00064     void setBrush(const QBrush& b);
    00065     void setPen(const QPen &p);
    00066     void setStyle (Style s);
    00067
    00069     const QBrush& brush() const { return d_brush; }
    00071     const QPen& pen() const { return d_pen; }
    00073     const QSize& size() const { return d_size; }
    00075     Style style() const { return d_style; }
    00076
    00077     void draw(QPainter *p, const QPoint &pt) const;
    00078     void draw(QPainter *p, int x, int y) const;
    00079     virtual void draw(QPainter *p, const QRect &r) const;
    00080
    00081 private:
    00082     QBrush d_brush;
    00083     QPen d_pen;
    00084     QSize d_size;
    00085     Style d_style;
    00086 };
    00087
    00088 #endif