X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FBRepCheck%2FBRepCheck_Wire.cxx;h=fb576ed7264400fe2c9614fd51baab077e904e2e;hp=0fb2df20a89adfbacc6b70b1c50e247f3503411b;hb=22774b6295ebfe7780fd6df095a868f1503be990;hpb=6f005d2afc72634e1349e61330865d0f8396fa10 diff --git a/src/BRepCheck/BRepCheck_Wire.cxx b/src/BRepCheck/BRepCheck_Wire.cxx index 0fb2df2..fb576ed 100755 --- a/src/BRepCheck/BRepCheck_Wire.cxx +++ b/src/BRepCheck/BRepCheck_Wire.cxx @@ -1529,40 +1529,51 @@ Standard_Boolean BRepCheck_Wire::GeometricControls() const return myGctrl; } - //======================================================================= //function : Propagate //purpose : fill with edges connected to through vertices // contained in //======================================================================= static void Propagate(const TopTools_IndexedDataMapOfShapeListOfShape& mapVE, - const TopoDS_Shape& edg, - TopTools_MapOfShape& mapE) + const TopoDS_Shape& edg, + TopTools_MapOfShape& mapE) { - if (mapE.Contains(edg)) { - return; - } - mapE.Add(edg); // attention, if oriented == Standard_True, edge should - // be FORWARD or REVERSED. It is not checked. - // ============= - // attention, if oriented == Standard_True, must - // be FORWARD or REVERSED. That is not checked. - - TopExp_Explorer ex; - for (ex.Init(edg,TopAbs_VERTEX); ex.More(); ex.Next()) { - const TopoDS_Vertex& vtx = TopoDS::Vertex(ex.Current()); - // debug on vertex - Standard_Integer indv = mapVE.FindIndex(vtx); - if (indv != 0) { - for (TopTools_ListIteratorOfListOfShape itl(mapVE(indv)); itl.More(); itl.Next()) { - if (!itl.Value().IsSame(edg) && - !mapE.Contains(itl.Value())) { - Propagate(mapVE,itl.Value(),mapE); - } + TopTools_ListOfShape currentEdges; + currentEdges.Append(edg); + + do + { + TopTools_ListOfShape nextEdges; + TopTools_ListIteratorOfListOfShape itrc(currentEdges); + for (; itrc.More(); itrc.Next()) + { + const TopoDS_Shape& Edge = itrc.Value(); + mapE.Add(Edge); + + TopExp_Explorer ex(Edge, TopAbs_VERTEX); + for (; ex.More(); ex.Next()) + { + const TopoDS_Vertex& vtx = TopoDS::Vertex(ex.Current()); + Standard_Integer indv = mapVE.FindIndex(vtx); + if (indv != 0) + { + const TopTools_ListOfShape& edges = mapVE(indv); + + TopTools_ListIteratorOfListOfShape itl(edges); + for (; itl.More(); itl.Next()) + { + const TopoDS_Shape& E = itl.Value(); + if (!Edge.IsSame(E) && !mapE.Contains(E)) + nextEdges.Append(E); + } + } } } + currentEdges = nextEdges; } + while (!currentEdges.IsEmpty()); } + //======================================================================= //function : GetOrientation //purpose :