]> OCCT Git - occt-copy.git/commitdiff
0030497: [REGRESSION] Mesh - wrong Poly_Polygon3D within local selection of located...
authornds <nds@opencascade.com>
Mon, 4 Mar 2019 06:36:43 +0000 (09:36 +0300)
committernds <nds@opencascade.com>
Mon, 4 Mar 2019 06:36:43 +0000 (09:36 +0300)
src/IMeshTools/IMeshTools_ShapeExplorer.cxx
tests/bugs/moddata_3/bug30497 [deleted file]

index ba7636f08c02b6268d7a0f5eda80dc16003e0e02..4df32b0b8ceccd42cd93515fcc1cf6f38116ffb1 100644 (file)
@@ -50,11 +50,14 @@ IMeshTools_ShapeExplorer::~IMeshTools_ShapeExplorer ()
 void IMeshTools_ShapeExplorer::Accept (
   const Handle (IMeshTools_ShapeVisitor)& theVisitor)
 {
-  // Explore all free edges in shape.
-  TopExp_Explorer aFreeEdgesIt (GetShape (), TopAbs_EDGE, TopAbs_FACE);
-  for (; aFreeEdgesIt.More(); aFreeEdgesIt.Next())
+  // Explore all edges in shape - either free or related to some face.
+  TopTools_IndexedMapOfShape aEdges;
+  TopExp::MapShapes (GetShape (), TopAbs_EDGE, aEdges);
+
+  TopTools_IndexedMapOfShape::Iterator aEdgeIt (aEdges);
+  for (; aEdgeIt.More (); aEdgeIt.Next ())
   {
-    const TopoDS_Edge& aEdge = TopoDS::Edge (aFreeEdgesIt.Current());
+    const TopoDS_Edge& aEdge = TopoDS::Edge (aEdgeIt.Value ());
     if (!BRep_Tool::IsGeometric(aEdge))
     {
       continue;
@@ -63,11 +66,12 @@ void IMeshTools_ShapeExplorer::Accept (
     theVisitor->Visit (aEdge);
   }
 
-  // Explore all related to some face edges in shape.
+  // Explore faces
   TopTools_ListOfShape aFaceList;
   BRepLib::ReverseSortFaces (GetShape (), aFaceList);
   TopTools_MapOfShape aFaceMap;
 
+  // make array of faces suitable for processing (excluding faces without surface)
   TopLoc_Location aDummyLoc;
   const TopLoc_Location aEmptyLoc;
   TopTools_ListIteratorOfListOfShape aFaceIter (aFaceList);
@@ -87,40 +91,6 @@ void IMeshTools_ShapeExplorer::Accept (
       continue;
     }
 
-    TopExp_Explorer anEdgesExp (aFace, TopAbs_EDGE);
-    for (; anEdgesExp.More(); anEdgesExp.Next())
-    {
-      const TopoDS_Edge& aEdge =  TopoDS::Edge (anEdgesExp.Current());
-      if (!BRep_Tool::IsGeometric(aEdge))
-      {
-        continue;
-      }
-
-      theVisitor->Visit (aEdge);
-    }
-  }
-
-  // Explore faces
-  aFaceMap.Clear();
-
-  // make array of faces suitable for processing (excluding faces without surface)
-  aFaceIter.Init (aFaceList);
-  for (; aFaceIter.More (); aFaceIter.Next ())
-  {
-    TopoDS_Shape aFaceNoLoc = aFaceIter.Value ();
-    aFaceNoLoc.Location (aEmptyLoc);
-    if (!aFaceMap.Add(aFaceNoLoc))
-    {
-      continue; // already processed
-    }
-
-    TopoDS_Face aFace = TopoDS::Face (aFaceIter.Value ());
-    const Handle (Geom_Surface)& aSurf = BRep_Tool::Surface (aFace, aDummyLoc);
-    if (aSurf.IsNull())
-    {
-      continue;
-    }
-
     // Store only forward faces in order to prevent inverse issue.
     theVisitor->Visit (TopoDS::Face (aFace.Oriented (TopAbs_FORWARD)));
   }
diff --git a/tests/bugs/moddata_3/bug30497 b/tests/bugs/moddata_3/bug30497
deleted file mode 100644 (file)
index 239b481..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-puts "======="
-puts "0030497"
-puts "======="
-puts ""
-##################################################
-# [REGRESSION] Mesh - wrong Poly_Polygon3D within local selection of located shape
-##################################################
-
-pload XDE VISUALIZATION
-testreadstep as1-oc-214-mat.stp s
-
-vclear
-vinit View1
-vaxo
-vdisplay s -dispmode 1
-vfit
-vselmode 2 1
-vmoveto 150 201