]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Bug 0020185: EDF SMESH 967 : Anomaly in Merge Nodes. BR_V5_DEV
authorjfa <jfa@opencascade.com>
Mon, 2 Mar 2009 14:49:33 +0000 (14:49 +0000)
committerjfa <jfa@opencascade.com>
Mon, 2 Mar 2009 14:49:33 +0000 (14:49 +0000)
src/SMESH/SMESH_MeshEditor.cxx

index 063f68819b32d16555af4e0042897aa02c1fdbac..38eca5bf862e6b1913e329cb801f82a80bf045af 100644 (file)
@@ -4846,6 +4846,25 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes)
       TNodeNodeMap::iterator nnIt = nodeNodeMap.find( n );
       if ( nnIt != nodeNodeMap.end() ) { // n sticks
         n = (*nnIt).second;
+        // BUG 0020185: begin
+        {
+          bool stopRecur = false;
+          set<const SMDS_MeshNode*> nodesRecur;
+          nodesRecur.insert(n);
+          while (!stopRecur) {
+            TNodeNodeMap::iterator nnIt_i = nodeNodeMap.find( n );
+            if ( nnIt_i != nodeNodeMap.end() ) { // n sticks
+              n = (*nnIt_i).second;
+              if (!nodesRecur.insert(n).second) {
+                // error: recursive dependancy
+                stopRecur = true;
+              }
+            }
+            else
+              stopRecur = true;
+          }
+        }
+        // BUG 0020185: end
         iRepl[ nbRepl++ ] = iCur;
       }
       curNodes[ iCur ] = n;