]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlineangle.h
Sanity check stage II: rename classes...
[architektonas] / src / actions / actiondrawlineangle.h
1 #ifndef __ACTIONDRAWLINEANGLE_H__
2 #define __ACTIONDRAWLINEANGLE_H__
3
4 #include "rs_line.h"
5 #include "actioninterface.h"
6 #include "vector.h"
7
8 /**
9  * This action class can handle user events to draw simple lines at a given
10  * angle.
11  *
12  * @author James Hammons
13  * @author Andrew Mustun
14  */
15 class ActionDrawLineAngle: public ActionInterface
16 {
17         public:
18                 /**
19                  * Action States.
20                  */
21                 enum Status {
22                         SetPos,       /**< Setting the position.  */
23                         SetAngle,     /**< Setting angle in the command line. */
24                         SetLength     /**< Setting length in the command line. */
25                 };
26
27                 ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false);
28                 ~ActionDrawLineAngle();
29
30                 virtual RS2::ActionType rtti();
31                 void reset();
32                 virtual void init(int status = 0);
33                 virtual void trigger();
34                 virtual void mouseMoveEvent(QMouseEvent * e);
35                 virtual void mouseReleaseEvent(QMouseEvent * e);
36                 void preparePreview();
37                 virtual void coordinateEvent(Vector * e);
38                 virtual void commandEvent(RS_CommandEvent * e);
39                 virtual QStringList getAvailableCommands();
40                 virtual void hideOptions();
41                 virtual void showOptions();
42                 virtual void updateMouseButtonHints();
43                 virtual void updateMouseCursor();
44                 virtual void updateToolBar();
45                 void setSnapPoint(int sp);
46                 int getSnapPoint();
47                 void setAngle(double a);
48                 double getAngle();
49                 void setLength(double l);
50                 double getLength();
51                 bool hasFixedAngle();
52
53         protected:
54                 /**
55                  * Line data defined so far.
56                  */
57                 RS_LineData data;
58                 /**
59                  * Position.
60                  */
61                 Vector pos;
62                 /**
63                  * Line angle.
64                  */
65                 double angle;
66                 /**
67                  * Line length.
68                  */
69                 double length;
70                 /**
71                  * Is the angle fixed?
72                  */
73                 bool fixedAngle;
74                 /**
75                  * Snap point (start, middle, end).
76                  */
77                 int snpPoint;
78 };
79
80 #endif  // __ACTIONDRAWLINEANGLE_H__