X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_Tree.hxx;h=a5c01cb8e975b930d6246a465f1390d4b6fea7fa;hb=b79f3c0765077420af47201c7f12b5654a6c04ed;hp=6afd6e03f0dcf519c863cd9daf353c895fccf2b2;hpb=afb6b35047b55252975cad1be72871038ca01b51;p=modules%2Fsmesh.git diff --git a/src/SMESHUtils/SMESH_Tree.hxx b/src/SMESHUtils/SMESH_Tree.hxx index 6afd6e03f..a5c01cb8e 100644 --- a/src/SMESHUtils/SMESH_Tree.hxx +++ b/src/SMESHUtils/SMESH_Tree.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 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 @@ -31,6 +31,8 @@ #include "SMESH_Utils.hxx" +const double theEnlargeFactor = 1. + 1e-10; + //================================================================================ // Data limiting the tree height struct SMESH_TreeLimit { @@ -160,6 +162,7 @@ void SMESH_Tree::compute() { if ( !myLimit ) myLimit = new SMESH_TreeLimit(); myBox = buildRootBox(); + enlargeByFactor( myBox, theEnlargeFactor ); if ( myLimit->myMinBoxSize > 0. && maxSize() <= myLimit->myMinBoxSize ) myIsLeaf = true; else @@ -227,7 +230,7 @@ void SMESH_Tree::buildChildren() myChildren[i]->myLimit = myLimit; myChildren[i]->myLevel = myLevel + 1; myChildren[i]->myBox = newChildBox( i ); - enlargeByFactor( myChildren[i]->myBox, 1. + 1e-10 ); + enlargeByFactor( myChildren[i]->myBox, theEnlargeFactor ); if ( myLimit->myMinBoxSize > 0. && myChildren[i]->maxSize() <= myLimit->myMinBoxSize ) myChildren[i]->myIsLeaf = true; } @@ -268,14 +271,14 @@ int SMESH_Tree::getHeight(const bool full) const if ( isLeaf() ) return 1; - int heigth = 0; + int height = 0; for (int i = 0; igetHeight( false ); - if ( h > heigth ) - heigth = h; + if ( h > height ) + height = h; } - return heigth + 1; + return height + 1; } #endif