]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlineparallelthrough.h
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actiondrawlineparallelthrough.h
1 #ifndef __ACTIONDRAWLINEPARALLELTHROUGH_H__
2 #define __ACTIONDRAWLINEPARALLELTHROUGH_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 parallel lines, arcs and
12  * circles.
13  *
14  * @author James Hammons
15  * @author Andrew Mustun
16  */
17 class ActionDrawLineParallelThrough: public ActionInterface
18 {
19         private:
20                 enum Status {
21                         SetEntity,    /**< Choose original entity. */
22                         SetPos,       /**< Setting point for this parallel to go through. */
23                         SetNumber     /**< Setting number in the command line. */
24                 };
25
26         public:
27                 ActionDrawLineParallelThrough(EntityContainer & container, GraphicView & graphicView);
28                 ~ActionDrawLineParallelThrough();
29
30                 virtual RS2::ActionType rtti();
31                 virtual void trigger();
32                 virtual void mouseMoveEvent(QMouseEvent * e);
33                 virtual void mouseReleaseEvent(QMouseEvent * e);
34                 virtual void updateMouseButtonHints();
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 updateMouseCursor();
41                 virtual void updateToolBar();
42                 int getNumber();
43                 void setNumber(int n);
44
45         private:
46                 /** Closest parallel. */
47                 Entity * parallel;
48                 /** Data of new line */
49                 LineData data;
50                 /** Number of parallels. */
51                 int number;
52                 /** Coordinate of the mouse. */
53                 Vector coord;
54                 /** Original entity. */
55                 Entity * entity;
56                 /** Last status before entering length or number. */
57                 Status lastStatus;
58 };
59
60 #endif  // __ACTIONDRAWLINEPARALLELTHROUGH_H__