0023024: Update headers of OCCT files
[occt.git] / src / TopOpeBRep / TopOpeBRep_LineInter.cxx
1 // Created on: 1993-11-10
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-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
21
22 #include <TopOpeBRep_LineInter.ixx>
23
24 #include <TopOpeBRep.hxx>
25 #include <TopOpeBRep_VPointInter.hxx>
26 #include <TopOpeBRep_VPointInterIterator.hxx>
27 #include <TopOpeBRep_FFTransitionTool.hxx>
28
29 #include <IntPatch_IType.hxx>
30 #include <Geom_Line.hxx>
31 #include <Geom_Circle.hxx>
32 #include <Geom_Ellipse.hxx>
33 #include <Geom_Parabola.hxx>
34 #include <Geom_Hyperbola.hxx>
35 #include <Geom_TrimmedCurve.hxx>
36 #include <IntPatch_ALineToWLine.hxx>
37 #include <IntSurf_Quadric.hxx>
38 #include <GeomAbs_SurfaceType.hxx> 
39 #include <gp_Pnt.hxx>
40
41 #include <Adaptor2d_HCurve2d.hxx>
42 #include <BRepAdaptor_Curve2d.hxx>
43 #include <TopAbs.hxx>
44
45 #include <Standard_ProgramError.hxx>
46 #include <Standard_NotImplemented.hxx>
47
48 #ifdef DEB
49 Standard_IMPORT Standard_Boolean TopOpeBRep_GetcontextALWLNBP(Standard_Integer&);
50 Standard_IMPORT Standard_Boolean TopOpeBRep_GettraceCONIC();
51 Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettraceDSF();
52 Standard_IMPORT Standard_Boolean TopOpeBRepDS_GettraceDSNC();
53 #endif
54
55 //-----------------------------------------------------------------------
56 static Handle(IntPatch_WLine) FUN_ALINETOWLINE
57 (const Handle(IntPatch_ALine)& AL,
58  const BRepAdaptor_Surface surf1,const BRepAdaptor_Surface surf2)
59 //-----------------------------------------------------------------------
60 {
61   IntSurf_Quadric Quad1,Quad2;
62
63   switch(surf1.GetType())
64   {
65     case GeomAbs_Plane:    Quad1.SetValue(surf1.Plane()); break;
66     case GeomAbs_Cylinder: Quad1.SetValue(surf1.Cylinder()); break;
67     case GeomAbs_Sphere:   Quad1.SetValue(surf1.Sphere()); break;
68     case GeomAbs_Cone:     Quad1.SetValue(surf1.Cone()); break;
69     default : Standard_ProgramError::Raise
70       ("TopOpeBRep_LineInter::FUN_ALINETOWLINE"); break;
71   }
72   
73   switch(surf2.GetType())
74   {
75     case GeomAbs_Plane:    Quad2.SetValue(surf2.Plane()); break;
76     case GeomAbs_Cylinder: Quad2.SetValue(surf2.Cylinder()); break;
77     case GeomAbs_Sphere:   Quad2.SetValue(surf2.Sphere()); break;
78     case GeomAbs_Cone:     Quad2.SetValue(surf2.Cone()); break;
79     default : Standard_ProgramError::Raise
80       ("TopOpeBRep_LineInter::FUN_ALINETOWLINE"); break;
81   }
82
83   const Standard_Real deflectionmax = 0.01;
84   const Standard_Real pasUVmax = 0.05;
85   Standard_Integer nbpointsmax = 200;
86 #ifdef DEB
87   Standard_Integer newnbp;
88   if (TopOpeBRep_GetcontextALWLNBP(newnbp)) nbpointsmax = newnbp;
89 #endif
90   IntPatch_ALineToWLine 
91     AToL(Quad1,Quad2,deflectionmax,pasUVmax,nbpointsmax);
92   return AToL.MakeWLine(AL);
93 }
94
95 //=======================================================================
96 //function : SetLine
97 //purpose  : 
98 //=======================================================================
99
100 void TopOpeBRep_LineInter::SetLine(const Handle(IntPatch_Line)& L,
101                                    const BRepAdaptor_Surface& S1,
102                                    const BRepAdaptor_Surface& S2)
103 {
104   // load line according to its type
105   myIL = L;
106   IntPatch_IType type = L->ArcType();
107   switch (type) {
108   case IntPatch_Analytic :    myTypeLineCurve = TopOpeBRep_ANALYTIC; break;
109   case IntPatch_Restriction : myTypeLineCurve = TopOpeBRep_RESTRICTION; break;
110   case IntPatch_Walking :     myTypeLineCurve = TopOpeBRep_WALKING; break;
111   case IntPatch_Lin :         myTypeLineCurve = TopOpeBRep_LINE; break;
112   case IntPatch_Circle :      myTypeLineCurve = TopOpeBRep_CIRCLE; break;
113   case IntPatch_Ellipse :     myTypeLineCurve = TopOpeBRep_ELLIPSE; break;
114   case IntPatch_Parabola :    myTypeLineCurve = TopOpeBRep_PARABOLA; break;
115   case IntPatch_Hyperbola :   myTypeLineCurve = TopOpeBRep_HYPERBOLA; break;
116   default : 
117     myTypeLineCurve = TopOpeBRep_OTHERTYPE; 
118     SetOK(Standard_False);
119     break;
120   }
121
122   switch (type) {
123   case IntPatch_Analytic :
124     myILA = *((Handle(IntPatch_ALine)*)&L); break;
125   case IntPatch_Restriction :
126     myILR = *((Handle(IntPatch_RLine)*)&L); break;
127   case IntPatch_Walking : 
128     myILW = *((Handle(IntPatch_WLine)*)&L); break;
129   default :  //"geometric" line
130     myILG = *((Handle(IntPatch_GLine)*)&L); break;
131   }
132
133   // transform an analytic line to a walking line
134   if (myTypeLineCurve == TopOpeBRep_ANALYTIC) {
135     myILW = ::FUN_ALINETOWLINE(myILA,S1,S2);
136     myTypeLineCurve = TopOpeBRep_WALKING;
137   }
138
139   // number of points found on restriction(s)
140   Standard_Integer n = 0;
141   switch (myTypeLineCurve) { 
142   case TopOpeBRep_ANALYTIC :    n = myILA->NbVertex(); break;
143   case TopOpeBRep_RESTRICTION : n = myILR->NbVertex(); break;
144   case TopOpeBRep_WALKING :     n = myILW->NbVertex(); break;
145   case TopOpeBRep_LINE :        n = myILG->NbVertex(); break;
146   case TopOpeBRep_CIRCLE :      n = myILG->NbVertex(); break;
147   case TopOpeBRep_ELLIPSE :     n = myILG->NbVertex(); break;
148   case TopOpeBRep_PARABOLA :    n = myILG->NbVertex(); break; 
149   case TopOpeBRep_HYPERBOLA :   n = myILG->NbVertex(); break;
150   default : 
151     SetOK(Standard_False);
152     break;
153   }
154   myNbVPoint = n;
155
156   // prepare VPoints from intersection points
157   myHAVP = new TopOpeBRep_HArray1OfVPointInter(0,n);
158   for (Standard_Integer i=1;i<=n;i++) {
159     TopOpeBRep_VPointInter& VP = myHAVP->ChangeValue(i);
160     switch (myTypeLineCurve) {
161     case TopOpeBRep_ANALYTIC :    VP.SetPoint(myILA->Vertex(i)); break;
162     case TopOpeBRep_RESTRICTION : VP.SetPoint(myILR->Vertex(i)); break;
163     case TopOpeBRep_WALKING :     VP.SetPoint(myILW->Vertex(i)); break;
164     default :                     VP.SetPoint(myILG->Vertex(i)); break;
165     }
166     VP.Index(i);
167   }
168 }
169
170 //=======================================================================
171 //function : VPoint
172 //purpose  : 
173 //=======================================================================
174
175 const TopOpeBRep_VPointInter& TopOpeBRep_LineInter::VPoint(const Standard_Integer I) const
176 {
177   return myHAVP->Value(I);
178 }
179   
180 //=======================================================================
181 //function : ChangeVPoint
182 //purpose  : 
183 //=======================================================================
184
185 TopOpeBRep_VPointInter& TopOpeBRep_LineInter::ChangeVPoint(const Standard_Integer I)
186 {
187   return myHAVP->ChangeValue(I);
188 }
189   
190 //=======================================================================
191 //function : SetINL
192 //purpose  : 
193 //=======================================================================
194
195 void TopOpeBRep_LineInter::SetINL()
196 {
197   TopOpeBRep_VPointInterIterator VPI(*this);
198   if (!VPI.More()) {
199     myINL = Standard_False;
200     return;
201   }
202   const Standard_Real p0 = VPI.CurrentVP().ParameterOnLine();
203   VPI.Next();
204   if (!VPI.More()) { 
205     myINL = Standard_True;
206     return;
207   }
208   for (; VPI.More(); VPI.Next() ) {
209     const Standard_Real p = VPI.CurrentVP().ParameterOnLine();
210     if ( p != p0 ) {
211       myINL = Standard_False;
212       return;
213     }
214   }
215   myINL = Standard_True;
216 }
217
218 //=======================================================================
219 //function : SetIsVClosed
220 //purpose  : 
221 //=======================================================================
222
223 void TopOpeBRep_LineInter::SetIsVClosed()
224 {
225   if (myINL) {
226     myIsVClosed = Standard_False;
227     return;    
228   }
229
230   /*Standard_Boolean newV = Standard_True;
231   if (!newV) {
232     if (myTypeLineCurve != TopOpeBRep_WALKING) {
233       myIsVClosed = Standard_False;
234       return;
235     }
236   }*/
237   
238   TopOpeBRep_VPointInterIterator VPI(*this);
239   Standard_Integer nV = myNbVPoint;
240   Standard_Real    pmin = RealLast(),pmax = RealFirst();
241   Standard_Integer imin=0, imax = 0; // index of IsOnArc VPoints
242   if (nV >= 2) {
243     for (; VPI.More(); VPI.Next() ) {
244       const TopOpeBRep_VPointInter& P = VPI.CurrentVP();
245       if ( ! P.IsInternal() ) {
246         const Standard_Integer i = VPI.CurrentVPIndex();
247         const Standard_Real p = P.ParameterOnLine();
248         if ( p < pmin ) { imin = i; pmin = p; }
249         if ( p > pmax ) { imax = i; pmax = p; }
250       }
251     }
252     if ( imax == 0 ) {       // no VPoint on restriction found
253       myIsVClosed = Standard_True;
254       return;
255     }
256
257     const TopOpeBRep_VPointInter& P1 = VPoint(imin);
258     const TopOpeBRep_VPointInter& P2 = VPoint(imax);
259
260     const gp_Pnt& pp1 = P1.Value();
261     const gp_Pnt& pp2 = P2.Value();
262
263     const Standard_Real tol1 = P1.Tolerance();
264     const Standard_Real tol2 = P2.Tolerance();
265     const Standard_Real tol = Max(tol1,tol2);
266
267     myIsVClosed = pp1.IsEqual(pp2,tol);
268   }
269   else {
270     SetOK(Standard_False);
271     myIsVClosed = Standard_False;
272   }
273 }
274
275 //=======================================================================
276 //function : SetHasVPonR
277 //purpose  : 
278 //=======================================================================
279
280 void TopOpeBRep_LineInter::SetHasVPonR()
281 {
282   myHasVPonR = Standard_False;
283   TopOpeBRep_VPointInterIterator VPI(*this);
284   for (; VPI.More(); VPI.Next()) {
285     const TopOpeBRep_VPointInter& P = VPI.CurrentVP();
286     if (P.IsOnDomS1() || P.IsOnDomS2()) {
287       myHasVPonR = Standard_True;
288       break;
289     }
290   }
291 }
292
293 //=======================================================================
294 //function : SetVPBounds
295 //purpose  : 
296 //=======================================================================
297
298 void TopOpeBRep_LineInter::SetVPBounds()
299 {
300   myVPF = myVPL = myVPN = 0;
301   myVPBDefined = Standard_True;
302
303   TopOpeBRep_VPointInterIterator VPI(*this);
304   Standard_Integer f = myNbVPoint + 1, l = 0, n = 0;
305   
306   for (; VPI.More(); VPI.Next()) {
307     if (VPI.CurrentVP().Keep()) {
308       n++;
309       const Standard_Integer i = VPI.CurrentVPIndex();
310       if ( i < f ) f = i;
311       if ( i > l ) l = i;
312     }
313   }    
314   
315   myVPF = f; myVPL = l; myVPN = n;  
316 }
317
318 //=======================================================================
319 //function : VPBounds
320 //purpose  : 
321 //=======================================================================
322
323 void TopOpeBRep_LineInter::VPBounds
324 (Standard_Integer& f, Standard_Integer& l, Standard_Integer& n) const
325 {
326   if ( !myVPBDefined ) {
327     TopOpeBRep_LineInter* p = (TopOpeBRep_LineInter*)this; // NYI deconst
328     p->SetOK(Standard_False);
329     f = l = n = 0;
330     return;
331   }
332   f = myVPF;
333   l = myVPL;
334   n = myVPN;
335 }
336
337 //=======================================================================
338 //function : IsPeriodic
339 //purpose  : 
340 //=======================================================================
341
342 Standard_Boolean TopOpeBRep_LineInter::IsPeriodic() const
343 {
344   switch (myTypeLineCurve)
345   {
346     case TopOpeBRep_CIRCLE  :
347     case TopOpeBRep_ELLIPSE : return Standard_True;
348   }
349   return Standard_False;
350 }
351
352 //=======================================================================
353 //function : Period
354 //purpose  : 
355 //=======================================================================
356
357 Standard_Real TopOpeBRep_LineInter::Period() const
358 {
359   Standard_Real f,l;
360   Bounds(f,l);
361   return (l - f);
362 }
363
364 //=======================================================================
365 //function : Bounds
366 //purpose  : 
367 //=======================================================================
368
369 void TopOpeBRep_LineInter::Bounds(Standard_Real& First,Standard_Real& Last) const
370 {
371   if ( myILG.IsNull() )  {
372     TopOpeBRep_LineInter* p = (TopOpeBRep_LineInter*)this; // NYI deconst
373     p->SetOK(Standard_False);
374     return;
375   }
376   
377   First = 0.; Last = 0.;
378   if ( IsPeriodic() )
379     Last = Curve()->Period();
380   
381   if ( myILG->HasFirstPoint() )
382     First = myILG->FirstPoint().ParameterOnLine();
383
384   if ( myILG->HasLastPoint() )
385     Last = myILG->LastPoint().ParameterOnLine();
386 }
387
388 //=======================================================================
389 //function : HasVInternal
390 //purpose  : 
391 //=======================================================================
392
393 Standard_Boolean TopOpeBRep_LineInter::HasVInternal()
394 {
395   TopOpeBRep_VPointInterIterator VPI(*this);
396   for (; VPI.More(); VPI.Next()) {
397     if (VPI.CurrentVP().IsInternal()) return Standard_True;
398   }
399   return Standard_False;
400 }
401
402
403 //=======================================================================
404 //function : NbWPoint
405 //purpose  : 
406 //=======================================================================
407
408 Standard_Integer TopOpeBRep_LineInter::NbWPoint() const
409 {
410   switch (myTypeLineCurve)
411   {
412     case TopOpeBRep_WALKING : return myILW->NbPnts();
413   }
414   return 0;
415 }
416
417
418 //=======================================================================
419 //function : WPoint
420 //purpose  : 
421 //=======================================================================
422
423 const TopOpeBRep_WPointInter& TopOpeBRep_LineInter::WPoint(const Standard_Integer IW)
424 {
425   switch (myTypeLineCurve)
426   {
427     case TopOpeBRep_RESTRICTION : myCurrentWP.Set(myILR->Point(IW)); break;
428     case TopOpeBRep_WALKING :     myCurrentWP.Set(myILW->Point(IW)); break;
429     default : break;
430   }
431   return myCurrentWP;
432 }
433
434 //=======================================================================
435 //function : Curve
436 //purpose  : 
437 //=======================================================================
438
439 Handle(Geom_Curve) TopOpeBRep_LineInter::Curve() const 
440 {
441   // Build the 3d curve
442   Handle(Geom_Curve) C3D;
443   switch (myTypeLineCurve) {
444   case TopOpeBRep_LINE : 
445     C3D = new Geom_Line(myILG->Line()); break;
446   case TopOpeBRep_CIRCLE :    
447     C3D = new Geom_Circle(myILG->Circle()); break;
448   case TopOpeBRep_ELLIPSE :   
449     C3D = new Geom_Ellipse(myILG->Ellipse()); break;
450   case TopOpeBRep_PARABOLA :  
451     C3D = new Geom_Parabola(myILG->Parabola()); break;
452   case TopOpeBRep_HYPERBOLA : 
453     C3D = new Geom_Hyperbola(myILG->Hyperbola()); break;
454   default : 
455     TopOpeBRep_LineInter* p = (TopOpeBRep_LineInter*)this; // NYI deconst
456     p->SetOK(Standard_False);
457     break;
458   }
459   return C3D;
460 }
461
462 //=======================================================================
463 //function : Curve
464 //purpose  : 
465 //=======================================================================
466
467 Handle(Geom_Curve) TopOpeBRep_LineInter::Curve
468 (const Standard_Real parmin, const Standard_Real parmax) const 
469 {
470   // Build the trimmed 3d curve
471   Handle(Geom_Curve) C3D = Curve();
472   Handle(Geom_TrimmedCurve) TC3D = new Geom_TrimmedCurve(C3D,parmin,parmax);
473 #ifdef DEB
474   if ( TopOpeBRep_GettraceCONIC() ) {
475     cout<<"TopOpeBRep_LineInter::Curve on a ";
476     TopOpeBRep::Print(myTypeLineCurve,cout);cout<<endl;
477     cout<<"  ... Trimmed from "<<parmin<<" to "<<parmax<<endl;
478   }
479 #endif
480   return TC3D;
481 }
482
483 //=======================================================================
484 //function : Arc
485 //purpose  : 
486 //=======================================================================
487
488 const TopoDS_Shape& TopOpeBRep_LineInter::Arc() const
489 {
490   if (myTypeLineCurve == TopOpeBRep_RESTRICTION) {
491     if(myILR->IsArcOnS1()) { 
492       const Handle(Adaptor2d_HCurve2d)& AHC2D = myILR->ArcOnS1();
493       const BRepAdaptor_Curve2d& BC2DP = *((BRepAdaptor_Curve2d*)&(AHC2D->Curve2d()));
494       const TopoDS_Shape& S = BC2DP.Edge();
495       return S;
496     }
497     else { 
498       const Handle(Adaptor2d_HCurve2d)& AHC2D = myILR->ArcOnS2();
499       const BRepAdaptor_Curve2d& BC2DP = *((BRepAdaptor_Curve2d*)&(AHC2D->Curve2d()));
500       const TopoDS_Shape& S = BC2DP.Edge();
501       return S;
502     }
503   }
504   else
505     return myNullShape;
506 }
507
508 //=======================================================================
509 //function : ArcIsEdge
510 //purpose  : 
511 //=======================================================================
512
513 Standard_Boolean TopOpeBRep_LineInter::ArcIsEdge(const Standard_Integer Index) const
514 {
515   if (myTypeLineCurve == TopOpeBRep_RESTRICTION) {
516     const Standard_Boolean r = myILR->IsArcOnS1();
517     return ( Index == 2 ? !r : r );
518   }
519   return Standard_False;
520 }
521
522 //=======================================================================
523 //function : HasFirstPoint
524 //purpose  : 
525 //=======================================================================
526
527 Standard_Boolean TopOpeBRep_LineInter::HasFirstPoint() const
528 {
529   if (myILG.IsNull())
530     Standard_ProgramError::Raise("TopOpeBRep_LineInter::HasFirstPoint sur line != GLine");
531   return myILG->HasFirstPoint();
532 }
533
534 //=======================================================================
535 //function : HasLastPoint
536 //purpose  : 
537 //=======================================================================
538
539 Standard_Boolean TopOpeBRep_LineInter::HasLastPoint() const
540 {
541   if (myILG.IsNull())
542     Standard_ProgramError::Raise("TopOpeBRep_LineInter::HasLastPoint sur line != GLine");
543   return myILG->HasLastPoint();
544 }
545
546 //=======================================================================
547 //function : ComputeFaceFaceTransition
548 //purpose  : 
549 //=======================================================================
550
551 void TopOpeBRep_LineInter::ComputeFaceFaceTransition()
552 {
553   TopAbs_Orientation F1ori = myF1.Orientation();
554   TopAbs_Orientation F2ori = myF2.Orientation();
555   myLineTonF1=TopOpeBRep_FFTransitionTool::ProcessFaceTransition(*this,1,F2ori);
556   myLineTonF2=TopOpeBRep_FFTransitionTool::ProcessFaceTransition(*this,2,F1ori);
557 }
558
559 //=======================================================================
560 //function : FaceFaceTransition
561 //purpose  : 
562 //=======================================================================
563 const TopOpeBRepDS_Transition& TopOpeBRep_LineInter::FaceFaceTransition
564 (const Standard_Integer I) const
565 {
566   if (I == 1) return myLineTonF1;
567   if (I == 2) return myLineTonF2;
568   Standard_ProgramError::Raise("TopOpeBRep_LineInter::FaceFaceTransition");
569   return myLineTonF1;
570 }
571
572 //=======================================================================
573 //function : DumpType
574 //purpose  : 
575 //=======================================================================
576
577 void TopOpeBRep_LineInter::DumpType()const
578 {
579 #ifdef DEB
580   TopOpeBRep::Print(myTypeLineCurve,cout);
581 #endif
582 }
583
584 //=======================================================================
585 //function : DumpVPoint
586 //purpose  : 
587 //=======================================================================
588
589 void TopOpeBRep_LineInter::DumpVPoint
590 #ifndef DEB
591 (const Standard_Integer ,
592  const TCollection_AsciiString& ,
593  const TCollection_AsciiString& ) const
594 {
595 #else
596 (const Standard_Integer I,
597  const TCollection_AsciiString& s1,
598  const TCollection_AsciiString& s2) const
599 {
600   const TopOpeBRep_VPointInter& VP = VPoint(I);
601   const gp_Pnt& P = VP.Value();
602   cout<<s1;
603   cout<<"L"<<Index()<<"P"<<VP.Index();
604   if (VP.Keep()) cout<<"K";
605   cout<<" "<<P.X()<<" "<<P.Y()<<" "<<P.Z();
606   cout<<s2;
607 #endif
608 }
609
610 //=======================================================================
611 //function : DumpBipoint
612 //purpose  : 
613 //=======================================================================
614
615 void TopOpeBRep_LineInter::DumpBipoint
616 #ifndef DEB
617 (const TopOpeBRep_Bipoint& ,
618  const TCollection_AsciiString& ,
619  const TCollection_AsciiString& ) const
620 {
621 #else
622 (const TopOpeBRep_Bipoint& bip,
623  const TCollection_AsciiString& s1,
624  const TCollection_AsciiString& s2) const
625 {
626   Standard_Integer i1 = bip.I1();
627   Standard_Integer i2 = bip.I2();
628   cout<<s1;
629   cout<<"("<<i1<<","<<i2<<")";
630   cout<<s2;
631 #endif
632 }
633
634 //=======================================================================
635 //function : SetOK
636 //purpose  : 
637 //=======================================================================
638
639 void TopOpeBRep_LineInter::SetOK(const Standard_Boolean B)
640 {
641 #ifdef DEB
642   if (TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSNC()) {
643     if (myOK != B) {
644       cout<<"line "<<myIndex<<" (";
645       TopOpeBRep::Print(myTypeLineCurve,cout);cout<<") ";
646       if (!B) cout<<"OK->NOK"; else cout<<"NOK->OK";
647       cout<<endl;
648     }
649   }
650 #endif
651   myOK = B;
652 }
653
654 //=======================================================================
655 //function : SetTraceIndex
656 //purpose  : 
657 //=======================================================================
658
659 void TopOpeBRep_LineInter::SetTraceIndex(const Standard_Integer exF1,
660                                          const Standard_Integer exF2)
661
662   myexF1 = exF1;
663   myexF2 = exF2;
664 }
665
666 //=======================================================================
667 //function : GetTraceIndex
668 //purpose  : 
669 //=======================================================================
670
671 void TopOpeBRep_LineInter::GetTraceIndex(Standard_Integer& exF1,
672                                          Standard_Integer& exF2)const 
673
674   exF1 = myexF1;
675   exF2 = myexF2;
676 }
677
678 //=======================================================================
679 //function : DumpLineTransitions
680 //purpose  : 
681 //=======================================================================
682 Standard_OStream& TopOpeBRep_LineInter::DumpLineTransitions(Standard_OStream& OS) const
683 {
684 #ifdef DEB
685   OS<<"transition from f1 / f2 "; TopAbs::Print(myF2.Orientation(),OS);
686   OS<<" : "; myLineTonF1.Dump(OS); OS<<endl;
687   OS<<"transition from f2 / f1 "; TopAbs::Print(myF1.Orientation(),OS);
688   OS<<" : "; myLineTonF2.Dump(OS); OS<<endl;
689 #endif
690   return OS;
691 }