]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlinepolygon.h
Last checkin before major refactor...
[architektonas] / src / actions / actiondrawlinepolygon.h
1 #ifndef __ACTIONDRAWLINEPOLYGON_H__
2 #define __ACTIONDRAWLINEPOLYGON_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 ActionDrawLinePolygon: public ActionInterface
14 {
15         private:
16                 enum Status {
17                         SetCenter,    /**< Setting center. */
18                         SetCorner,    /**< Setting corner. */
19                         SetNumber     /**< Setting number in the command line. */
20                 };
21
22         public:
23                 ActionDrawLinePolygon(RS_EntityContainer & container, GraphicView & graphicView);
24                 ~ActionDrawLinePolygon();
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(RS_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                 /** Center of polygon */
43                 Vector center;
44                 /** Edge */
45                 Vector corner;
46                 /** Number of edges. */
47                 int number;
48                 /** Last status before entering text. */
49                 Status lastStatus;
50 };
51
52 #endif  // __ACTIONDRAWLINEPOLYGON_H__