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