]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actioninfoarea.h
Last checkin before major refactor...
[architektonas] / src / actions / rs_actioninfoarea.h
1 #ifndef RS_ACTIONINFOAREA_H
2 #define RS_ACTIONINFOAREA_H
3
4 #include "rs_infoarea.h"
5 #include "rs_previewactioninterface.h"
6 #include "vector.h"
7
8 class RS_Entity;
9
10 /**
11  * This action class can handle user events to measure distances between
12  * two points.
13  *
14  * @author Andrew Mustun
15  */
16 class RS_ActionInfoArea: public RS_PreviewActionInterface
17 {
18         public:
19                 /**
20                  * Action States.
21                  */
22                 enum Status {
23                         SetFirstPoint,    /**< Setting the 1st point of the polygon. */
24                         SetNextPoint      /**< Setting a next point. */
25                 };
26
27         public:
28                 RS_ActionInfoArea(RS_EntityContainer & container, GraphicView & graphicView);
29                 ~RS_ActionInfoArea();
30
31                 virtual void init(int status = 0);
32                 virtual void trigger();
33                 virtual void mouseMoveEvent(QMouseEvent * e);
34                 virtual void mouseReleaseEvent(QMouseEvent * e);
35                 virtual void coordinateEvent(Vector * e);
36                 virtual void updateMouseButtonHints();
37                 virtual void updateMouseCursor();
38                 virtual void updateToolBar();
39
40         private:
41                 Vector point1;
42                 Vector prev;
43                 RS_Entity * currentLine;
44                 RS_Entity * closingLine;
45                 RS_InfoArea ia;
46 };
47
48 #endif