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