]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawarctangential.h
In the middle of major refactoring...
[architektonas] / src / actions / actiondrawarctangential.h
1 #ifndef __ACTIONDRAWARCTANGENTIAL_H__
2 #define __ACTIONDRAWARCTANGENTIAL_H__
3
4 #include "actioninterface.h"
5 #include "rs_arc.h"
6 #include "vector.h"
7
8 class RS_AtomicEntity;
9
10 /**
11  * This action class can handle user events to draw
12  * arcs with three points given.
13  *
14  * @author James Hammons
15  * @author Andrew Mustun
16  */
17 class ActionDrawArcTangential: public ActionInterface
18 {
19         public:
20                 /**
21                  * Action States.
22                  */
23                 enum Status {
24                         SetBaseEntity,   /**< Setting base entity. */
25                         SetEndAngle      /**< Setting end angle. */
26                 };
27
28         public:
29                 ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView);
30                 ~ActionDrawArcTangential();
31
32                 virtual RS2::ActionType rtti();
33                 void reset();
34                 virtual void init(int status = 0);
35                 virtual void trigger();
36                 void preparePreview();
37                 virtual void mouseMoveEvent(QMouseEvent * e);
38                 virtual void mouseReleaseEvent(QMouseEvent * e);
39                 virtual void coordinateEvent(Vector * e);
40                 virtual void commandEvent(RS_CommandEvent * e);
41                 virtual QStringList getAvailableCommands();
42                 virtual void hideOptions();
43                 virtual void showOptions();
44                 virtual void updateMouseButtonHints();
45                 virtual void updateMouseCursor();
46                 virtual void updateToolBar();
47                 void setRadius(double r);
48                 double getRadius();
49
50         protected:
51                 /**
52                  * Base entity.
53                  */
54                 RS_AtomicEntity * baseEntity;
55                 /**
56                  * Start point of base entity clicked?
57                  */
58                 bool isStartPoint;
59                 /**
60                  * Point that determines end angle.
61                  */
62                 Vector point;
63                 /**
64                  * Arc data calculated.
65                  */
66                 RS_ArcData data;
67 };
68
69 #endif  // __ACTIONDRAWARCTANGENTIAL_H__