source: pacpusframework/branches/2.0-beta1/include/extlib/qwt-5.2.1/qwt_symbol.h@ 89

Last change on this file since 89 was 89, checked in by morasjul, 11 years ago

PACPUS 2.0 Beta deployed in new branch

Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10#ifndef QWT_SYMBOL_H
11#define QWT_SYMBOL_H
12
13#include <qbrush.h>
14#include <qpen.h>
15#include <qsize.h>
16#include "qwt_global.h"
17
18class QPainter;
19class QRect;
20
21//! A class for drawing symbols
22class QWT_EXPORT QwtSymbol
23{
24public:
25 /*!
26 Style
27 \sa setStyle(), style()
28 */
29 enum Style
30 {
31 NoSymbol = -1,
32
33 Ellipse,
34 Rect,
35 Diamond,
36 Triangle,
37 DTriangle,
38 UTriangle,
39 LTriangle,
40 RTriangle,
41 Cross,
42 XCross,
43 HLine,
44 VLine,
45 Star1,
46 Star2,
47 Hexagon,
48
49 StyleCnt
50 };
51
52public:
53 QwtSymbol();
54 QwtSymbol(Style st, const QBrush &bd, const QPen &pn, const QSize &s);
55 virtual ~QwtSymbol();
56
57 bool operator!=(const QwtSymbol &) const;
58 virtual bool operator==(const QwtSymbol &) const;
59
60 virtual QwtSymbol *clone() const;
61
62 void setSize(const QSize &s);
63 void setSize(int a, int b = -1);
64 void setBrush(const QBrush& b);
65 void setPen(const QPen &p);
66 void setStyle (Style s);
67
68 //! Return Brush
69 const QBrush& brush() const { return d_brush; }
70 //! Return Pen
71 const QPen& pen() const { return d_pen; }
72 //! Return Size
73 const QSize& size() const { return d_size; }
74 //! Return Style
75 Style style() const { return d_style; }
76
77 void draw(QPainter *p, const QPoint &pt) const;
78 void draw(QPainter *p, int x, int y) const;
79 virtual void draw(QPainter *p, const QRect &r) const;
80
81private:
82 QBrush d_brush;
83 QPen d_pen;
84 QSize d_size;
85 Style d_style;
86};
87
88#endif
Note: See TracBrowser for help on using the repository browser.