-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShape.hpp
54 lines (42 loc) · 913 Bytes
/
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
53
54
#ifndef _SHAPE_HPP
#define _SHAPE_HPP
/** @file */
/**
* @addtogroup demos_iShapes
*/
/** @{*/
#include <QtCore/QRect>
#include <QtGui/QPen>
#include <QtGui/QBrush>
namespace demo { namespace ishapes {
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);
public:
typedef ::std::shared_ptr<Shape> ref_type; // added
private:
Shape(const Shape&);
Shape& operator=(const Shape&);
protected:
QRect bounds_;
QPen pen_;
QBrush brush_;
bool targeted_;
};
}
}
/** @}*/
#endif /* _SHAPE_HPP */