forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShape.hpp
52 lines (41 loc) · 1.01 KB
/
Shape.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _SHAPE_HPP
#define _SHAPE_HPP
// Tell GCC to ignore implicitly declared copy methods as long as
// Qt is not compliant.
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include <QtCore/QRect>
#include <QtGui/QPen>
#include <QtGui/QBrush>
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif
#include "ace/config-all.h"
#include <memory>
class Shape {
public:
Shape(const QRect& bounds,
const QPen& pen,
const QBrush& brush,
bool targeted = false);
virtual ~Shape();
public:
virtual void update() = 0;
virtual void paint(QPainter& painter) = 0;
public:
virtual void setPen(const QPen& pen);
virtual void setBrush(const QBrush& brush);
virtual void setBounds(const QRect& bounds);
virtual void set_targeted(bool b);
private:
Shape(const Shape&);
Shape& operator=(const Shape&);
protected:
QRect bounds_;
QPen pen_;
QBrush brush_;
bool targeted_;
};
#endif /* _SHAPE_HPP */