0023404: Create SquareConfusion function in Precision package for speed and convenience
[occt.git] / src / Extrema / Extrema_CurveTool.lxx
1 // Created on: 1995-07-18
2 // Created by: Modelistation
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22 #include <gp_Vec.hxx>
23 #include <gp_Pnt.hxx>
24 #include <gp_Parab.hxx>
25 #include <gp_Lin.hxx>
26 #include <gp_Elips.hxx>
27 #include <gp_Hypr.hxx>
28 #include <gp_Circ.hxx>
29 #include <Geom_BezierCurve.hxx>
30 #include <Geom_BSplineCurve.hxx>
31 #include <Adaptor3d_Curve.hxx>
32
33
34 //=======================================================================
35 //function : FirstParameter
36 //purpose  : 
37 //=======================================================================
38
39 inline Standard_Real Extrema_CurveTool::FirstParameter(const Adaptor3d_Curve& C)
40 {
41   return C.FirstParameter();
42 }
43
44 //=======================================================================
45 //function : LastParameter
46 //purpose  : 
47 //=======================================================================
48
49 inline Standard_Real Extrema_CurveTool::LastParameter(const Adaptor3d_Curve& C)
50 {
51   return C.LastParameter();
52 }
53
54 //=======================================================================
55 //function : Value
56 //purpose  : 
57 //=======================================================================
58
59 inline gp_Pnt Extrema_CurveTool::Value(const Adaptor3d_Curve& C,
60                                        const Standard_Real U)
61 {
62   return C.Value(U);
63 }
64
65
66 //=======================================================================
67 //function : D1
68 //purpose  : 
69 //=======================================================================
70
71 inline void Extrema_CurveTool::D1(const Adaptor3d_Curve& C,
72                                   const Standard_Real U,
73                                   gp_Pnt& P,
74                                   gp_Vec& V)
75 {
76   C.D1(U, P, V);
77 }
78
79 //=======================================================================
80 //function : D2
81 //purpose  : 
82 //=======================================================================
83
84 inline void Extrema_CurveTool::D2(const Adaptor3d_Curve& C,
85                                   const Standard_Real U,
86                                   gp_Pnt& P,
87                                   gp_Vec& V1,
88                                   gp_Vec& V2)
89 {
90   C.D2(U, P, V1, V2);
91 }
92
93
94
95 //=======================================================================
96 //function : Continuity
97 //purpose  : 
98 //=======================================================================
99
100 inline GeomAbs_Shape Extrema_CurveTool::Continuity(const Adaptor3d_Curve& C)
101 {
102   return C.Continuity();
103 }
104
105 //=======================================================================
106 //function : NbIntervals
107 //purpose  : 
108 //=======================================================================
109
110 inline Standard_Integer Extrema_CurveTool::NbIntervals(Adaptor3d_Curve& C,
111                                                        const GeomAbs_Shape S)
112 {
113   return C.NbIntervals(S);
114 }
115
116
117 //=======================================================================
118 //function : Intervals
119 //purpose  : 
120 //=======================================================================
121
122 inline void Extrema_CurveTool::Intervals(Adaptor3d_Curve& C,
123                                          TColStd_Array1OfReal& T,
124                                          const GeomAbs_Shape   S)
125 {
126   C.Intervals(T, S);
127 }
128
129 //=======================================================================
130 //function : Period
131 //purpose  : 
132 //=======================================================================
133
134 inline Standard_Real Extrema_CurveTool::Period(const Adaptor3d_Curve& C)
135 {
136   return C.Period();
137 }
138
139
140 //=======================================================================
141 //function : GetType
142 //purpose  : 
143 //=======================================================================
144
145 inline GeomAbs_CurveType Extrema_CurveTool::GetType(const Adaptor3d_Curve& C)
146 {
147   return C.GetType();
148 }
149
150 //=======================================================================
151 //function : Line
152 //purpose  : 
153 //=======================================================================
154
155 inline gp_Lin Extrema_CurveTool::Line(const Adaptor3d_Curve& C)
156 {
157   return C.Line();
158 }
159
160 //=======================================================================
161 //function : Circle
162 //purpose  : 
163 //=======================================================================
164
165 inline gp_Circ Extrema_CurveTool::Circle(const Adaptor3d_Curve& C)
166 {
167   return C.Circle();
168 }
169
170 //=======================================================================
171 //function : Ellipse
172 //purpose  : 
173 //=======================================================================
174
175 inline gp_Elips Extrema_CurveTool::Ellipse(const Adaptor3d_Curve& C)
176 {
177   return C.Ellipse();
178 }
179
180 //=======================================================================
181 //function : Hyperbola
182 //purpose  : 
183 //=======================================================================
184
185 inline gp_Hypr Extrema_CurveTool::Hyperbola(const Adaptor3d_Curve& C)
186 {
187   return C.Hyperbola();
188 }
189
190 //=======================================================================
191 //function : Parabola
192 //purpose  : 
193 //=======================================================================
194
195 inline gp_Parab Extrema_CurveTool::Parabola(const Adaptor3d_Curve& C)
196 {
197   return C.Parabola();
198 }
199 //=======================================================================
200 //function : NbPoles
201 //purpose  : 
202 //=======================================================================
203
204  inline Standard_Integer Extrema_CurveTool::NbPoles(const Adaptor3d_Curve& C)
205 {
206   return C.NbPoles();
207 }
208
209 //=======================================================================
210 //function : Degree
211 //purpose  : 
212 //=======================================================================
213
214  inline Standard_Integer Extrema_CurveTool::Degree(const Adaptor3d_Curve& C)
215 {
216   return C.Degree();
217 }
218
219 //=======================================================================
220 //function : IsRational
221 //purpose  : 
222 //=======================================================================
223
224  inline Standard_Boolean Extrema_CurveTool::IsRational(const Adaptor3d_Curve& C)
225 {
226   return C.IsRational();
227 }
228
229 //=======================================================================
230 //function : NbKnots
231 //purpose  : 
232 //=======================================================================
233
234  inline Standard_Integer Extrema_CurveTool::NbKnots(const Adaptor3d_Curve& C)
235 {
236   return C.NbKnots();
237 }
238
239
240 //=======================================================================
241 //function : Bezier
242 //purpose  : 
243 //=======================================================================
244
245 inline Handle(Geom_BezierCurve) Extrema_CurveTool::Bezier(const Adaptor3d_Curve& C)
246 {
247   return C.Bezier();
248 }
249
250 //=======================================================================
251 //function : BSpline
252 //purpose  : 
253 //=======================================================================
254
255 inline Handle(Geom_BSplineCurve) Extrema_CurveTool::BSpline(const Adaptor3d_Curve& C)
256 {
257   return C.BSpline();
258 }
259
260 //=======================================================================
261 //function : Resolution
262 //purpose  : 
263 //=======================================================================
264
265 inline Standard_Real Extrema_CurveTool::Resolution(const Adaptor3d_Curve& C,
266                                                    const Standard_Real R3d) 
267 {
268   return C.Resolution(R3d);
269 }