Salome HOME
Fix for the bug IPAL22851: Sub-shapes spelling
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Gluer2_3.cxx
index b6ab53be94dacf05beaf2ce9aa4559389c2fad61..06aaf308dd7de1ae59e41469233ce9750eccd396 100644 (file)
@@ -22,8 +22,7 @@
 // File:       GEOMAlgo_Gluer2_3.cxx
 // Created:    
 // Author:     Peter KURNEV
-//             <peter@PREFEX>
-//
+
 #include <GEOMAlgo_Gluer2.hxx>
 
 #include <TopAbs_ShapeEnum.hxx>
@@ -236,7 +235,7 @@ void GEOMAlgo_Gluer2::TreatPair(const NMTTools_CoupleOfShape& aCS,
   // 2. Append the pair to the aLCS
   aLCS.Append(aCS);
   //
-  // 3. Treatment the subshapes of the pair
+  // 3. Treatment the sub-shapes of the pair
   aType=aS1.ShapeType();
   if (aType==TopAbs_VERTEX) {
     return;
@@ -332,16 +331,41 @@ void MapShapes1(const TopoDS_Shape& aS,
               const TopAbs_ShapeEnum aType,
               TopTools_IndexedMapOfShape& aM)
 {
-  TopExp_Explorer aEx (aS, aType);
-  while (aEx.More()) {
-    const TopoDS_Shape aSx=aEx.Current();
+  TopExp_Explorer aExp;
+  
+  aExp.Init (aS, aType);
+  for ( ;aExp.More(); aExp.Next()) {
+    const TopoDS_Shape aSx=aExp.Current();
+    if (aType==TopAbs_EDGE) {
+      const TopoDS_Edge& aEx=*((TopoDS_Edge*)&aSx);
+      if (BRep_Tool::Degenerated(aEx)) {
+       continue;
+      }
+    }
+    aM.Add(aSx);
+  }
+}
+/*
+//=======================================================================
+//function : MapShapes1
+//purpose  : 
+//=======================================================================
+void MapShapes1(const TopoDS_Shape& aS,
+              const TopAbs_ShapeEnum aType,
+              TopTools_IndexedMapOfShape& aM)
+{
+  TopExp_Explorer aExp (aS, aType);
+  while (aExp.More()) {
+    const TopoDS_Shape aSx=aExp.Current();
     if (aType==TopAbs_EDGE) {
       const TopoDS_Edge& aEx=*((TopoDS_Edge*)&aSx);
       if (BRep_Tool::Degenerated(aEx)) {
+       aExp.Next();
        continue;
       }
     }
     aM.Add(aSx);
-    aEx.Next();
+    aExp.Next();
   }
 }
+*/