]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actiondrawarctangential.h
Refactoring: Moved RS_GraphicView to GraphicView.
[architektonas] / src / actions / rs_actiondrawarctangential.h
1 #ifndef RS_ACTIONDRAWARCTANGENTIAL_H
2 #define RS_ACTIONDRAWARCTANGENTIAL_H
3
4 #include "rs_previewactioninterface.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 Andrew Mustun
15  */
16 class RS_ActionDrawArcTangential: public RS_PreviewActionInterface
17 {
18         public:
19                 /**
20                  * Action States.
21                  */
22                 enum Status {
23                         SetBaseEntity,   /**< Setting base entity. */
24                         SetEndAngle      /**< Setting end angle. */
25                 };
26
27         public:
28                 RS_ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView);
29                 ~RS_ActionDrawArcTangential();
30
31                 virtual RS2::ActionType rtti();
32                 void reset();
33                 virtual void init(int status = 0);
34                 virtual void trigger();
35                 void preparePreview();
36                 virtual void mouseMoveEvent(QMouseEvent * e);
37                 virtual void mouseReleaseEvent(QMouseEvent * e);
38                 virtual void coordinateEvent(Vector * e);
39                 virtual void commandEvent(RS_CommandEvent * e);
40                 virtual QStringList getAvailableCommands();
41                 virtual void hideOptions();
42                 virtual void showOptions();
43                 virtual void updateMouseButtonHints();
44                 virtual void updateMouseCursor();
45                 virtual void updateToolBar();
46                 void setRadius(double r);
47                 double getRadius();
48
49         protected:
50                 /**
51                  * Base entity.
52                  */
53                 RS_AtomicEntity * baseEntity;
54                 /**
55                  * Start point of base entity clicked?
56                  */
57                 bool isStartPoint;
58                 /**
59                  * Point that determines end angle.
60                  */
61                 Vector point;
62                 /**
63                  * Arc data calculated.
64                  */
65                 RS_ArcData data;
66 };
67
68 #endif