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