]> Shamusworld >> Repos - architektonas/blob - src/base/rs_leader.h
Final round of dialogs/forms needing to be converted from Qt3 to 4
[architektonas] / src / base / rs_leader.h
1 #ifndef RS_LEADER_H
2 #define RS_LEADER_H
3
4 #include "rs_entity.h"
5 #include "rs_entitycontainer.h"
6
7 /**
8  * Holds the data that defines a leader.
9  */
10 class RS_LeaderData
11 {
12         public:
13                 RS_LeaderData() {}
14                 RS_LeaderData(bool arrowHeadFlag)
15                 {
16                         arrowHead = arrowHeadFlag;
17                 }
18
19                 friend std::ostream & operator<<(std::ostream & os, const RS_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 RS_Leader: public RS_EntityContainer
35 {
36         public:
37                 RS_Leader(RS_EntityContainer * parent = NULL);
38                 RS_Leader(RS_EntityContainer * parent, const RS_LeaderData & d);
39                 virtual ~RS_Leader();
40
41                 virtual RS_Entity * clone();
42                 virtual RS2::EntityType rtti() const;
43                 virtual void update();
44                 RS_LeaderData getData() const;
45                 bool hasArrowHead();
46                 virtual RS_Entity * addVertex(const Vector & v);
47                 virtual void addEntity(RS_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 RS_Leader & l);
56
57         protected:
58                 RS_LeaderData data;
59                 bool empty;
60 };
61
62 #endif