0028389: Data Exchange - Import of STEP Saved Views and Clipping Planes
[occt.git] / src / Extrema / Extrema_ExtElCS.cxx
CommitLineData
b311480e 1// Copyright (c) 1995-1999 Matra Datavision
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
b311480e 5//
d5f74e42 6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
b311480e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
7fd59977 14
15// Modified by skv - Thu Jul 7 14:37:05 2005 OCC9134
16
42cf5bc1 17#include <ElCLib.hxx>
18#include <ElSLib.hxx>
7fd59977 19#include <Extrema_ExtElC.hxx>
42cf5bc1 20#include <Extrema_ExtElCS.hxx>
21#include <Extrema_ExtPElC.hxx>
22#include <Extrema_ExtPElS.hxx>
7fd59977 23#include <Extrema_POnCurv.hxx>
42cf5bc1 24#include <Extrema_POnSurf.hxx>
25#include <gp_Circ.hxx>
26#include <gp_Cone.hxx>
27#include <gp_Cylinder.hxx>
28#include <gp_Hypr.hxx>
29#include <gp_Lin.hxx>
30#include <gp_Pln.hxx>
31#include <gp_Sphere.hxx>
32#include <gp_Torus.hxx>
7fd59977 33#include <gp_Vec.hxx>
f34cd0d1 34#include <IntAna_IntConicQuad.hxx>
42cf5bc1 35#include <IntAna_Quadric.hxx>
36#include <Precision.hxx>
37#include <Standard_NotImplemented.hxx>
38#include <Standard_OutOfRange.hxx>
39#include <StdFail_InfiniteSolutions.hxx>
40#include <StdFail_NotDone.hxx>
7fd59977 41
42Extrema_ExtElCS::Extrema_ExtElCS()
43{
44 myDone = Standard_False;
45 myIsPar = Standard_False;
46}
47
48
49Extrema_ExtElCS::Extrema_ExtElCS(const gp_Lin& C,
50 const gp_Pln& S)
51{
52 Perform(C, S);
53}
54
55
56
57void Extrema_ExtElCS::Perform(const gp_Lin& C,
58 const gp_Pln& S)
59{
60 myDone = Standard_True;
61 myIsPar = Standard_False;
62
63 if (C.Direction().IsNormal(S.Axis().Direction(),
64 Precision::Angular())) {
65 mySqDist = new TColStd_HArray1OfReal(1, 1);
66 mySqDist->SetValue(1, S.SquareDistance(C));
67 myIsPar = Standard_True;
68 }
69 else {
70 myNbExt = 0;
71 }
72
73}
74
75
76Extrema_ExtElCS::Extrema_ExtElCS(const gp_Lin& C,
77 const gp_Cylinder& S)
78{
79 Perform(C, S);
80}
81
82
83
84void Extrema_ExtElCS::Perform(const gp_Lin& C,
db914841 85 const gp_Cylinder& S)
7fd59977 86{
87 myDone = Standard_False;
88 myNbExt = 0;
89 myIsPar = Standard_False;
90
91 gp_Ax3 Pos = S.Position();
f34cd0d1 92 gp_Pnt Origin = Pos.Location();
93 gp_Pnt LineOrig = C.Location();
94
7fd59977 95 Standard_Real radius = S.Radius();
96 Extrema_ExtElC Extrem(gp_Lin(Pos.Axis()), C, Precision::Angular());
97 if (Extrem.IsParallel()) {
db914841 98 // Line direction is similar to cylinder axis of rotation.
7fd59977 99 mySqDist = new TColStd_HArray1OfReal(1, 1);
f34cd0d1 100 myPoint1 = new Extrema_HArray1OfPOnCurv(1, 1);
101 myPoint2 = new Extrema_HArray1OfPOnSurf(1, 1);
102 Standard_Real aDist = sqrt(Extrem.SquareDistance(1)) - radius;
7fd59977 103 mySqDist->SetValue(1, aDist * aDist);
f34cd0d1 104 Standard_Real u, v, w;
105 gp_Vec aVec(LineOrig, Origin);
106 gp_Vec aDirVec(C.Direction());
107 w = aVec*aDirVec;
108 gp_Pnt LinPoint = LineOrig.Translated(w * aDirVec);
109 Extrema_POnCurv PonC(w, LinPoint);
110 myPoint1->SetValue(1, PonC);
111 gp_Pnt CylPoint;
112 gp_Vec OrigToLine(Origin, LinPoint);
113 if (OrigToLine.Magnitude() <= gp::Resolution())
114 {
115 u = 0.;
116 v = 0.;
117 CylPoint = ElSLib::Value(u, v, S);
118 }
119 else
120 {
121 OrigToLine.Normalize();
122 CylPoint = Origin.Translated(radius * OrigToLine);
123 ElSLib::CylinderParameters(Pos, radius, CylPoint, u, v);
124 }
125 Extrema_POnSurf PonS(u, v, CylPoint);
126 myPoint2->SetValue(1, PonS);
7fd59977 127 myDone = Standard_True;
128 myIsPar = Standard_True;
129 }
130 else {
db914841 131 Standard_Integer i, aStartIdx = 0;
132
f34cd0d1 133 Extrema_POnCurv myPOnC1, myPOnC2;
134 Extrem.Points(1, myPOnC1, myPOnC2);
135 gp_Pnt PonAxis = myPOnC1.Value();
136 gp_Pnt PC = myPOnC2.Value();
137
f34cd0d1 138 // line intersects the cylinder
db914841 139 if (radius - PonAxis.Distance(PC) > Precision::PConfusion())
f34cd0d1 140 {
141 IntAna_Quadric theQuadric(S);
142 IntAna_IntConicQuad Inters(C, theQuadric);
143 if (Inters.IsDone())
144 {
145 myNbExt = Inters.NbPoints();
db914841 146 aStartIdx = myNbExt;
f34cd0d1 147 if (myNbExt > 0)
148 {
db914841 149 // Not more than 2 additional points from perpendiculars.
150 mySqDist = new TColStd_HArray1OfReal(1, myNbExt + 2);
151 myPoint1 = new Extrema_HArray1OfPOnCurv(1, myNbExt + 2);
152 myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt + 2);
f34cd0d1 153 Standard_Real u, v, w;
154 for (i = 1; i <= myNbExt; i++)
155 {
156 mySqDist->SetValue(i, 0.);
157 gp_Pnt P_int = Inters.Point(i);
158 w = Inters.ParamOnConic(i);
159 Extrema_POnCurv PonC(w, P_int);
160 myPoint1->SetValue(i, PonC);
161 ElSLib::CylinderParameters(Pos, radius, P_int, u, v);
162 Extrema_POnSurf PonS(u, v, P_int);
163 myPoint2->SetValue(i, PonS);
164 }
165 }
7fd59977 166 }
7fd59977 167 }
db914841 168
169 // line is tangent or outside of the cylinder
170 Extrema_ExtPElS ExPS(PC, S, Precision::Confusion());
171 if (ExPS.IsDone())
172 {
173 if (aStartIdx == 0)
174 {
175 myNbExt = ExPS.NbExt();
176 mySqDist = new TColStd_HArray1OfReal(1, myNbExt);
177 myPoint1 = new Extrema_HArray1OfPOnCurv(1, myNbExt);
178 myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt);
179 }
180 else
181 myNbExt += ExPS.NbExt();
182
183 for (i = aStartIdx + 1; i <= myNbExt; i++) {
184 myPoint1->SetValue(i, myPOnC2);
185 myPoint2->SetValue(i, ExPS.Point(i - aStartIdx));
186 mySqDist->SetValue(i,(myPOnC2.Value()).SquareDistance(ExPS.Point(i - aStartIdx).Value()));
187 }
188 }
f34cd0d1 189 myDone = Standard_True;
7fd59977 190 }
191
192}
193
194
195
196Extrema_ExtElCS::Extrema_ExtElCS(const gp_Lin& C,
197 const gp_Cone& S)
198{
199 Perform(C, S);
200}
201
202
203
204//void Extrema_ExtElCS::Perform(const gp_Lin& C,
205// const gp_Cone& S)
206void Extrema_ExtElCS::Perform(const gp_Lin& ,
207 const gp_Cone& )
208{
209 Standard_NotImplemented::Raise();
210
211}
212
213
214
215Extrema_ExtElCS::Extrema_ExtElCS(const gp_Lin& C,
216 const gp_Sphere& S)
217{
218 Perform(C, S);
219}
220
221
222
223void Extrema_ExtElCS::Perform(const gp_Lin& C,
db914841 224 const gp_Sphere& S)
7fd59977 225{
db914841 226 // In case of intersection - return four points:
227 // 2 intersection points and 2 perpendicular.
228 // No intersection - only min and max.
229
7fd59977 230 myDone = Standard_False;
231 myNbExt = 0;
232 myIsPar = Standard_False;
db914841 233 Standard_Integer aStartIdx = 0;
7fd59977 234
db914841 235 gp_Pnt aCenter = S.Location();
7fd59977 236
db914841 237 Extrema_ExtPElC Extrem(aCenter, C, Precision::Angular(), RealFirst(), RealLast());
7fd59977 238
239 Standard_Integer i;
db914841 240 if (Extrem.IsDone() &&
241 Extrem.NbExt() > 0)
242 {
7fd59977 243 Extrema_POnCurv myPOnC1 = Extrem.Point(1);
db914841 244 if (myPOnC1.Value().Distance(aCenter) <= S.Radius())
245 {
246 IntAna_IntConicQuad aLinSphere(C, S);
247 if (aLinSphere.IsDone())
248 {
249 myNbExt = aLinSphere.NbPoints();
250 aStartIdx = myNbExt;
251 // Not more than 2 additional points from perpendiculars.
252 mySqDist = new TColStd_HArray1OfReal(1, myNbExt + 2);
253 myPoint1 = new Extrema_HArray1OfPOnCurv(1, myNbExt + 2);
254 myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt + 2);
255
256 for (i = 1; i <= myNbExt; i++)
257 {
258 Extrema_POnCurv aCPnt(aLinSphere.ParamOnConic(i), aLinSphere.Point(i));
259
260 Standard_Real u,v;
261 ElSLib::Parameters(S, aLinSphere.Point(i), u, v);
262 Extrema_POnSurf aSPnt(u, v, aLinSphere.Point(i));
263
264 myPoint1->SetValue(i, aCPnt);
265 myPoint2->SetValue(i, aSPnt);
266 mySqDist->SetValue(i,(aCPnt.Value()).SquareDistance(aSPnt.Value()));
267 }
268 }
269 }
270
7fd59977 271 Extrema_ExtPElS ExPS(myPOnC1.Value(), S, Precision::Confusion());
db914841 272 if (ExPS.IsDone())
273 {
274 if (aStartIdx == 0)
275 {
276 myNbExt = ExPS.NbExt();
277 mySqDist = new TColStd_HArray1OfReal(1, myNbExt);
278 myPoint1 = new Extrema_HArray1OfPOnCurv(1, myNbExt);
279 myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt);
280 }
281 else
282 myNbExt += ExPS.NbExt();
283
284 for (i = aStartIdx + 1; i <= myNbExt; i++)
285 {
286 myPoint1->SetValue(i, myPOnC1);
287 myPoint2->SetValue(i, ExPS.Point(i - aStartIdx));
288 mySqDist->SetValue(i,(myPOnC1.Value()).SquareDistance(ExPS.Point(i - aStartIdx).Value()));
7fd59977 289 }
290 }
291 }
db914841 292 myDone = Standard_True;
7fd59977 293}
294
295
296Extrema_ExtElCS::Extrema_ExtElCS(const gp_Lin& C,
297 const gp_Torus& S)
298{
299 Perform(C, S);
300}
301
302
303
304//void Extrema_ExtElCS::Perform(const gp_Lin& C,
305// const gp_Torus& S)
306void Extrema_ExtElCS::Perform(const gp_Lin& ,
307 const gp_Torus& )
308{
309 Standard_NotImplemented::Raise();
310
311}
312
313
314// Circle-?
315
316Extrema_ExtElCS::Extrema_ExtElCS(const gp_Circ& C,
317 const gp_Pln& S)
318{
319 Perform(C, S);
320}
321
322
323
9dfbbfe6 324void Extrema_ExtElCS::Perform(const gp_Circ& C,
325 const gp_Pln& S)
7fd59977 326{
9dfbbfe6 327 myDone = Standard_True;
328 myIsPar = Standard_False;
329
330 gp_Ax2 Pos = C.Position();
331 gp_Dir NCirc = Pos.Direction();
332 gp_Dir NPln = S.Axis().Direction();
333
334 if (NCirc.IsParallel(NPln, Precision::Angular())) {
335
336 mySqDist = new TColStd_HArray1OfReal(1, 1);
337 mySqDist->SetValue(1, S.SquareDistance(C.Location()));
338 myIsPar = Standard_True;
339
340 }
341 else {
342
343 gp_Dir ExtLine = NCirc ^ NPln;
344 ExtLine = ExtLine ^ NCirc;
345 //
346 gp_Dir XDir = Pos.XDirection();
347 Standard_Real T[2];
348 T[0] = XDir.AngleWithRef(ExtLine, NCirc);
349 if(T[0] < 0.)
350 {
351 //Put in period
352 T[0] += M_PI;
353 }
354 T[1] = T[0] + M_PI;
355 //
356 myNbExt = 2;
357 //Check intersection
358 IntAna_IntConicQuad anInter(C, S,
359 Precision::Angular(),
360 Precision::Confusion());
361 if(anInter.IsDone())
362 {
363 if(anInter.NbPoints() > 1)
364 {
365 myNbExt += anInter.NbPoints();
366 }
367 }
368
369 myPoint1 = new Extrema_HArray1OfPOnCurv(1, myNbExt);
370 mySqDist = new TColStd_HArray1OfReal(1, myNbExt);
371 myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt);
7fd59977 372
9dfbbfe6 373 Standard_Integer i;
374 gp_Pnt PC, PP;
375 Standard_Real U, V;
376 Extrema_POnCurv POnC;
377 Extrema_POnSurf POnS;
378 for(i = 0; i < 2; ++i)
379 {
380 PC = ElCLib::CircleValue(T[i], C.Position(), C.Radius());
381 POnC.SetValues(T[i], PC);
382 myPoint1->SetValue(i+1, POnC);
383 ElSLib::PlaneParameters(S.Position(), PC, U, V);
384 PP = ElSLib::PlaneValue(U, V, S.Position());
385 POnS.SetParameters(U, V, PP);
386 myPoint2->SetValue(i+1, POnS);
387 mySqDist->SetValue(i+1, PC.SquareDistance(PP));
388 }
389 //
390 if(myNbExt > 2)
391 {
392 //Add intersection points
393 for(i = 1; i <= anInter.NbPoints(); ++i)
394 {
395 Standard_Real t = anInter.ParamOnConic(i);
396 PC = ElCLib::CircleValue(t, C.Position(), C.Radius());
397 POnC.SetValues(t, PC);
398 myPoint1->SetValue(i+2, POnC);
399 ElSLib::PlaneParameters(S.Position(), PC, U, V);
400 PP = ElSLib::PlaneValue(U, V, S.Position());
401 POnS.SetParameters(U, V, PP);
402 myPoint2->SetValue(i+2, POnS);
403 mySqDist->SetValue(i+2, PC.SquareDistance(PP));
404 }
405 }
406 }
407 //
7fd59977 408}
409
410
411
412Extrema_ExtElCS::Extrema_ExtElCS(const gp_Circ& C,
413 const gp_Cylinder& S)
414{
415 Perform(C, S);
416}
417
418
419
420// Modified by skv - Thu Jul 7 14:37:05 2005 OCC9134 Begin
421// Implementation of the method.
422void Extrema_ExtElCS::Perform(const gp_Circ& C,
423 const gp_Cylinder& S)
424{
425 myDone = Standard_False;
426 myIsPar = Standard_False;
427 myNbExt = 0;
428
429 // Get an axis line of the cylinder.
430 gp_Lin anAxis(S.Axis());
431
432 // Compute extrema between the circle and the line.
433 Extrema_ExtElC anExtC(anAxis, C, 0.);
434
435 if (anExtC.IsDone()) {
436 if (anExtC.IsParallel()) {
437 myIsPar = Standard_True;
438 mySqDist = new TColStd_HArray1OfReal(1, 1);
439 Standard_Real aDist = sqrt (anExtC.SquareDistance(1)) - S.Radius();
440 mySqDist->SetValue(1, aDist * aDist);
441 } else {
442 Standard_Integer aNbExt = anExtC.NbExt();
7fd59977 443 Standard_Integer i;
444 Standard_Integer aCurI = 1;
445 Standard_Real aTolConf = Precision::Confusion();
446 Standard_Real aCylRad = S.Radius();
447
19875353 448 // Check whether two objects have intersection points
449 IntAna_Quadric aCylQuad(S);
450 IntAna_IntConicQuad aCircCylInter(C, aCylQuad);
fc0180e5 451 Standard_Integer aNbInter = 0;
452 if (aCircCylInter.IsDone())
453 aNbInter = aCircCylInter.NbPoints();
19875353 454
7fd59977 455 // Compute the extremas.
19875353 456 myNbExt = 2*aNbExt + aNbInter;
7fd59977 457 mySqDist = new TColStd_HArray1OfReal(1, myNbExt);
458 myPoint1 = new Extrema_HArray1OfPOnCurv(1, myNbExt);
459 myPoint2 = new Extrema_HArray1OfPOnSurf(1, myNbExt);
460
461 for (i = 1; i <= aNbExt; i++) {
19875353 462 Extrema_POnCurv aPOnAxis;
463 Extrema_POnCurv aPOnCirc;
464 Standard_Real aSqDist = anExtC.SquareDistance(i);
465 Standard_Real aDist = sqrt (aSqDist);
466
467 anExtC.Points(i, aPOnAxis, aPOnCirc);
468
469 if (aSqDist <= (aTolConf * aTolConf)) {
470 myNbExt -= 2;
471 continue;
472 }
473
474 gp_Dir aDir(aPOnAxis.Value().XYZ().Subtracted(aPOnCirc.Value().XYZ()));
475 Standard_Real aShift[2] = { aDist + aCylRad, aDist - aCylRad };
476 Standard_Integer j;
7fd59977 477
19875353 478 for (j = 0; j < 2; j++) {
479 gp_Vec aVec(aDir);
480 gp_Pnt aPntOnCyl;
7fd59977 481
19875353 482 aVec.Multiply(aShift[j]);
483 aPntOnCyl = aPOnCirc.Value().Translated(aVec);
7fd59977 484
19875353 485 Standard_Real aU;
486 Standard_Real aV;
7fd59977 487
19875353 488 ElSLib::Parameters(S, aPntOnCyl, aU, aV);
7fd59977 489
19875353 490 Extrema_POnSurf aPOnSurf(aU, aV, aPntOnCyl);
7fd59977 491
19875353 492 myPoint1->SetValue(aCurI, aPOnCirc);
493 myPoint2->SetValue(aCurI, aPOnSurf);
494 mySqDist->SetValue(aCurI++, aShift[j] * aShift[j]);
495 }
496 }
497
498 // Adding intersection points to the list of extremas
499 for (i=1; i<=aNbInter; i++)
500 {
501 Standard_Real aU;
502 Standard_Real aV;
7fd59977 503
19875353 504 gp_Pnt aInterPnt = aCircCylInter.Point(i);
7fd59977 505
19875353 506 aU = ElCLib::Parameter(C, aInterPnt);
507 Extrema_POnCurv aPOnCirc(aU, aInterPnt);
7fd59977 508
19875353 509 ElSLib::Parameters(S, aInterPnt, aU, aV);
510 Extrema_POnSurf aPOnCyl(aU, aV, aInterPnt);
511 myPoint1->SetValue(aCurI, aPOnCirc);
512 myPoint2->SetValue(aCurI, aPOnCyl);
513 mySqDist->SetValue(aCurI++, 0.0);
7fd59977 514 }
515 }
516
517 myDone = Standard_True;
518 }
519}
520// Modified by skv - Thu Jul 7 14:37:05 2005 OCC9134 End
521
522
523
524Extrema_ExtElCS::Extrema_ExtElCS(const gp_Circ& C,
525 const gp_Cone& S)
526{
527 Perform(C, S);
528}
529
530
531
532//void Extrema_ExtElCS::Perform(const gp_Circ& C,
533// const gp_Cone& S)
534void Extrema_ExtElCS::Perform(const gp_Circ& ,
535 const gp_Cone& )
536{
537 Standard_NotImplemented::Raise();
538
539}
540
541
542
543Extrema_ExtElCS::Extrema_ExtElCS(const gp_Circ& C,
544 const gp_Sphere& S)
545{
546 Perform(C, S);
547}
548
549
550
551//void Extrema_ExtElCS::Perform(const gp_Circ& C,
552// const gp_Sphere& S)
553void Extrema_ExtElCS::Perform(const gp_Circ& ,
554 const gp_Sphere& )
555{
556 Standard_NotImplemented::Raise();
557
558}
559
560Extrema_ExtElCS::Extrema_ExtElCS(const gp_Circ& C,
561 const gp_Torus& S)
562{
563 Perform(C, S);
564}
565
566
567
568//void Extrema_ExtElCS::Perform(const gp_Circ& C,
569// const gp_Torus& S)
570void Extrema_ExtElCS::Perform(const gp_Circ& ,
571 const gp_Torus& )
572{
573 Standard_NotImplemented::Raise();
574
575}
576
577Extrema_ExtElCS::Extrema_ExtElCS(const gp_Hypr& C,
578 const gp_Pln& S)
579{
580 Perform(C, S);
581}
582
583
584
585void Extrema_ExtElCS::Perform(const gp_Hypr& C,
586 const gp_Pln& S)
587{
588 myDone = Standard_True;
589 myIsPar = Standard_False;
590
591 gp_Ax2 Pos = C.Position();
592 gp_Dir NHypr = Pos.Direction();
593 gp_Dir NPln = S.Axis().Direction();
594
595 if (NHypr.IsParallel(NPln, Precision::Angular())) {
596
597 mySqDist = new TColStd_HArray1OfReal(1, 1);
598 mySqDist->SetValue(1, S.SquareDistance(C.Location()));
599 myIsPar = Standard_True;
600
601 }
602 else {
603
604 gp_Dir XDir = Pos.XDirection();
605 gp_Dir YDir = Pos.YDirection();
606
607 Standard_Real A = C.MinorRadius()*(NPln.Dot(YDir));
608 Standard_Real B = C.MajorRadius()*(NPln.Dot(XDir));
609
610 if(Abs(B) > Abs(A)) {
611 Standard_Real T = -0.5 * Log((A+B)/(B-A));
612 gp_Pnt Ph = ElCLib::HyperbolaValue(T, Pos, C.MajorRadius(), C.MinorRadius());
613 Extrema_POnCurv PC(T, Ph);
614 myPoint1 = new Extrema_HArray1OfPOnCurv(1,1);
615 myPoint1->SetValue(1, PC);
616
617 mySqDist = new TColStd_HArray1OfReal(1, 1);
618 mySqDist->SetValue(1, S.SquareDistance(Ph));
619
620 Standard_Real U, V;
621 ElSLib::PlaneParameters(S.Position(), Ph, U, V);
622 gp_Pnt Pp = ElSLib::PlaneValue(U, V, S.Position());
623 Extrema_POnSurf PS(U, V, Pp);
624 myPoint2 = new Extrema_HArray1OfPOnSurf(1,1);
625 myPoint2->SetValue(1, PS);
626
627 myNbExt = 1;
628 }
629 else {
630 myNbExt = 0;
631 }
632
633 }
634
635}
636
637
638Standard_Boolean Extrema_ExtElCS::IsDone() const
639{
640 return myDone;
641}
642
643
644Standard_Integer Extrema_ExtElCS::NbExt() const
645{
646 if (myIsPar) StdFail_InfiniteSolutions::Raise();
647 return myNbExt;
648}
649
650Standard_Real Extrema_ExtElCS::SquareDistance(const Standard_Integer N) const
651{
652 if (myIsPar && N != 1) StdFail_InfiniteSolutions::Raise();
653 return mySqDist->Value(N);
654}
655
656
657void Extrema_ExtElCS::Points(const Standard_Integer N,
658 Extrema_POnCurv& P1,
659 Extrema_POnSurf& P2) const
660{
661 if (myIsPar) StdFail_InfiniteSolutions::Raise();
662 P1 = myPoint1->Value(N);
663 P2 = myPoint2->Value(N);
664}
665
666
667Standard_Boolean Extrema_ExtElCS::IsParallel() const
668{
669 return myIsPar;
670}