]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlinebisector.h
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actiondrawlinebisector.h
1 #ifndef __ACTIONDRAWLINEBISECTOR_H__
2 #define __ACTIONDRAWLINEBISECTOR_H__
3
4 #include "line.h"
5 #include "actioninterface.h"
6 #include "vector.h"
7
8 class Line;
9
10 /**
11  * This action class can handle user events to draw bisectors.
12  *
13  * @author James Hammons
14  * @author Andrew Mustun
15  */
16 class ActionDrawLineBisector: public ActionInterface
17 {
18         private:
19                 enum Status {
20                         SetLine1,     /**< Choose the 1st line. */
21                         SetLine2,     /**< Choose the 2nd line. */
22                         SetLength,    /**< Set length in command line. */
23                         SetNumber     /**< Set number in command line. */
24                 };
25
26         public:
27                 ActionDrawLineBisector(EntityContainer & container, GraphicView & graphicView);
28                 ~ActionDrawLineBisector();
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 commandEvent(CommandEvent * e);
35                 virtual QStringList getAvailableCommands();
36                 virtual void hideOptions();
37                 virtual void showOptions();
38                 virtual void updateMouseButtonHints();
39                 virtual void updateMouseCursor();
40                 virtual void updateToolBar();
41                 void setLength(double l);
42                 double getLength();
43                 void setNumber(int n);
44                 int getNumber();
45
46         private:
47                 /** Closest bisector. */
48                 Line * bisector;
49                 /** First chosen entity */
50                 Line * line1;
51                 /** Second chosen entity */
52                 Line * line2;
53                 /** Data of new bisector */
54                 LineData data;
55                 /** Length of the bisector. */
56                 double length;
57                 /** Number of bisectors to create. */
58                 int number;
59                 /** Mouse pos when choosing the 1st line */
60                 Vector coord1;
61                 /** Mouse pos when choosing the 2nd line */
62                 Vector coord2;
63                 /** Last status before entering length or number. */
64                 Status lastStatus;
65 };
66
67 #endif  // __ACTIONDRAWLINEBISECTOR_H__