Integration of OCCT 6.5.0 from SVN
[occt.git] / src / Contap / Contap_SurfFunction.lxx
1 #include <StdFail_UndefinedDerivative.hxx>
2
3 inline void Contap_SurfFunction::Set(const gp_Pnt& Eye)
4 {
5   myType = Contap_ContourPrs; // pers
6   myEye = Eye;
7   myAng = 0.;
8 }
9
10 inline void Contap_SurfFunction::Set(const gp_Dir& Direction)
11 {
12   myType = Contap_ContourStd; // Contour app
13   myDir = Direction;
14   myAng = 0.;
15 }
16
17 inline void Contap_SurfFunction::Set(const gp_Dir& Direction,
18                                      const Standard_Real Angle)
19 {
20   myType = Contap_DraftStd; // Contour vu
21   myDir = Direction;
22   myAng = Angle;
23   myCosAng = Cos(PI/2.+Angle);
24 }
25
26 inline void Contap_SurfFunction::Set(const gp_Pnt& Eye,
27                                      const Standard_Real Angle)
28 {
29   myType = Contap_DraftPrs; // Contour vu "conique"...
30   myEye = Eye;
31   myAng = Angle;
32   myCosAng = Cos(PI/2.+Angle);
33 }
34
35 inline void Contap_SurfFunction::Set(const Standard_Real Tolerance)
36 {
37   tol = Max(Tolerance, 1.e-12);
38 }
39
40 inline const gp_Pnt& Contap_SurfFunction::Point () const
41 {
42   return solpt;
43 }
44
45 inline Standard_Real Contap_SurfFunction::Root () const
46 {
47   return valf;
48 }
49
50 inline Standard_Real Contap_SurfFunction::Tolerance () const
51 {
52   return tol;
53 }
54
55 inline const gp_Vec& Contap_SurfFunction::Direction3d()
56 {
57   if (IsTangent()) StdFail_UndefinedDerivative::Raise();       
58   return d3d;
59 }
60
61 inline const gp_Dir2d& Contap_SurfFunction::Direction2d()
62 {
63   if (IsTangent()) StdFail_UndefinedDerivative::Raise();       
64   return d2d;
65 }
66
67 inline const TheSurface& Contap_SurfFunction::Surface() const
68 {
69   return mySurf;
70 }
71
72 inline const gp_Pnt& Contap_SurfFunction::Eye() const
73 {
74   return myEye;
75 }
76
77 inline const gp_Dir& Contap_SurfFunction::Direction() const
78 {
79   return myDir;
80 }
81
82 inline Standard_Real Contap_SurfFunction::Angle () const
83 {
84   return myAng;
85 }
86
87 inline Contap_TFunction Contap_SurfFunction::FunctionType () const
88 {
89   return myType;
90 }