b311480e |
1 | // Created on: 1993-06-03 |
2 | // Created by: Jacques GOUSSARD |
3 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
733a0e55 |
16 | |
7fd59977 |
17 | #include <StdFail_UndefinedDerivative.hxx> |
18 | |
19 | inline void Contap_SurfFunction::Set(const gp_Pnt& Eye) |
20 | { |
21 | myType = Contap_ContourPrs; // pers |
22 | myEye = Eye; |
23 | myAng = 0.; |
24 | } |
25 | |
26 | inline void Contap_SurfFunction::Set(const gp_Dir& Direction) |
27 | { |
28 | myType = Contap_ContourStd; // Contour app |
29 | myDir = Direction; |
30 | myAng = 0.; |
31 | } |
32 | |
33 | inline void Contap_SurfFunction::Set(const gp_Dir& Direction, |
34 | const Standard_Real Angle) |
35 | { |
36 | myType = Contap_DraftStd; // Contour vu |
37 | myDir = Direction; |
38 | myAng = Angle; |
c6541a0c |
39 | myCosAng = Cos(M_PI/2.+Angle); |
7fd59977 |
40 | } |
41 | |
42 | inline void Contap_SurfFunction::Set(const gp_Pnt& Eye, |
43 | const Standard_Real Angle) |
44 | { |
45 | myType = Contap_DraftPrs; // Contour vu "conique"... |
46 | myEye = Eye; |
47 | myAng = Angle; |
c6541a0c |
48 | myCosAng = Cos(M_PI/2.+Angle); |
7fd59977 |
49 | } |
50 | |
51 | inline void Contap_SurfFunction::Set(const Standard_Real Tolerance) |
52 | { |
53 | tol = Max(Tolerance, 1.e-12); |
54 | } |
55 | |
56 | inline const gp_Pnt& Contap_SurfFunction::Point () const |
57 | { |
58 | return solpt; |
59 | } |
60 | |
61 | inline Standard_Real Contap_SurfFunction::Root () const |
62 | { |
63 | return valf; |
64 | } |
65 | |
66 | inline Standard_Real Contap_SurfFunction::Tolerance () const |
67 | { |
68 | return tol; |
69 | } |
70 | |
71 | inline const gp_Vec& Contap_SurfFunction::Direction3d() |
72 | { |
9775fa61 |
73 | if (IsTangent()) throw StdFail_UndefinedDerivative(); |
7fd59977 |
74 | return d3d; |
75 | } |
76 | |
77 | inline const gp_Dir2d& Contap_SurfFunction::Direction2d() |
78 | { |
9775fa61 |
79 | if (IsTangent()) throw StdFail_UndefinedDerivative(); |
7fd59977 |
80 | return d2d; |
81 | } |
82 | |
857ffd5e |
83 | inline const Handle(Adaptor3d_HSurface)& Contap_SurfFunction::Surface() const |
7fd59977 |
84 | { |
85 | return mySurf; |
86 | } |
87 | |
88 | inline const gp_Pnt& Contap_SurfFunction::Eye() const |
89 | { |
90 | return myEye; |
91 | } |
92 | |
93 | inline const gp_Dir& Contap_SurfFunction::Direction() const |
94 | { |
95 | return myDir; |
96 | } |
97 | |
98 | inline Standard_Real Contap_SurfFunction::Angle () const |
99 | { |
100 | return myAng; |
101 | } |
102 | |
103 | inline Contap_TFunction Contap_SurfFunction::FunctionType () const |
104 | { |
105 | return myType; |
106 | } |