]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlinepolygon2.h
Bugfixes related to removing Snapper class.
[architektonas] / src / actions / actiondrawlinepolygon2.h
1 #ifndef __ACTIONDRAWLINEPOLYGON2_H__
2 #define __ACTIONDRAWLINEPOLYGON2_H__
3
4 #include "actioninterface.h"
5 #include "vector.h"
6
7 /**
8  * This action class can handle user events to draw polygons.
9  *
10  * @author James Hammons
11  * @author Andrew Mustun
12  */
13 class ActionDrawLinePolygon2: public ActionInterface
14 {
15         private:
16                 enum Status {
17                         SetCorner1,    /**< Setting center 1. */
18                         SetCorner2,    /**< Setting corner 2. */
19                         SetNumber      /**< Setting number in the command line. */
20                 };
21
22         public:
23                 ActionDrawLinePolygon2(EntityContainer & container, GraphicView & graphicView);
24                 ~ActionDrawLinePolygon2();
25
26                 virtual RS2::ActionType rtti();
27                 virtual void trigger();
28                 virtual void mouseMoveEvent(QMouseEvent * e);
29                 virtual void mouseReleaseEvent(QMouseEvent * e);
30                 virtual void updateMouseButtonHints();
31                 virtual void coordinateEvent(Vector * e);
32                 virtual void commandEvent(CommandEvent * e);
33                 virtual QStringList getAvailableCommands();
34                 virtual void hideOptions();
35                 virtual void showOptions();
36                 virtual void updateMouseCursor();
37                 virtual void updateToolBar();
38                 int getNumber();
39                 void setNumber(int n);
40
41         private:
42                 /** 1st corner */
43                 Vector corner1;
44                 /** 2nd corner */
45                 Vector corner2;
46                 /** Number of edges. */
47                 int number;
48                 /** Last status before entering text. */
49                 Status lastStatus;
50 };
51
52 #endif  // __ACTIONDRAWLINEPOLYGON2_H__