]> Shamusworld >> Repos - architektonas/blob - src/actions/actiondrawlinetangent1.h
8d369c8b64d802e3332a03bf08851c879676cc71
[architektonas] / src / actions / actiondrawlinetangent1.h
1 #ifndef __ACTIONDRAWLINETANGENT1_H__
2 #define __ACTIONDRAWLINETANGENT1_H__
3
4 #include "rs_line.h"
5 #include "actioninterface.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 James Hammons
16  * @author Andrew Mustun
17  */
18 class ActionDrawLineTangent1: public ActionInterface
19 {
20         private:
21                 enum Status {
22                         SetPoint,     /**< Choose the startpoint. */
23                         SetCircle      /**< Choose the circle / arc. */
24                 };
25
26         public:
27                 ActionDrawLineTangent1(RS_EntityContainer & container, GraphicView & graphicView);
28                 ~ActionDrawLineTangent1();
29
30                 virtual void trigger();
31                 virtual void mouseMoveEvent(QMouseEvent * e);
32                 virtual void mouseReleaseEvent(QMouseEvent * e);
33                 virtual void coordinateEvent(Vector * e);
34                 virtual void updateMouseButtonHints();
35                 virtual void updateMouseCursor();
36                 virtual void updateToolBar();
37
38         private:
39                 /** Closest tangent. */
40                 RS_Line * tangent;
41                 /** Chosen startpoint */
42                 Vector point;
43                 /** Chosen entity */
44                 RS_Entity * circle;
45                 /** Data of new tangent */
46                 RS_LineData data;
47 };
48
49 #endif  // __ACTIONDRAWLINETANGENT1_H__