]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlineangle.h
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actiondrawlineangle.h
1 #ifndef __ACTIONDRAWLINEANGLE_H__
2 #define __ACTIONDRAWLINEANGLE_H__
3
4 #include "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(EntityContainer & container, GraphicView & graphicView,
28                         double angle = 0.0, bool fixedAngle = false);
29                 ~ActionDrawLineAngle();
30
31                 virtual RS2::ActionType rtti();
32                 void reset();
33                 virtual void init(int status = 0);
34                 virtual void trigger();
35                 virtual void mouseMoveEvent(QMouseEvent * e);
36                 virtual void mouseReleaseEvent(QMouseEvent * e);
37                 void preparePreview();
38                 virtual void coordinateEvent(Vector * e);
39                 virtual void commandEvent(CommandEvent * e);
40                 virtual QStringList getAvailableCommands();
41                 virtual void hideOptions();
42                 virtual void showOptions();
43                 virtual void updateMouseButtonHints();
44                 virtual void updateMouseCursor();
45                 virtual void updateToolBar();
46                 void setSnapPoint(int sp);
47                 int getSnapPoint();
48                 void setAngle(double a);
49                 double getAngle();
50                 void setLength(double l);
51                 double getLength();
52                 bool hasFixedAngle();
53
54         protected:
55                 /** Line data defined so far. */
56                 LineData data;
57                 /** Position. */
58                 Vector pos;
59                 /** Line angle. */
60                 double angle;
61                 /** Line length. */
62                 double length;
63                 /** Is the angle fixed? */
64                 bool fixedAngle;
65                 /** Snap point (start, middle, end). */
66                 int snpPoint;
67 };
68
69 #endif  // __ACTIONDRAWLINEANGLE_H__