]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawcircle3p.h
d2d64b47e6a77999ae42970f6a3e73c8910c1230
[architektonas] / src / actions / actiondrawcircle3p.h
1 #ifndef __ACTIONDRAWCIRCLE3P_H__
2 #define __ACTIONDRAWCIRCLE3P_H__
3
4 #include "rs_circle.h"
5 #include "actioninterface.h"
6 #include "vector.h"
7
8 /**
9  * This action class can handle user events to draw circles with three points
10  * given.
11  *
12  * @author James Hammons
13  * @author Andrew Mustun
14  */
15 class ActionDrawCircle3P: 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                 ActionDrawCircle3P(RS_EntityContainer & container, GraphicView & graphicView);
29                 ~ActionDrawCircle3P();
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                  * Circle data defined so far.
47                  */
48                 RS_CircleData 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  // __ACTIONDRAWCIRCLE3P_H__