Salome HOME
0021869: [CEA 672] Clipping always apply even with auto-apply not checked
[modules/smesh.git] / src / SMESHUtils / SMESH_OctreeNode.cxx
index f735011e6ea84b6a0bf94e64e0a705016def0008..d14a50a2465106b190ee8ad57afc373a14ab16b5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -249,7 +249,9 @@ void SMESH_OctreeNode::FindCoincidentNodes (TIDSortedNodeSet& theSetOfNodes,
                                             const int maxLevel,
                                             const int maxNbNodes)
 {
-  SMESH_OctreeNode theOctreeNode(theSetOfNodes, maxLevel, maxNbNodes, theTolerance);
+  // VSR 14/10/2011: limit max number of the levels in order to avoid endless recursing
+  const int MAX_LEVEL = 10;
+  SMESH_OctreeNode theOctreeNode(theSetOfNodes, maxLevel < 0 ? MAX_LEVEL : maxLevel, maxNbNodes, theTolerance);
   theOctreeNode.FindCoincidentNodes (&theSetOfNodes, theTolerance, theGroupsOfNodes);
 }