]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlinerelangle.h
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actiondrawlinerelangle.h
1 #ifndef __ACTIONDRAWLINERELANGLE_H__
2 #define __ACTIONDRAWLINERELANGLE_H__
3
4 #include "line.h"
5 #include "actioninterface.h"
6 #include "vector.h"
7
8 class Entity;
9
10 /**
11  * This action class can handle user events to draw lines with a given angle
12  * to a given entity.
13  *
14  * @author James Hammons
15  * @author Andrew Mustun
16  */
17 class ActionDrawLineRelAngle: public ActionInterface
18 {
19         private:
20                 enum Status {
21                         SetEntity,     /**< Choose entity. */
22                         SetPos,        /**< Choose position. */
23                         SetAngle,      /**< Set angle in console. */
24                         SetLength      /**< Set length in console. */
25                 };
26
27         public:
28                 ActionDrawLineRelAngle(EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false);
29                 ~ActionDrawLineRelAngle();
30
31                 virtual RS2::ActionType rtti();
32                 virtual void trigger();
33                 virtual void mouseMoveEvent(QMouseEvent * e);
34                 virtual void mouseReleaseEvent(QMouseEvent * e);
35                 virtual void coordinateEvent(Vector * e);
36                 virtual void commandEvent(CommandEvent * e);
37                 virtual QStringList getAvailableCommands();
38                 virtual void hideOptions();
39                 virtual void showOptions();
40                 virtual void updateMouseButtonHints();
41                 virtual void updateMouseCursor();
42                 virtual void updateToolBar();
43                 void setAngle(double a);
44                 double getAngle();
45                 void setLength(double l);
46                 double getLength();
47                 bool hasFixedAngle();
48
49         private:
50                 /** Chosen entity */
51                 Entity * entity;
52                 /** Chosen position */
53                 Vector pos;
54                 /** Data of new line */
55                 LineData data;
56                 /**
57                  * Line angle.
58                  */
59                 double angle;
60                 /**
61                  * Line length.
62                  */
63                 double length;
64                 /**
65                  * Is the angle fixed?
66                  */
67                 bool fixedAngle;
68 };
69
70 #endif  // __ACTIONDRAWLINERELANGLE_H__