7fd59977 |
1 | // File: BiTgte_CurveOnEdge.cxx |
2 | // Created: Fri Jan 10 15:07:12 1997 |
3 | // Author: Bruno DUMORTIER |
4 | // <dub@brunox.paris1.matra-dtv.fr> |
5 | |
6 | |
7 | #include <BiTgte_CurveOnEdge.ixx> |
8 | |
9 | #include <BiTgte_HCurveOnEdge.hxx> |
10 | #include <BRep_Tool.hxx> |
11 | #include <Geom_TrimmedCurve.hxx> |
12 | #include <GeomAPI_ProjectPointOnCurve.hxx> |
13 | #include <GeomAdaptor_Curve.hxx> |
14 | #include <Standard_NotImplemented.hxx> |
15 | #include <Precision.hxx> |
16 | |
17 | |
18 | //======================================================================= |
19 | //function : BiTgte_CurveOnEdge |
20 | //purpose : |
21 | //====================================================================== |
22 | |
23 | BiTgte_CurveOnEdge::BiTgte_CurveOnEdge() |
24 | { |
25 | } |
26 | |
27 | |
28 | //======================================================================= |
29 | //function : BiTgte_CurveOnEdge |
30 | //purpose : |
31 | //======================================================================= |
32 | |
33 | BiTgte_CurveOnEdge::BiTgte_CurveOnEdge(const TopoDS_Edge& EonF, |
34 | const TopoDS_Edge& Edge) |
35 | { |
36 | Init(EonF,Edge); |
37 | } |
38 | |
39 | |
40 | //======================================================================= |
41 | //function : Init |
42 | //purpose : |
43 | //======================================================================= |
44 | |
45 | void BiTgte_CurveOnEdge::Init(const TopoDS_Edge& EonF, |
46 | const TopoDS_Edge& Edge) |
47 | { |
48 | Standard_Real f,l; |
49 | |
50 | myEdge = Edge; |
51 | myCurv = BRep_Tool::Curve(myEdge,f,l); |
52 | myCurv = new Geom_TrimmedCurve(myCurv,f,l); |
53 | |
54 | myEonF = EonF; |
55 | myConF = BRep_Tool::Curve(myEonF,f,l); |
56 | myConF = new Geom_TrimmedCurve(myConF,f,l); |
57 | |
58 | // peut on generer un cercle de rayon nul |
59 | GeomAdaptor_Curve Curv(myCurv); |
60 | GeomAdaptor_Curve ConF(myConF); |
61 | |
62 | myType = GeomAbs_OtherCurve; |
63 | if (Curv.GetType() == GeomAbs_Line && |
64 | ConF.GetType() == GeomAbs_Circle ) { |
65 | gp_Ax1 a1 = Curv.Line().Position(); |
66 | gp_Ax1 a2 = ConF.Circle().Axis(); |
67 | if ( a1.IsCoaxial(a2,Precision::Angular(),Precision::Confusion())) { |
68 | myType = GeomAbs_Circle; |
69 | myCirc = gp_Circ(ConF.Circle().Position(),0.); |
70 | } |
71 | } |
72 | } |
73 | |
74 | |
75 | //======================================================================= |
76 | //function : FirstParameter |
77 | //purpose : |
78 | //======================================================================= |
79 | |
80 | Standard_Real BiTgte_CurveOnEdge::FirstParameter() const |
81 | { |
82 | return myConF->FirstParameter(); |
83 | } |
84 | |
85 | |
86 | //======================================================================= |
87 | //function : LastParameter |
88 | //purpose : |
89 | //======================================================================= |
90 | |
91 | Standard_Real BiTgte_CurveOnEdge::LastParameter() const |
92 | { |
93 | return myConF->LastParameter(); |
94 | } |
95 | |
96 | |
97 | //======================================================================= |
98 | //function : |
99 | //purpose : |
100 | //======================================================================= |
101 | |
102 | GeomAbs_Shape BiTgte_CurveOnEdge::Continuity() const |
103 | { |
104 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
105 | return GeomAbs_C0; |
106 | } |
107 | |
108 | |
109 | //======================================================================= |
110 | //function : |
111 | //purpose : |
112 | //======================================================================= |
113 | |
114 | Standard_Integer BiTgte_CurveOnEdge::NbIntervals(const GeomAbs_Shape S) const |
115 | { |
116 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
117 | return 0; |
118 | } |
119 | |
120 | |
121 | //======================================================================= |
122 | //function : |
123 | //purpose : |
124 | //======================================================================= |
125 | |
126 | void BiTgte_CurveOnEdge::Intervals(TColStd_Array1OfReal& T, |
127 | const GeomAbs_Shape S) const |
128 | { |
129 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
130 | } |
131 | |
132 | |
133 | //======================================================================= |
134 | //function : |
135 | //purpose : |
136 | //======================================================================= |
137 | |
138 | Handle(Adaptor3d_HCurve) BiTgte_CurveOnEdge::Trim(const Standard_Real First, |
139 | const Standard_Real Last, |
140 | const Standard_Real Tol) const |
141 | { |
142 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
143 | Handle(BiTgte_HCurveOnEdge) HC; |
144 | return HC; |
145 | } |
146 | |
147 | |
148 | //======================================================================= |
149 | //function : |
150 | //purpose : |
151 | //======================================================================= |
152 | |
153 | Standard_Boolean BiTgte_CurveOnEdge::IsClosed() const |
154 | { |
155 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
156 | return Standard_False; |
157 | } |
158 | |
159 | |
160 | //======================================================================= |
161 | //function : |
162 | //purpose : |
163 | //======================================================================= |
164 | |
165 | Standard_Boolean BiTgte_CurveOnEdge::IsPeriodic() const |
166 | { |
167 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
168 | return Standard_False; |
169 | } |
170 | |
171 | |
172 | //======================================================================= |
173 | //function : |
174 | //purpose : |
175 | //======================================================================= |
176 | |
177 | Standard_Real BiTgte_CurveOnEdge::Period() const |
178 | { |
179 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
180 | return 0.; |
181 | } |
182 | |
183 | |
184 | //======================================================================= |
185 | //function : |
186 | //purpose : |
187 | //======================================================================= |
188 | |
189 | gp_Pnt BiTgte_CurveOnEdge::Value(const Standard_Real U) const |
190 | { |
191 | gp_Pnt P; |
192 | D0(U,P); |
193 | return P; |
194 | } |
195 | |
196 | |
197 | //======================================================================= |
198 | //function : |
199 | //purpose : |
200 | //======================================================================= |
201 | |
202 | void BiTgte_CurveOnEdge::D0(const Standard_Real U,gp_Pnt& P) const |
203 | { |
204 | GeomAPI_ProjectPointOnCurve Projector; |
205 | P = myConF->Value(U); |
206 | Projector.Init(P, myCurv); |
207 | P = Projector.NearestPoint(); |
208 | } |
209 | |
210 | |
211 | //======================================================================= |
212 | //function : |
213 | //purpose : |
214 | //======================================================================= |
215 | |
216 | void BiTgte_CurveOnEdge::D1(const Standard_Real U,gp_Pnt& P,gp_Vec& V) const |
217 | { |
218 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
219 | } |
220 | |
221 | |
222 | //======================================================================= |
223 | //function : |
224 | //purpose : |
225 | //======================================================================= |
226 | |
227 | void BiTgte_CurveOnEdge::D2(const Standard_Real U,gp_Pnt& P, |
228 | gp_Vec& V1,gp_Vec& V2) const |
229 | { |
230 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
231 | } |
232 | |
233 | |
234 | //======================================================================= |
235 | //function : |
236 | //purpose : |
237 | //======================================================================= |
238 | |
239 | void BiTgte_CurveOnEdge::D3(const Standard_Real U,gp_Pnt& P, |
240 | gp_Vec& V1,gp_Vec& V2,gp_Vec& V3) const |
241 | { |
242 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
243 | } |
244 | |
245 | |
246 | //======================================================================= |
247 | //function : |
248 | //purpose : |
249 | //======================================================================= |
250 | |
251 | gp_Vec BiTgte_CurveOnEdge::DN(const Standard_Real U, |
252 | const Standard_Integer N) const |
253 | { |
254 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
255 | return gp_Vec(); |
256 | } |
257 | |
258 | |
259 | //======================================================================= |
260 | //function : |
261 | //purpose : |
262 | //======================================================================= |
263 | |
264 | Standard_Real BiTgte_CurveOnEdge::Resolution(const Standard_Real R3d) const |
265 | { |
266 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
267 | return 0.; |
268 | } |
269 | |
270 | |
271 | //======================================================================= |
272 | //function : |
273 | //purpose : |
274 | //======================================================================= |
275 | |
276 | GeomAbs_CurveType BiTgte_CurveOnEdge::GetType() const |
277 | { |
278 | return myType; |
279 | } |
280 | |
281 | |
282 | //======================================================================= |
283 | //function : |
284 | //purpose : |
285 | //======================================================================= |
286 | |
287 | gp_Lin BiTgte_CurveOnEdge::Line() const |
288 | { |
289 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
290 | return gp_Lin(); |
291 | } |
292 | |
293 | |
294 | //======================================================================= |
295 | //function : |
296 | //purpose : |
297 | //======================================================================= |
298 | |
299 | gp_Circ BiTgte_CurveOnEdge::Circle() const |
300 | { |
301 | if ( myType != GeomAbs_Circle) { |
302 | Standard_NoSuchObject::Raise("BiTgte_CurveOnEdge::Circle"); |
303 | return gp_Circ(); |
304 | } |
305 | |
306 | return myCirc; |
307 | } |
308 | |
309 | |
310 | //======================================================================= |
311 | //function : |
312 | //purpose : |
313 | //======================================================================= |
314 | |
315 | gp_Elips BiTgte_CurveOnEdge::Ellipse() const |
316 | { |
317 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
318 | return gp_Elips(); |
319 | } |
320 | |
321 | |
322 | //======================================================================= |
323 | //function : |
324 | //purpose : |
325 | //======================================================================= |
326 | |
327 | gp_Hypr BiTgte_CurveOnEdge::Hyperbola() const |
328 | { |
329 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
330 | return gp_Hypr(); |
331 | } |
332 | |
333 | |
334 | //======================================================================= |
335 | //function : |
336 | //purpose : |
337 | //======================================================================= |
338 | |
339 | gp_Parab BiTgte_CurveOnEdge::Parabola() const |
340 | { |
341 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
342 | return gp_Parab(); |
343 | } |
344 | |
345 | |
346 | //======================================================================= |
347 | //function : |
348 | //purpose : |
349 | //======================================================================= |
350 | |
351 | Standard_Integer BiTgte_CurveOnEdge::Degree() const |
352 | { |
353 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
354 | return 0; |
355 | } |
356 | |
357 | |
358 | //======================================================================= |
359 | //function : |
360 | //purpose : |
361 | //======================================================================= |
362 | |
363 | Standard_Boolean BiTgte_CurveOnEdge::IsRational() const |
364 | { |
365 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
366 | return Standard_False; |
367 | } |
368 | |
369 | |
370 | //======================================================================= |
371 | //function : |
372 | //purpose : |
373 | //======================================================================= |
374 | |
375 | Standard_Integer BiTgte_CurveOnEdge::NbPoles() const |
376 | { |
377 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
378 | return 0; |
379 | } |
380 | |
381 | |
382 | //======================================================================= |
383 | //function : |
384 | //purpose : |
385 | //======================================================================= |
386 | |
387 | Standard_Integer BiTgte_CurveOnEdge::NbKnots() const |
388 | { |
389 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
390 | return 0; |
391 | } |
392 | |
393 | |
394 | //======================================================================= |
395 | //function : |
396 | //purpose : |
397 | //======================================================================= |
398 | |
399 | Handle(Geom_BezierCurve) BiTgte_CurveOnEdge::Bezier() const |
400 | { |
401 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
402 | Handle(Geom_BezierCurve) B; |
403 | return B; |
404 | } |
405 | |
406 | |
407 | //======================================================================= |
408 | //function : |
409 | //purpose : |
410 | //======================================================================= |
411 | |
412 | Handle(Geom_BSplineCurve) BiTgte_CurveOnEdge::BSpline() const |
413 | { |
414 | Standard_NotImplemented::Raise("BiTgte_CurveOnEdge"); |
415 | Handle(Geom_BSplineCurve) B; |
416 | return B; |
417 | } |
418 | |
419 | |