]> Shamusworld >> Repos - architektonas/blob - src/base/leader.h
Fixed problem with MDI activation.
[architektonas] / src / base / leader.h
1 #ifndef __LEADER_H__
2 #define __LEADER_H__
3
4 #include "entity.h"
5 #include "entitycontainer.h"
6
7 /**
8  * Holds the data that defines a leader.
9  */
10 class LeaderData
11 {
12         public:
13                 LeaderData() {}
14                 LeaderData(bool arrowHeadFlag)
15                 {
16                         arrowHead = arrowHeadFlag;
17                 }
18
19                 friend std::ostream & operator<<(std::ostream & os, const LeaderData & /*ld*/)
20                 {
21                         os << "(Leader)";
22                         return os;
23                 }
24
25                 /** true: leader has an arrow head. false: no arrow. */
26                 bool arrowHead;
27 };
28
29 /**
30  * Class for a leader entity (kind of a polyline arrow).
31  *
32  * @author Andrew Mustun
33  */
34 class Leader: public EntityContainer
35 {
36         public:
37                 Leader(EntityContainer * parent = NULL);
38                 Leader(EntityContainer * parent, const LeaderData & d);
39                 virtual ~Leader();
40
41                 virtual Entity * clone();
42                 virtual RS2::EntityType rtti() const;
43                 virtual void update();
44                 LeaderData getData() const;
45                 bool hasArrowHead();
46                 virtual Entity * addVertex(const Vector & v);
47                 virtual void addEntity(Entity * entity);
48                 virtual double getLength();
49                 virtual void move(Vector offset);
50                 virtual void rotate(Vector center, double angle);
51                 virtual void scale(Vector center, Vector factor);
52                 virtual void mirror(Vector axisPoint1, Vector axisPoint2);
53                 virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset);
54
55                 friend std::ostream & operator<<(std::ostream & os, const Leader & l);
56
57         protected:
58                 LeaderData data;
59                 bool empty;
60 };
61
62 #endif