-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathSketcher_CommandArc3P.hxx
150 lines (123 loc) · 3.48 KB
/
Sketcher_CommandArc3P.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/**
* \file Sketcher_CommandArc3P.hxx
* \brief Header file for the class Sketcher_CommandArc3P
* \author <a href="mailto:[email protected]?subject=Sketcher_CommandArc3P.hxx">Sergei Maslov</a>
*/
#ifndef Sketcher_CommandARC3P_H
#define Sketcher_CommandARC3P_H
#include "Sketcher_Command.hxx"
#include "Geom2d_Arc.hxx"
#include <gp_Circ.hxx>
#include <gce_MakeCirc.hxx>
#include <gce_ErrorType.hxx>
#include <Geom_Circle.hxx>
#include <AIS_Circle.hxx>
#include <Geom2dGcc_Circ2d3Tan.hxx>
#include <Geom2dGcc_QualifiedCurve.hxx>
#include <gp_Circ2d.hxx>
#include <Geom2d_Circle.hxx>
class Geom_Circle;
class AIS_Line;
class AIS_Circle;
DEFINE_STANDARD_HANDLE(Sketcher_CommandArc3P,Sketcher_Command)
//Command entering Arc by 3 points
class Sketcher_CommandArc3P : public Sketcher_Command
{
public:
// Type management
DEFINE_STANDARD_RTTIEXT(Sketcher_CommandArc3P, Sketcher_Command)
enum Arc3PAction { Nothing,Input_1ArcPoint,Input_2ArcPoint,Input_3ArcPoint,Input_PolylineArc};
/**
* \fn Sketcher_CommandArc3P()
* \brief Constructs a Sketcher_CommandArc3P
*/
Standard_EXPORT Sketcher_CommandArc3P();
/**
* \fn ~Sketcher_CommandArc3P()
* \brief destructor
*/
Standard_EXPORT ~Sketcher_CommandArc3P();
/**
* \fn Action()
* \brief turn command to active state
*/
Standard_EXPORT void Action();
/**
* \fn MouseInputEvent(const gp_Pnt2d& thePnt2d )
* \brief input event handler
* \return Standard_Boolean
* \param thePnt2d const gp_Pnt2d&
*/
Standard_EXPORT Standard_Boolean MouseInputEvent(const gp_Pnt2d& thePnt2d);
/**
* \fn MouseMoveEvent(const gp_Pnt2d& thePnt2d )
* \brief mouse move handler
* \return void
* \param thePnt2d const gp_Pnt2d&
*/
Standard_EXPORT void MouseMoveEvent(const gp_Pnt2d& thePnt2d);
/**
* \fn CancelEvent()
* \brief cancel event handler, stop entering object
* \return void
*/
Standard_EXPORT void CancelEvent();
/**
* \fn GetTypeOfMethod()
* \brief get command Method
* \return Sketcher_ObjectTypeOfMethod
*/
Standard_EXPORT Sketcher_ObjectTypeOfMethod GetTypeOfMethod();
/**
* \fn SetPolylineFirstPnt(const gp_Pnt2d& p1)
* \brief set last entering gp_Pnt2d for polyline
* \return void
* \param p1 const gp_Pnt2d&
*/
Standard_EXPORT virtual void SetPolylineFirstPnt(const gp_Pnt2d& p1);
/**
* \fn GetPolylineFirstPnt(gp_Pnt2d& p1)
* \brief get last entering gp_Pnt2d for polyline
* \return Standard_Boolean
* \param p1 gp_Pnt2d&
*/
Standard_EXPORT virtual Standard_Boolean GetPolylineFirstPnt(gp_Pnt2d& p1);
/**
* \fn SetPolylineMode(Standard_Boolean mode)
* \brief set polyline mode
* \return void
* \param mode Standard_Boolean
*/
Standard_EXPORT void SetPolylineMode(Standard_Boolean mode);
private:
//methods
/**
* \fn findlastSObject()
* \brief find last object at list of objects
* \return void
*/
Standard_EXPORT void findlastSObject();
/**
* \fn setTempLine()
* \brief set default horisontal line
* \return void
*/
Standard_EXPORT void setTempLine();
//members
Arc3PAction myArc3PAction;
Handle(Geom_Circle) tempGeom_Circle;
Handle(AIS_Circle) myRubberCircle;
gp_Pnt2d mySecondgp_Pnt2d;
gp_Circ tempCirc;
gp_Pnt third_Pnt;
Geom2dAdaptor_Curve temp2dAdaptor_Curve;
gp_Circ2d temp2d_Circ;
Handle(Geom2d_Circle) tempGeom2d_Circle;
gp_Pnt2d midpoint2d,tempu1_pnt2d,tempu2_pnt2d;
Standard_Real u1,u2,temp_u1, temp_u2;
Standard_Real dist1, dist2;
Handle(Geom2d_Line) tempGeom2d_Line;
Handle(Geom2d_CartesianPoint) FirstGeom2d_Point;
Handle(Geom2d_CartesianPoint) TempGeom2d_Point;
};
#endif