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