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