0022627: Change OCCT memory management defaults
[occt.git] / src / IntCurve / IntCurve_UserIntConicCurveGen.gxx
CommitLineData
7fd59977 1// File: IntCurve_UserIntConicCurveGen.gxx
2// Created: Tue Nov 24 14:18:49 1992
3// Author: Laurent BUCHARD
4// <lbr@topsn3>
5
6#include <IntCurve_IntConicConic.hxx>
7#include <gp_Lin2d.hxx>
8#include <gp_Circ2d.hxx>
9#include <gp_Elips2d.hxx>
10#include <gp_Parab2d.hxx>
11#include <gp_Hypr2d.hxx>
12#include <Precision.hxx>
13
14
15
16IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen () {
17 done = Standard_False;
18}
19//-------------------------------------------------------------------------------------
20IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Lin2d& Lin1,
21 const IntRes2d_Domain& D1,
22 const ThePCurve& C2,
23 const IntRes2d_Domain& D2,
24 const Standard_Real TolConf,
25 const Standard_Real Tol) {
26 Perform(Lin1,D1,C2,D2,TolConf,Tol);
27}
28//-------------------------------------------------------------------------------------
29IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Circ2d& Circ1,
30 const IntRes2d_Domain& D1,
31 const ThePCurve& C2,
32 const IntRes2d_Domain& D2,
33 const Standard_Real TolConf,
34 const Standard_Real Tol) {
35 Perform(Circ1,D1,C2,D2,TolConf,Tol);
36}
37//-------------------------------------------------------------------------------------
38IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Parab2d& Parab1,
39 const IntRes2d_Domain& D1,
40 const ThePCurve& C2,
41 const IntRes2d_Domain& D2,
42 const Standard_Real TolConf,
43 const Standard_Real Tol) {
44 Perform(Parab1,D1,C2,D2,TolConf,Tol);
45}
46//-------------------------------------------------------------------------------------
47IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Elips2d& Elips1,
48 const IntRes2d_Domain& D1,
49 const ThePCurve& C2,
50 const IntRes2d_Domain& D2,
51 const Standard_Real TolConf,
52 const Standard_Real Tol) {
53 Perform(Elips1,D1,C2,D2,TolConf,Tol);
54}
55//-------------------------------------------------------------------------------------
56IntCurve_UserIntConicCurveGen::IntCurve_UserIntConicCurveGen (const gp_Hypr2d& Hyper1,
57 const IntRes2d_Domain& D1,
58 const ThePCurve& C2,
59 const IntRes2d_Domain& D2,
60 const Standard_Real TolConf,
61 const Standard_Real Tol) {
62 Perform(Hyper1,D1,C2,D2,TolConf,Tol);
63}
64//-------------------------------------------------------------------------------------
65
66
67//----------------------------------------------------------------------
68void IntCurve_UserIntConicCurveGen::Perform (const gp_Lin2d& Lin1,
69 const IntRes2d_Domain& D1,
70 const ThePCurve& C2,
71 const IntRes2d_Domain& D2,
72 const Standard_Real TolConf,
73 const Standard_Real Tol) {
74 this->ResetFields();
75 Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
76 if(NbInterC2 > 1) {
77 Standard_Real ParamInf,ParamSup;
78 Standard_Real D2FirstParam = D2.FirstParameter();
79 Standard_Real D2LastParam = D2.LastParameter();
80 Standard_Boolean Ok = Standard_True;
81 param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
82 param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
83 param2inf = ThePCurveTool::FirstParameter(C2);
84 param2sup = ThePCurveTool::LastParameter(C2);
85 IntRes2d_Domain DomainC2NumInter;
86
87 TColStd_Array1OfReal Tab2(1,NbInterC2+1);
88 ThePCurveTool::Intervals(C2,Tab2);
89
90 for(Standard_Integer NumInterC2=1; Ok && (NumInterC2 <= NbInterC2);NumInterC2++) {
91 ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
92 if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
93 else {
94 if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
95 if(ParamSup > D2LastParam) ParamSup = D2LastParam;
96 if((ParamSup - ParamInf) > RealEpsilon()) {
97 DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
98 ParamInf,
99 D2.FirstTolerance(),
100 ThePCurveTool::Value(C2,ParamSup),
101 ParamSup,
102 D2.LastTolerance());
103 InternalPerform(Lin1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
104 }
105 }
106 }
107 }
108 else {
109 InternalPerform(Lin1,D1,C2,D2,TolConf,Tol,Standard_False);
110 }
111}
112//--------------------------------------------------------------------------------
113void IntCurve_UserIntConicCurveGen::Perform (const gp_Circ2d& Circ1,
114 const IntRes2d_Domain& D1,
115 const ThePCurve& C2,
116 const IntRes2d_Domain& D2,
117 const Standard_Real TolConf,
118 const Standard_Real Tol) {
119 this->ResetFields();
120 Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
121 if(NbInterC2 > 1) {
122 Standard_Real ParamInf,ParamSup;
123 Standard_Real D2FirstParam = D2.FirstParameter();
124 Standard_Real D2LastParam = D2.LastParameter();
125 Standard_Boolean Ok = Standard_True;
126
127 param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
128 param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
129 param2inf = ThePCurveTool::FirstParameter(C2);
130 param2sup = ThePCurveTool::LastParameter(C2);
131 IntRes2d_Domain DomainC2NumInter;
132
133 TColStd_Array1OfReal Tab2(1,NbInterC2+1);
134 ThePCurveTool::Intervals(C2,Tab2);
135
136
137 for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) {
138 ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
139 if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
140 else {
141 if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
142 if(ParamSup > D2LastParam) ParamSup = D2LastParam;
143 if((ParamSup - ParamInf) > RealEpsilon()) {
144 DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
145 ParamInf,
146 D2.FirstTolerance(),
147 ThePCurveTool::Value(C2,ParamSup),
148 ParamSup,
149 D2.LastTolerance());
150 InternalPerform(Circ1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
151 }
152 }
153 }
154 }
155 else {
156 InternalPerform(Circ1,D1,C2,D2,TolConf,Tol,Standard_False);
157 }
158}
159//--------------------------------------------------------------------------------
160void IntCurve_UserIntConicCurveGen::Perform (const gp_Parab2d& Parab1,
161 const IntRes2d_Domain& D1,
162 const ThePCurve& C2,
163 const IntRes2d_Domain& D2,
164 const Standard_Real TolConf,
165 const Standard_Real Tol) {
166 this->ResetFields();
167 Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
168 if(NbInterC2 > 1) {
169 Standard_Real ParamInf,ParamSup;
170 Standard_Real D2FirstParam = D2.FirstParameter();
171 Standard_Real D2LastParam = D2.LastParameter();
172 Standard_Boolean Ok = Standard_True;
173 param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
174 param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
175 param2inf = ThePCurveTool::FirstParameter(C2);
176 param2sup = ThePCurveTool::LastParameter(C2);
177 IntRes2d_Domain DomainC2NumInter;
178
179 TColStd_Array1OfReal Tab2(1,NbInterC2+1);
180 ThePCurveTool::Intervals(C2,Tab2);
181
182 for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) {
183 ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
184 if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
185 else {
186 if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
187 if(ParamSup > D2LastParam) ParamSup = D2LastParam;
188 if((ParamSup - ParamInf) > RealEpsilon()) {
189 DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
190 ParamInf,
191 D2.FirstTolerance(),
192 ThePCurveTool::Value(C2,ParamSup),
193 ParamSup,
194 D2.LastTolerance());
195 InternalPerform(Parab1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
196 }
197 }
198 }
199 }
200 else {
201 InternalPerform(Parab1,D1,C2,D2,TolConf,Tol,Standard_False);
202 }
203}
204//--------------------------------------------------------------------------------
205void IntCurve_UserIntConicCurveGen::Perform (const gp_Elips2d& Elips1,
206 const IntRes2d_Domain& D1,
207 const ThePCurve& C2,
208 const IntRes2d_Domain& D2,
209 const Standard_Real TolConf,
210 const Standard_Real Tol) {
211 this->ResetFields();
212 Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
213 if(NbInterC2 > 1) {
214 Standard_Real ParamInf,ParamSup;
215 Standard_Real D2FirstParam = D2.FirstParameter();
216 Standard_Real D2LastParam = D2.LastParameter();
217 Standard_Boolean Ok = Standard_True;
218 param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
219 param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
220 param2inf = ThePCurveTool::FirstParameter(C2);
221 param2sup = ThePCurveTool::LastParameter(C2);
222 IntRes2d_Domain DomainC2NumInter;
223
224 TColStd_Array1OfReal Tab2(1,NbInterC2+1);
225 ThePCurveTool::Intervals(C2,Tab2);
226
227 for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) {
228 ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
229 if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
230 else {
231 if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
232 if(ParamSup > D2LastParam) ParamSup = D2LastParam;
233 if((ParamSup - ParamInf) > RealEpsilon()) {
234 DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
235 ParamInf,
236 D2.FirstTolerance(),
237 ThePCurveTool::Value(C2,ParamSup),
238 ParamSup,
239 D2.LastTolerance());
240 InternalPerform(Elips1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
241 }
242 }
243 }
244 }
245 else {
246 InternalPerform(Elips1,D1,C2,D2,TolConf,Tol,Standard_False);
247 }
248}
249//--------------------------------------------------------------------------------
250void IntCurve_UserIntConicCurveGen::Perform (const gp_Hypr2d& Hyper1,
251 const IntRes2d_Domain& D1,
252 const ThePCurve& C2,
253 const IntRes2d_Domain& D2,
254 const Standard_Real TolConf,
255 const Standard_Real Tol) {
256 this->ResetFields();
257 Standard_Integer NbInterC2 = ThePCurveTool::NbIntervals(C2);
258 if(NbInterC2 > 1) {
259 Standard_Real ParamInf,ParamSup;
260 Standard_Real D2FirstParam = D2.FirstParameter();
261 Standard_Real D2LastParam = D2.LastParameter();
262 Standard_Boolean Ok = Standard_True;
263 param1inf = (D1.HasFirstPoint()) ? D1.FirstParameter() : -Precision::Infinite();
264 param1sup = (D1.HasLastPoint()) ? D1.LastParameter() : Precision::Infinite();
265 param2inf = ThePCurveTool::FirstParameter(C2);
266 param2sup = ThePCurveTool::LastParameter(C2);
267 IntRes2d_Domain DomainC2NumInter;
268
269 TColStd_Array1OfReal Tab2(1,NbInterC2+1);
270 ThePCurveTool::Intervals(C2,Tab2);
271
272 for(Standard_Integer NumInterC2=1; Ok && (NumInterC2<=NbInterC2);NumInterC2++) {
273 ThePCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
274 if((ParamInf > D2LastParam)||(ParamSup < D2FirstParam)) Ok=Standard_False;
275 else {
276 if(ParamInf < D2FirstParam) ParamInf = D2FirstParam;
277 if(ParamSup > D2LastParam) ParamSup = D2LastParam;
278 if((ParamSup - ParamInf) > RealEpsilon()) {
279 DomainC2NumInter.SetValues(ThePCurveTool::Value(C2,ParamInf),
280 ParamInf,
281 D2.FirstTolerance(),
282 ThePCurveTool::Value(C2,ParamSup),
283 ParamSup,
284 D2.LastTolerance());
285 InternalPerform(Hyper1,D1,C2,DomainC2NumInter,TolConf,Tol,Standard_True);
286 }
287 }
288 }
289 }
290 else {
291 InternalPerform(Hyper1,D1,C2,D2,TolConf,Tol,Standard_False);
292 }
293}
294
295//----------------------------------------------------------------------
296//-- InternalPerform
297//-- Suppose des Courbes Lin...Hypr
298//-- Si Composite == True
299//-- Les Resultats sont Ajoutes
300//-- Sinon
301//-- Les Resultats sont Copies
302//----------------------------------------------------------------------
303void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Lin2d& Lin1,
304 const IntRes2d_Domain& D1,
305 const ThePCurve& C2,
306 const IntRes2d_Domain& D2,
307 const Standard_Real TolConf,
308 const Standard_Real Tol,
309 const Standard_Boolean Composite) {
310
311 GeomAbs_CurveType typ2 = ThePCurveTool::TheType(C2);
312
313 switch (typ2) {
314
315 case GeomAbs_Line:
316 {
317 intconiconi.SetReversedParameters(Standard_False);
318 intconiconi.Perform(Lin1,D1,ThePCurveTool::Line(C2),D2,TolConf,Tol);
319 if(Composite) { this->Append(intconiconi,
320 param1inf,
321 param1sup,
322 param2inf,
323 param2sup); }
324 else { this->SetValues(intconiconi); }
325 }
326 break;
327
328 case GeomAbs_Circle:
329 {
330 intconiconi.SetReversedParameters(Standard_False);
331 intconiconi.Perform(Lin1,D1,ThePCurveTool::Circle(C2),D2,TolConf,Tol);
332 if(Composite) { this->Append(intconiconi,
333 param1inf,
334 param1sup,
335 param2inf,
336 param2sup); }
337 else { this->SetValues(intconiconi); }
338 }
339 break;
340
341 case GeomAbs_Ellipse:
342 {
343 intconiconi.SetReversedParameters(Standard_False);
344 intconiconi.Perform(Lin1,D1,ThePCurveTool::Ellipse(C2),D2,TolConf,Tol);
345 if(Composite) { this->Append(intconiconi,
346 param1inf,
347 param1sup,
348 param2inf,
349 param2sup); }
350 else { this->SetValues(intconiconi); }
351 }
352 break;
353
354 case GeomAbs_Parabola:
355 {
356 intconiconi.SetReversedParameters(Standard_False);
357 intconiconi.Perform(Lin1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
358 if(Composite) { this->Append(intconiconi,
359 param1inf,
360 param1sup,
361 param2inf,
362 param2sup); }
363 else { this->SetValues(intconiconi); }
364 }
365 break;
366
367 case GeomAbs_Hyperbola:
368 {
369 intconiconi.SetReversedParameters(Standard_False);
370 intconiconi.Perform(Lin1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
371 if(Composite) { this->Append(intconiconi,
372 param1inf,
373 param1sup,
374 param2inf,
375 param2sup); }
376 else { this->SetValues(intconiconi); }
377 }
378 break;
379
380 case GeomAbs_BezierCurve:
381 case GeomAbs_BSplineCurve:
382 case GeomAbs_OtherCurve:
383 {
384 intconicurv.SetReversedParameters(Standard_False);
385 intconicurv.Perform(Lin1,D1,C2,D2,TolConf,Tol);
386 if(Composite) { this->Append(intconicurv,
387 param1inf,
388 param1sup,
389 param2inf,
390 param2sup); }
391 else { this->SetValues(intconicurv); }
392 }
393 break;
394 }
395}
396
397//----------------------------------------------------------------------
398void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Circ2d& Circ1,
399 const IntRes2d_Domain& D1,
400 const ThePCurve& C2,
401 const IntRes2d_Domain& D2,
402 const Standard_Real TolConf,
403 const Standard_Real Tol,
404 const Standard_Boolean Composite) {
405
406 GeomAbs_CurveType typ2 = ThePCurveTool::TheType(C2);
407
408 switch (typ2) {
409
410 case GeomAbs_Line:
411 {
412 intconiconi.SetReversedParameters(Standard_True);
413 intconiconi.Perform(ThePCurveTool::Line(C2),D2,Circ1,D1,TolConf,Tol);
414 if(Composite) { this->Append(intconiconi,
415 param1inf,
416 param1sup,
417 param2inf,
418 param2sup); }
419 else { this->SetValues(intconiconi); }
420 }
421 break;
422
423 case GeomAbs_Circle:
424 {
425 intconiconi.SetReversedParameters(Standard_False);
426 intconiconi.Perform(Circ1,D1,ThePCurveTool::Circle(C2),D2,TolConf,Tol);
427 if(Composite) { this->Append(intconiconi,
428 param1inf,
429 param1sup,
430 param2inf,
431 param2sup); }
432 else { this->SetValues(intconiconi); }
433 }
434 break;
435
436 case GeomAbs_Ellipse:
437 {
438 intconiconi.SetReversedParameters(Standard_False);
439 intconiconi.Perform(Circ1,D1,ThePCurveTool::Ellipse(C2),D2,TolConf,Tol);
440 if(Composite) { this->Append(intconiconi,
441 param1inf,
442 param1sup,
443 param2inf,
444 param2sup); }
445 else { this->SetValues(intconiconi); }
446 }
447 break;
448
449 case GeomAbs_Parabola:
450 {
451 intconiconi.SetReversedParameters(Standard_False);
452 intconiconi.Perform(Circ1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
453 if(Composite) { this->Append(intconiconi,
454 param1inf,
455 param1sup,
456 param2inf,
457 param2sup); }
458 else { this->SetValues(intconiconi); }
459 }
460 break;
461
462 case GeomAbs_Hyperbola:
463 {
464 intconiconi.SetReversedParameters(Standard_False);
465 intconiconi.Perform(Circ1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
466 if(Composite) { this->Append(intconiconi,
467 param1inf,
468 param1sup,
469 param2inf,
470 param2sup); }
471 else { this->SetValues(intconiconi); }
472 }
473 break;
474
475 case GeomAbs_BezierCurve:
476 case GeomAbs_BSplineCurve:
477 case GeomAbs_OtherCurve:
478 {
479 intconicurv.SetReversedParameters(Standard_False);
480 intconicurv.Perform(Circ1,D1,C2,D2,TolConf,Tol);
481 if(Composite) { this->Append(intconicurv,
482 param1inf,
483 param1sup,
484 param2inf,
485 param2sup); }
486 else { this->SetValues(intconicurv); }
487 }
488 break;
489 }
490}
491//----------------------------------------------------------------------
492void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Elips2d& Elips1,
493 const IntRes2d_Domain& D1,
494 const ThePCurve& C2,
495 const IntRes2d_Domain& D2,
496 const Standard_Real TolConf,
497 const Standard_Real Tol,
498 const Standard_Boolean Composite) {
499
500 GeomAbs_CurveType typ2 = ThePCurveTool::TheType(C2);
501
502 switch (typ2) {
503
504 case GeomAbs_Line:
505 {
506 intconiconi.SetReversedParameters(Standard_True);
507 intconiconi.Perform(ThePCurveTool::Line(C2),D2,Elips1,D1,TolConf,Tol);
508 if(Composite) { this->Append(intconiconi,
509 param1inf,
510 param1sup,
511 param2inf,
512 param2sup); }
513 else { this->SetValues(intconiconi); }
514 }
515 break;
516
517 case GeomAbs_Circle:
518 {
519 intconiconi.SetReversedParameters(Standard_True);
520 intconiconi.Perform(ThePCurveTool::Circle(C2),D2,Elips1,D1,TolConf,Tol);
521 if(Composite) { this->Append(intconiconi,
522 param1inf,
523 param1sup,
524 param2inf,
525 param2sup); }
526 else { this->SetValues(intconiconi); }
527 }
528 break;
529
530 case GeomAbs_Ellipse:
531 {
532 intconiconi.SetReversedParameters(Standard_False);
533 intconiconi.Perform(Elips1,D1,ThePCurveTool::Ellipse(C2),D2,TolConf,Tol);
534 if(Composite) { this->Append(intconiconi,
535 param1inf,
536 param1sup,
537 param2inf,
538 param2sup); }
539 else { this->SetValues(intconiconi); }
540 }
541 break;
542
543 case GeomAbs_Parabola:
544 {
545 intconiconi.SetReversedParameters(Standard_False);
546 intconiconi.Perform(Elips1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
547 if(Composite) { this->Append(intconiconi,
548 param1inf,
549 param1sup,
550 param2inf,
551 param2sup); }
552 else { this->SetValues(intconiconi); }
553 }
554 break;
555
556 case GeomAbs_Hyperbola:
557 {
558 intconiconi.SetReversedParameters(Standard_False);
559 intconiconi.Perform(Elips1,D1,ThePCurveTool::Hyperbola(C2),D2,
560 TolConf,Tol);
561 if(Composite) { this->Append(intconiconi,
562 param1inf,
563 param1sup,
564 param2inf,
565 param2sup); }
566 else { this->SetValues(intconiconi); }
567 }
568 break;
569
570 case GeomAbs_BezierCurve:
571 case GeomAbs_BSplineCurve:
572 case GeomAbs_OtherCurve:
573 {
574 intconicurv.SetReversedParameters(Standard_False);
575 intconicurv.Perform(Elips1,D1,C2,D2,TolConf,Tol);
576 if(Composite) { this->Append(intconicurv,
577 param1inf,
578 param1sup,
579 param2inf,
580 param2sup); }
581 else { this->SetValues(intconicurv); }
582 }
583 break;
584 }
585}
586
587//----------------------------------------------------------------------
588void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Parab2d& Parab1,
589 const IntRes2d_Domain& D1,
590 const ThePCurve& C2,
591 const IntRes2d_Domain& D2,
592 const Standard_Real TolConf,
593 const Standard_Real Tol,
594 const Standard_Boolean Composite) {
595
596 GeomAbs_CurveType typ2 = ThePCurveTool::TheType(C2);
597
598 switch (typ2) {
599
600 case GeomAbs_Line:
601 {
602 intconiconi.SetReversedParameters(Standard_True);
603 intconiconi.Perform(ThePCurveTool::Line(C2),D2,Parab1,D1,TolConf,Tol);
604 if(Composite) { this->Append(intconiconi,
605 param1inf,
606 param1sup,
607 param2inf,
608 param2sup); }
609 else { this->SetValues(intconiconi); }
610 }
611 break;
612
613 case GeomAbs_Circle:
614 {
615 intconiconi.SetReversedParameters(Standard_True);
616 intconiconi.Perform(ThePCurveTool::Circle(C2),D2,Parab1,D1,TolConf,Tol);
617 if(Composite) { this->Append(intconiconi,
618 param1inf,
619 param1sup,
620 param2inf,
621 param2sup); }
622 else { this->SetValues(intconiconi); }
623 }
624 break;
625
626 case GeomAbs_Ellipse:
627 {
628 intconiconi.SetReversedParameters(Standard_True);
629 intconiconi.Perform(ThePCurveTool::Ellipse(C2),D2,Parab1,D1,TolConf,Tol);
630 if(Composite) { this->Append(intconiconi,
631 param1inf,
632 param1sup,
633 param2inf,
634 param2sup); }
635 else { this->SetValues(intconiconi); }
636 }
637 break;
638
639 case GeomAbs_Parabola:
640 {
641 intconiconi.SetReversedParameters(Standard_False);
642 intconiconi.Perform(Parab1,D1,ThePCurveTool::Parabola(C2),D2,TolConf,Tol);
643 if(Composite) { this->Append(intconiconi,
644 param1inf,
645 param1sup,
646 param2inf,
647 param2sup); }
648 else { this->SetValues(intconiconi); }
649 }
650 break;
651
652 case GeomAbs_Hyperbola:
653 {
654 intconiconi.SetReversedParameters(Standard_False);
655 intconiconi.Perform(Parab1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
656 if(Composite) { this->Append(intconiconi,
657 param1inf,
658 param1sup,
659 param2inf,
660 param2sup); }
661 else { this->SetValues(intconiconi); }
662 }
663 break;
664
665 case GeomAbs_BezierCurve:
666 case GeomAbs_BSplineCurve:
667 case GeomAbs_OtherCurve:
668 {
669 intconicurv.SetReversedParameters(Standard_False);
670 intconicurv.Perform(Parab1,D1,C2,D2,TolConf,Tol);
671 if(Composite) { this->Append(intconicurv,
672 param1inf,
673 param1sup,
674 param2inf,
675 param2sup); }
676 else { this->SetValues(intconicurv); }
677 }
678 break;
679 }
680}
681
682//----------------------------------------------------------------------
683void IntCurve_UserIntConicCurveGen::InternalPerform (const gp_Hypr2d& Hyper1,
684 const IntRes2d_Domain& D1,
685 const ThePCurve& C2,
686 const IntRes2d_Domain& D2,
687 const Standard_Real TolConf,
688 const Standard_Real Tol,
689 const Standard_Boolean Composite) {
690
691 GeomAbs_CurveType typ2 = ThePCurveTool::TheType(C2);
692
693 switch (typ2) {
694
695 case GeomAbs_Line:
696 {
697 intconiconi.SetReversedParameters(Standard_True);
698 intconiconi.Perform(ThePCurveTool::Line(C2),D2,Hyper1,D1,TolConf,Tol);
699 if(Composite) { this->Append(intconiconi,
700 param1inf,
701 param1sup,
702 param2inf,
703 param2sup); }
704 else { this->SetValues(intconiconi); }
705 }
706 break;
707
708 case GeomAbs_Circle:
709 {
710 intconiconi.SetReversedParameters(Standard_True);
711 intconiconi.Perform(ThePCurveTool::Circle(C2),D2,Hyper1,D1,TolConf,Tol);
712 if(Composite) { this->Append(intconiconi,
713 param1inf,
714 param1sup,
715 param2inf,
716 param2sup); }
717 else { this->SetValues(intconiconi); }
718 }
719 break;
720
721 case GeomAbs_Ellipse:
722 {
723 intconiconi.SetReversedParameters(Standard_True);
724 intconiconi.Perform(ThePCurveTool::Ellipse(C2),D2,Hyper1,D1,TolConf,Tol);
725 if(Composite) { this->Append(intconiconi,
726 param1inf,
727 param1sup,
728 param2inf,
729 param2sup); }
730 else { this->SetValues(intconiconi); }
731 }
732 break;
733
734 case GeomAbs_Parabola:
735 {
736 intconiconi.SetReversedParameters(Standard_True);
737 intconiconi.Perform(ThePCurveTool::Parabola(C2),D2,Hyper1,D1,TolConf,Tol);
738 if(Composite) { this->Append(intconiconi,
739 param1inf,
740 param1sup,
741 param2inf,
742 param2sup); }
743 else { this->SetValues(intconiconi); }
744 }
745 break;
746
747 case GeomAbs_Hyperbola:
748 {
749 intconiconi.SetReversedParameters(Standard_False);
750 intconiconi.Perform(Hyper1,D1,ThePCurveTool::Hyperbola(C2),D2,TolConf,Tol);
751 if(Composite) { this->Append(intconiconi,
752 param1inf,
753 param1sup,
754 param2inf,
755 param2sup); }
756 else { this->SetValues(intconiconi); }
757 }
758 break;
759
760 case GeomAbs_BezierCurve:
761 case GeomAbs_BSplineCurve:
762 case GeomAbs_OtherCurve:
763 {
764 intconicurv.SetReversedParameters(Standard_False);
765 intconicurv.Perform(Hyper1,D1,
766 C2,D2,TolConf,Tol);
767 if(Composite) { this->Append(intconicurv,
768 param1inf,
769 param1sup,
770 param2inf,
771 param2sup); }
772 else { this->SetValues(intconicurv); }
773 }
774 break;
775 }
776}
777//--------------------------------------------------------------------------------