]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawarc3p.h
ffca07fa3d8bd7aa4eb31d5ab4662c96ecbe4780
[architektonas] / src / actions / actiondrawarc3p.h
1 #ifndef __ACTIONDRAWARC3P_H__
2 #define __ACTIONDRAWARC3P_H__
3
4 #include "rs_arc.h"
5 #include "actioninterface.h"
6 #include "vector.h"
7
8 /**
9  * This action class can handle user events to draw
10  * arcs with three points given.
11  *
12  * @author James Hammons
13  * @author Andrew Mustun
14  */
15 class ActionDrawArc3P: public ActionInterface
16 {
17         public:
18                 /**
19                  * Action States.
20                  */
21                 enum Status {
22                         SetPoint1,       /**< Setting the 1st point. */
23                         SetPoint2,       /**< Setting the 2nd point. */
24                         SetPoint3        /**< Setting the 3rd point. */
25                 };
26
27         public:
28                 ActionDrawArc3P(RS_EntityContainer & container, GraphicView & graphicView);
29                 ~ActionDrawArc3P();
30
31                 void reset();
32                 virtual void init(int status = 0);
33                 virtual void trigger();
34                 void preparePreview();
35                 virtual void mouseMoveEvent(QMouseEvent * e);
36                 virtual void mouseReleaseEvent(QMouseEvent * e);
37                 virtual void coordinateEvent(Vector * e);
38                 virtual void commandEvent(RS_CommandEvent * e);
39                 virtual QStringList getAvailableCommands();
40                 virtual void updateMouseButtonHints();
41                 virtual void updateMouseCursor();
42                 virtual void updateToolBar();
43
44         protected:
45                 /**
46                  * Arc data defined so far.
47                  */
48                 RS_ArcData data;
49                 /**
50                  * 1st point.
51                  */
52                 Vector point1;
53                 /**
54                  * 2nd point.
55                  */
56                 Vector point2;
57                 /**
58                  * 3nd point.
59                  */
60                 Vector point3;
61 };
62
63 #endif  // __ACTIONDRAWARC3P_H__