From 2bd83d5b0b6c2b01e06dae2373d4de25034ed458 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 2 Mar 2009 14:57:00 +0000 Subject: [PATCH] Bug 0020185: EDF SMESH 967 : Anomaly in Merge Nodes. --- src/SMESH/SMESH_MeshEditor.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 063f68819..38eca5bf8 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -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 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; -- 2.39.2