]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actiondrawlinetangent1.h
Major refactoring of actions: Moved implementation from header files
[architektonas] / src / actions / rs_actiondrawlinetangent1.h
1 #ifndef RS_ACTIONDRAWLINETANGENT1_H
2 #define RS_ACTIONDRAWLINETANGENT1_H
3
4 #include "rs_line.h"
5 #include "rs_previewactioninterface.h"
6 #include "vector.h"
7
8 class RS_Line;
9 class RS_Entity;
10
11 /**
12  * This action class can handle user events to draw tangents from points
13  * to circles.
14  *
15  * @author Andrew Mustun
16  */
17 class RS_ActionDrawLineTangent1: public RS_PreviewActionInterface
18 {
19         private:
20                 enum Status {
21                         SetPoint,     /**< Choose the startpoint. */
22                         SetCircle      /**< Choose the circle / arc. */
23                 };
24
25         public:
26                 RS_ActionDrawLineTangent1(RS_EntityContainer & container, RS_GraphicView & graphicView);
27                 ~RS_ActionDrawLineTangent1();
28
29                 virtual void trigger();
30                 virtual void mouseMoveEvent(QMouseEvent * e);
31                 virtual void mouseReleaseEvent(QMouseEvent * e);
32                 virtual void coordinateEvent(Vector * e);
33                 virtual void updateMouseButtonHints();
34                 virtual void updateMouseCursor();
35                 virtual void updateToolBar();
36
37         private:
38                 /** Closest tangent. */
39                 RS_Line * tangent;
40                 /** Chosen startpoint */
41                 Vector point;
42                 /** Chosen entity */
43                 RS_Entity * circle;
44                 /** Data of new tangent */
45                 RS_LineData data;
46 };
47
48 #endif