1 // Created on: 1995-11-10
2 // Created by: Yves FRICAUD
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
19 #include <BRepAlgo_Loop.ixx>
21 #include <BRep_Builder.hxx>
22 #include <BRepAlgo_FaceRestrictor.hxx>
23 #include <BRep_Tool.hxx>
25 #include <Geom2d_Curve.hxx>
26 #include <Geom_Surface.hxx>
28 #include <TopTools_SequenceOfShape.hxx>
29 #include <TopTools_MapOfShape.hxx>
30 #include <TopTools_ListIteratorOfListOfShape.hxx>
31 #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
34 #include <TopoDS_Vertex.hxx>
35 #include <TopoDS_Wire.hxx>
37 #include <gp_Pnt2d.hxx>
38 #include <Precision.hxx>
39 #include <BRep_TVertex.hxx>
40 #include <BRep_TEdge.hxx>
41 #include <TopExp_Explorer.hxx>
42 #include <TopoDS_Iterator.hxx>
43 #include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
49 Standard_Boolean AffichLoop = Standard_False;
50 Standard_Integer NbLoops = 0;
51 Standard_Integer NbWires = 1;
52 static char* name = new char[100];
55 //=======================================================================
56 //function : BRepAlgo_Loop
58 //=======================================================================
60 BRepAlgo_Loop::BRepAlgo_Loop()
65 //=======================================================================
68 //=======================================================================
70 void BRepAlgo_Loop::Init(const TopoDS_Face& F)
81 //=======================================================================
83 //purpose : Orders the sequence of vertices by increasing parameter.
84 //=======================================================================
86 static void Bubble(const TopoDS_Edge& E,
87 TopTools_SequenceOfShape& Seq)
89 Standard_Boolean Invert = Standard_True;
90 Standard_Integer NbPoints = Seq.Length();
95 Invert = Standard_False;
96 for ( Standard_Integer i = 1; i < NbPoints; i++) {
97 TopoDS_Shape aLocalV = Seq.Value(i) .Oriented(TopAbs_INTERNAL);
98 V1 = TopoDS::Vertex(aLocalV);
99 aLocalV = Seq.Value(i+1).Oriented(TopAbs_INTERNAL);
100 V2 = TopoDS::Vertex(aLocalV);
101 // V1 = TopoDS::Vertex(Seq.Value(i) .Oriented(TopAbs_INTERNAL));
102 // V2 = TopoDS::Vertex(Seq.Value(i+1).Oriented(TopAbs_INTERNAL));
104 U1 = BRep_Tool::Parameter(V1,E);
105 U2 = BRep_Tool::Parameter(V2,E);
108 Invert = Standard_True;
116 //=======================================================================
117 //function : AddEdges
119 //=======================================================================
121 void BRepAlgo_Loop::AddEdge (TopoDS_Edge& E,
122 const TopTools_ListOfShape& LV)
124 myVerOnEdges.Bind(E,LV);
128 //=======================================================================
129 //function : AddConstEdges
131 //=======================================================================
133 void BRepAlgo_Loop::AddConstEdge (const TopoDS_Edge& E)
135 myConstEdges.Append(E);
138 //=======================================================================
139 //function : AddConstEdges
141 //=======================================================================
143 void BRepAlgo_Loop::AddConstEdges(const TopTools_ListOfShape& LE)
145 TopTools_ListIteratorOfListOfShape itl(LE);
146 for (; itl.More(); itl.Next()) {
147 myConstEdges.Append(itl.Value());
152 //=======================================================================
153 //function : UpdateClosedEdge
154 //purpose : If the first or the last vertex of intersection
155 // coincides with the closing vertex, it is removed from SV.
156 // it will be added at the beginning and the end of SV by the caller.
157 //=======================================================================
159 static TopoDS_Vertex UpdateClosedEdge(const TopoDS_Edge& E,
160 TopTools_SequenceOfShape& SV)
162 TopoDS_Vertex VB [2], V1, V2, VRes;
164 Standard_Boolean OnStart = 0, OnEnd = 0;
165 //// modified by jgv, 13.04.04 for OCC5634 ////
166 TopExp::Vertices (E,V1,V2);
167 //Standard_Real Tol = Precision::Confusion();
168 Standard_Real Tol = BRep_Tool::Tolerance( V1 );
169 ///////////////////////////////////////////////
171 if (SV.IsEmpty()) return VRes;
173 VB[0] = TopoDS::Vertex(SV.First());
174 VB[1] = TopoDS::Vertex(SV.Last ());
175 PC = BRep_Tool::Pnt(V1);
177 for ( Standard_Integer i = 0 ; i < 2 ; i++) {
178 P = BRep_Tool::Pnt(VB [i]);
179 if (P.IsEqual(PC,Tol)) {
181 if (i == 0) OnStart = Standard_True;
182 else OnEnd = Standard_True;
185 if (OnStart && OnEnd) {
186 if (!VB[0].IsSame(VB[1])) {
189 cout <<"Two different vertices on the closing vertex"<<endl;
194 if (!SV.IsEmpty()) SV.Remove(SV.Length());
197 else if (OnStart) SV.Remove(1);
198 else if (OnEnd ) SV.Remove(SV.Length());
205 //=======================================================================
206 //function : RemovePendingEdges
208 //=======================================================================
210 static void RemovePendingEdges(TopTools_DataMapOfShapeListOfShape& MVE)
212 //--------------------------------
213 // Remove hanging edges.
214 //--------------------------------
215 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape Mapit;
216 TopTools_ListOfShape ToRemove;
217 TopTools_ListIteratorOfListOfShape itl;
218 Standard_Boolean YaSupress = Standard_True;
222 YaSupress = Standard_False;
223 TopTools_ListOfShape VToRemove;
224 TopTools_MapOfShape EToRemove;
226 for (Mapit.Initialize(MVE); Mapit.More(); Mapit.Next()) {
228 if (Mapit.Value().IsEmpty()) {
229 VToRemove.Append(Mapit.Key());
231 if (Mapit.Value().Extent() == 1) {
232 const TopoDS_Edge& E = TopoDS::Edge(Mapit.Value().First());
233 TopExp::Vertices(E,V1,V2) ;
234 if (!V1.IsSame(V2)) {
235 VToRemove.Append(Mapit.Key());
236 EToRemove.Add(Mapit.Value().First());
241 if (!VToRemove.IsEmpty()) {
242 YaSupress = Standard_True;
243 for (itl.Initialize(VToRemove); itl.More(); itl.Next()) {
244 MVE.UnBind(itl.Value());
246 if (!EToRemove.IsEmpty()) {
247 for (Mapit.Initialize(MVE); Mapit.More(); Mapit.Next()) {
248 TopTools_ListOfShape& LE = MVE.ChangeFind(Mapit.Key());
251 if (EToRemove.Contains(itl.Value())) {
261 //=======================================================================
262 //function : SamePnt2d
264 //=======================================================================
266 static Standard_Boolean SamePnt2d(TopoDS_Vertex V,
271 Standard_Real f1,f2,l1,l2;
273 TopoDS_Shape aLocalF = F.Oriented(TopAbs_FORWARD);
274 TopoDS_Face FF = TopoDS::Face(aLocalF);
275 // TopoDS_Face FF = TopoDS::Face(F.Oriented(TopAbs_FORWARD));
276 Handle(Geom2d_Curve) C1 = BRep_Tool::CurveOnSurface(E1,FF,f1,l1);
277 Handle(Geom2d_Curve) C2 = BRep_Tool::CurveOnSurface(E2,FF,f2,l2);
278 if (E1.Orientation () == TopAbs_FORWARD) P1 = C1->Value(f1);
279 else P1 = C1->Value(l1);
281 if (E2.Orientation () == TopAbs_FORWARD) P2 = C2->Value(l2);
282 else P2 = C2->Value(f2);
283 Standard_Real Tol = 100*BRep_Tool::Tolerance(V);
284 Standard_Real Dist = P1.Distance(P2);
288 //=======================================================================
289 //function : SelectEdge
290 //purpose : Find edge <NE> connected to <CE> by vertex <CV> in the
291 // list <LE>. <NE> is removed from the list. If <CE> is
292 // also in the list <LE> with the same orientation, it is
293 // removed from the list.
294 //=======================================================================
296 static Standard_Boolean SelectEdge(const TopoDS_Face& F,
297 const TopoDS_Edge& CE,
298 const TopoDS_Vertex& CV,
300 TopTools_ListOfShape& LE)
302 TopTools_ListIteratorOfListOfShape itl;
306 if ( LE.Extent() > 2) {
307 cout <<"vertex on more than 2 edges in a face."<<endl;
311 for ( itl.Initialize(LE); itl.More(); itl.Next()) {
312 if (itl.Value().IsEqual(CE)) {
317 if (LE.Extent() > 1) {
318 //--------------------------------------------------------------
319 // Several edges possible.
320 // - Test edges different from CE , Selection of edge
321 // for which CV has U,V closer to the face
322 // than corresponding to CE.
323 // - If several edges give representation less than the tolerance.
324 // discrimination on tangents.
325 //--------------------------------------------------------------
328 TopoDS_Face FForward = F;
329 FForward.Orientation(TopAbs_FORWARD);
331 Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(CE,FForward,f,l);
332 Standard_Integer k = 1, kmin = 0;
333 Standard_Real dist,distmin = 100*BRep_Tool::Tolerance(CV);
335 if (CE.Orientation () == TopAbs_FORWARD) u = l;
338 gp_Pnt2d P2,PV = C->Value(u);
340 for ( itl.Initialize(LE); itl.More(); itl.Next()) {
341 const TopoDS_Edge& E = TopoDS::Edge(itl.Value());
343 C = BRep_Tool::CurveOnSurface(E,FForward,f,l);
344 if (E.Orientation () == TopAbs_FORWARD) u = f;
347 dist = PV.Distance(P2);
348 if ( dist <= distmin) {
355 if (kmin == 0) return Standard_False;
357 k = 1; itl.Initialize(LE);
358 while (k < kmin) {k++; itl.Next();}
359 NE = TopoDS::Edge(itl.Value());
362 else if (LE.Extent() == 1) {
363 NE = TopoDS::Edge(LE.First());
367 return Standard_False;
371 DBRep::Set("Selected",NE);
375 return Standard_True;
377 //=======================================================================
380 //=======================================================================
382 static void PurgeNewEdges(TopTools_DataMapOfShapeListOfShape& NewEdges,
383 const TopTools_MapOfShape& UsedEdges)
385 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape it(NewEdges);
386 for (; it.More(); it.Next()) {
387 TopTools_ListOfShape& LNE = NewEdges.ChangeFind(it.Key());
388 TopTools_ListIteratorOfListOfShape itL(LNE);
390 const TopoDS_Shape& NE = itL.Value();
391 if (!UsedEdges.Contains(NE)) {
402 //=======================================================================
405 //=======================================================================
407 static void StoreInMVE (const TopoDS_Face& F,
409 TopTools_DataMapOfShapeListOfShape& MVE,
410 Standard_Boolean& YaCouture,
411 TopTools_DataMapOfShapeShape& VerticesForSubstitute )
413 TopoDS_Vertex V1, V2, V;
414 TopTools_ListOfShape Empty;
416 Standard_Real Tol = 0.001; //5.e-05; //5.e-07;
419 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape Mapit;
421 for (Mapit.Initialize( MVE ); Mapit.More(); Mapit.Next())
423 V = TopoDS::Vertex( Mapit.Key() );
424 P = BRep_Tool::Pnt( V );
425 TopTools_ListOfShape VList;
426 TopoDS_Iterator VerExp( E );
427 for (; VerExp.More(); VerExp.Next())
428 VList.Append( VerExp.Value() );
429 TopTools_ListIteratorOfListOfShape itl( VList );
430 for (; itl.More(); itl.Next())
432 V1 = TopoDS::Vertex( itl.Value() );
433 P1 = BRep_Tool::Pnt( V1 );
434 if (P.IsEqual( P1, Tol ) && !V.IsSame(V1))
436 V.Orientation( V1.Orientation() );
437 if (VerticesForSubstitute.IsBound( V1 ))
439 TopoDS_Shape OldNewV = VerticesForSubstitute( V1 );
440 if (! OldNewV.IsSame( V ))
442 VerticesForSubstitute.Bind( OldNewV, V );
443 VerticesForSubstitute( V1 ) = V;
448 if (VerticesForSubstitute.IsBound( V ))
450 TopoDS_Shape NewNewV = VerticesForSubstitute( V );
451 if (! NewNewV.IsSame( V1 ))
452 VerticesForSubstitute.Bind( V1, NewNewV );
456 VerticesForSubstitute.Bind( V1, V );
457 TopTools_DataMapIteratorOfDataMapOfShapeShape mapit( VerticesForSubstitute );
458 for (; mapit.More(); mapit.Next())
459 if (mapit.Value().IsSame( V1 ))
460 VerticesForSubstitute( mapit.Key() ) = V;
463 E.Free( Standard_True );
470 TopExp::Vertices(E,V1,V2);
471 if( V1.IsNull() && V2.IsNull() ){ YaCouture = Standard_False; return; }
472 if (!MVE.IsBound(V1)) {
476 if (!V1.IsSame(V2)) {
477 if (!MVE.IsBound(V2)) {
483 Handle(Geom_Surface) S = BRep_Tool::Surface(F,L);
484 if (BRep_Tool::IsClosed(E,S,L)) {
485 MVE(V2).Append(E.Reversed());
486 if (!V1.IsSame(V2)) {
487 MVE(V1).Append(E.Reversed());
489 YaCouture = Standard_True;
493 //=======================================================================
496 //=======================================================================
498 void BRepAlgo_Loop::Perform()
500 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape Mapit;
501 TopTools_ListIteratorOfListOfShape itl;
503 Standard_Boolean YaCouture = Standard_False;
507 cout <<"NewLoop"<<endl;
510 sprintf(name,"FLoop_%d",NbLoops);
511 DBRep::Set(name,myFace);
512 Standard_Integer NbEdges = 1;
514 for (Mapit.Initialize(myVerOnEdges); Mapit.More(); Mapit.Next()) {
515 const TopoDS_Edge& E = TopoDS::Edge(Mapit.Key());
517 sprintf(name,"EEE_%d_%d",NbLoops,NbEdges++);
521 for (itl.Initialize(myConstEdges); itl.More(); itl.Next()) {
522 const TopoDS_Edge& E = TopoDS::Edge(itl.Value());
524 sprintf(name,"EEE_%d_%d",NbLoops,NbEdges++);
530 //------------------------------------------------
532 //------------------------------------------------
533 for (Mapit.Initialize(myVerOnEdges); Mapit.More(); Mapit.Next()) {
534 TopTools_ListOfShape LCE;
536 CutEdge (TopoDS::Edge(Mapit.Key()),Mapit.Value(), LCE);
538 myNewEdges.Bind(Mapit.Key(),LCE);
540 //-----------------------------------
541 // Construction map vertex => edges
542 //-----------------------------------
543 TopTools_DataMapOfShapeListOfShape MVE;
546 for (Mapit.Initialize(myNewEdges); Mapit.More(); Mapit.Next()) {
547 for (itl.Initialize(myNewEdges(Mapit.Key())); itl.More(); itl.Next()) {
548 TopoDS_Edge& E = TopoDS::Edge(itl.Value());
549 StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute);
554 // Sewn edges can be doubled or not in myConstEdges
555 // => call only once StoreInMVE which should double them
556 TopTools_MapOfShape DejaVu;
557 for (itl.Initialize(myConstEdges); itl.More(); itl.Next()) {
558 TopoDS_Edge& E = TopoDS::Edge(itl.Value());
560 StoreInMVE(myFace,E,MVE,YaCouture,myVerticesForSubstitute);
565 cout <<"NewLoop"<<endl;
566 Standard_Integer NbEdges = 1;
567 TopTools_MapOfShape Done;
568 for (Mapit.Initialize(MVE); Mapit.More();Mapit.Next()) {
569 for (itl.Initialize(Mapit.Value()); itl.More(); itl.Next()) {
570 TopoDS_Edge& E = TopoDS::Edge(itl.Value());
572 sprintf(name,"EEC_%d_%d",NbLoops,NbEdges++);
580 //-----------------------------------------------
581 // Construction of wires and new faces.
582 //----------------------------------------------
583 TopoDS_Vertex VF,VL,CV;
584 TopoDS_Edge CE,NE,EF;
587 Standard_Boolean End;
589 TopTools_MapOfShape UsedEdges;
591 while (!MVE.IsEmpty()) {
593 //--------------------------------
594 // Removal of hanging edges.
595 //--------------------------------
596 RemovePendingEdges(MVE);
598 if (MVE.IsEmpty()) break;
599 //--------------------------------
601 //--------------------------------
602 Mapit.Initialize(MVE);
603 EF = CE = TopoDS::Edge(Mapit.Value().First());
604 TopExp::Vertices(CE,V1,V2);
605 //--------------------------------
606 // VF vertex start of new wire
607 //--------------------------------
608 if (CE.Orientation() == TopAbs_FORWARD) { CV = VF = V1;}
609 else { CV = VF = V2;}
610 if (!MVE.IsBound(CV)) continue;
611 for ( itl.Initialize(MVE(CV)); itl.More(); itl.Next()) {
612 if (itl.Value().IsEqual(CE)) {
617 End = Standard_False;
620 //-------------------------------
621 // Construction of a wire.
622 //-------------------------------
623 TopExp::Vertices(CE,V1,V2);
624 if (!CV.IsSame(V1)) CV = V1; else CV = V2;
629 if (!MVE.IsBound(CV) || MVE(CV).IsEmpty()) {
633 End = !SelectEdge(myFace,CE,CV,NE,MVE(CV));
636 if (MVE(CV).IsEmpty()) MVE.UnBind(CV);
640 //--------------------------------------------------
641 // Add new wire to the set of wires
642 //------------------------------------------------
643 Standard_Real Tol = 0.001; //5.e-05; //5.e-07;
644 TopExp_Explorer explo( NW, TopAbs_VERTEX );
645 for (; explo.More(); explo.Next())
647 const TopoDS_Vertex& aV = TopoDS::Vertex( explo.Current() );
648 Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*) &(aV).TShape());
649 TV->Tolerance( Tol );
650 TV->Modified( Standard_True );
652 for (explo.Init( NW, TopAbs_EDGE ); explo.More(); explo.Next())
654 const TopoDS_Edge& aE = TopoDS::Edge( explo.Current() );
655 Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &(aE).TShape());
656 TE->Tolerance( Tol );
657 TE->Modified( Standard_True );
660 if (VF.IsSame(CV) && SamePnt2d(VF,EF,CE,myFace))
661 myNewWires.Append (NW);
664 cout <<"BRepAlgo_Loop: Open Wire"<<endl;
666 cout << "OpenWire is : NW_"<<NbLoops<<"_"<<NbWires<<endl;
671 sprintf(name,"NW_%d_%d",NbLoops,NbWires++);
677 PurgeNewEdges(myNewEdges,UsedEdges);
680 //=======================================================================
681 //function : CutEdges
683 //=======================================================================
685 void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
686 const TopTools_ListOfShape& VOnE,
687 TopTools_ListOfShape& NE ) const
689 TopoDS_Shape aLocalE = E.Oriented(TopAbs_FORWARD);
690 TopoDS_Edge WE = TopoDS::Edge(aLocalE);
694 TopTools_SequenceOfShape SV;
695 TopTools_ListIteratorOfListOfShape it(VOnE);
698 for ( ; it.More(); it.Next()) {
699 SV.Append(it.Value());
701 //--------------------------------
702 // Parse vertices on the edge.
703 //--------------------------------
706 Standard_Integer NbVer = SV.Length();
707 //----------------------------------------------------------------
708 // Construction of new edges.
709 // Note : vertices at the extremities of edges are not
710 // onligatorily in the list of vertices
711 //----------------------------------------------------------------
718 BRep_Tool::Range(WE,f,l);
719 TopExp::Vertices(WE,VF,VL);
722 if (SV(1).IsEqual(VF) && SV(2).IsEqual(VL)) {
726 DBRep::Set("ECOpied",E);
732 //----------------------------------------------------
733 // Processing of closed edges
734 // If a vertex of intersection is on the common vertex
735 // it should appear at the beginning and end of SV.
736 //----------------------------------------------------
738 if (!VF.IsNull() && VF.IsSame(VL)) {
739 VCEI = UpdateClosedEdge(WE,SV);
740 if (!VCEI.IsNull()) {
741 TopoDS_Shape aLocalV = VCEI.Oriented(TopAbs_FORWARD);
742 VF = TopoDS::Vertex(aLocalV);
743 aLocalV = VCEI.Oriented(TopAbs_REVERSED);
744 VL = TopoDS::Vertex(aLocalV);
745 // VF = TopoDS::Vertex(VCEI.Oriented(TopAbs_FORWARD));
746 // VL = TopoDS::Vertex(VCEI.Oriented(TopAbs_REVERSED));
752 //-----------------------------------------
753 // Eventually all extremities of the edge.
754 //-----------------------------------------
755 if (!VF.IsNull() && !VF.IsSame(SV.First())) SV.Prepend(VF);
756 if (!VL.IsNull() && !VL.IsSame(SV.Last ())) SV.Append (VL);
759 while (!SV.IsEmpty()) {
760 while (!SV.IsEmpty() &&
761 SV.First().Orientation() != TopAbs_FORWARD) {
766 V1 = TopoDS::Vertex(SV.First());
770 if (SV.First().Orientation() == TopAbs_REVERSED) {
771 V2 = TopoDS::Vertex(SV.First());
773 //-------------------------------------------
774 // Copy the edge and restriction by V1 V2.
775 //-------------------------------------------
776 TopoDS_Shape NewEdge = WE.EmptyCopied();
777 TopoDS_Shape aLocalEdge = V1.Oriented(TopAbs_FORWARD);
778 B.Add (NewEdge,aLocalEdge);
779 aLocalEdge = V2.Oriented(TopAbs_REVERSED);
780 B.Add (TopoDS::Edge(NewEdge),aLocalEdge);
781 // B.Add (NewEdge,V1.Oriented(TopAbs_FORWARD));
782 // B.Add (NewEdge,V2.Oriented(TopAbs_REVERSED));
786 // U1=BRep_Tool::Parameter
787 // (TopoDS::Vertex(V1.Oriented(TopAbs_INTERNAL)),WE);
789 TopoDS_Shape aLocalV = V1.Oriented(TopAbs_INTERNAL);
790 U1=BRep_Tool::Parameter(TopoDS::Vertex(aLocalV),WE);
796 TopoDS_Shape aLocalV = V2.Oriented(TopAbs_INTERNAL);
797 U2=BRep_Tool::Parameter(TopoDS::Vertex(aLocalV),WE);
798 // U2=BRep_Tool::Parameter
799 // (TopoDS::Vertex(V2.Oriented(TopAbs_INTERNAL)),WE);
801 B.Range (TopoDS::Edge(NewEdge),U1,U2);
804 DBRep::Set("Cut",NewEdge);
807 NE.Append(NewEdge.Oriented(E.Orientation()));
811 //Remove edges with size <= tolerance
812 Standard_Real Tol = 0.001; //5.e-05; //5.e-07;
816 // skl : I change "E" to "EE"
817 TopoDS_Edge EE = TopoDS::Edge( it.Value() );
818 Standard_Real fpar, lpar;
819 BRep_Tool::Range( EE, fpar, lpar );
820 if (lpar - fpar <= Precision::Confusion())
825 BRep_Tool::UVPoints( EE, myFace, pf, pl );
826 if (pf.Distance(pl) <= Tol && !EE.Closed())
834 //=======================================================================
835 //function : NewWires
837 //=======================================================================
839 const TopTools_ListOfShape& BRepAlgo_Loop::NewWires() const
844 //=======================================================================
845 //function : NewFaces
847 //=======================================================================
849 const TopTools_ListOfShape& BRepAlgo_Loop::NewFaces() const
854 //=======================================================================
855 //function : WiresToFaces
857 //=======================================================================
859 void BRepAlgo_Loop::WiresToFaces()
861 if (!myNewWires.IsEmpty()) {
862 BRepAlgo_FaceRestrictor FR;
863 TopoDS_Shape aLocalS = myFace.Oriented(TopAbs_FORWARD);
864 FR.Init (TopoDS::Face(aLocalS),Standard_False);
865 // FR.Init (TopoDS::Face(myFace.Oriented(TopAbs_FORWARD)),
867 TopTools_ListIteratorOfListOfShape it(myNewWires);
868 for (; it.More(); it.Next()) {
869 FR.Add(TopoDS::Wire(it.Value()));
875 TopAbs_Orientation OriF = myFace.Orientation();
876 for (; FR.More(); FR.Next()) {
877 myNewFaces.Append(FR.Current().Oriented(OriF));
884 //=======================================================================
885 //function : NewEdges
887 //=======================================================================
889 const TopTools_ListOfShape& BRepAlgo_Loop::NewEdges(const TopoDS_Edge& E) const
891 return myNewEdges(E);
894 //=======================================================================
895 //function : GetVerticesForSubstitute
897 //=======================================================================
899 void BRepAlgo_Loop::GetVerticesForSubstitute( TopTools_DataMapOfShapeShape& VerVerMap ) const
901 VerVerMap = myVerticesForSubstitute;
903 //=======================================================================
904 //function : VerticesForSubstitute
906 //=======================================================================
908 void BRepAlgo_Loop::VerticesForSubstitute( TopTools_DataMapOfShapeShape& VerVerMap )
910 myVerticesForSubstitute = VerVerMap;