X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_Octree.cxx;h=4c9d4dbefa8487d9230d3ed39ed7c5fa7f1ac3d0;hp=e7b049722399abd872d5a4fe6adb4eafe325f7a5;hb=6d32f944a0a115b6419184c50b57bf7c4eef5786;hpb=7a65c9fad427b1ccba6b9ccae612296e5092a324 diff --git a/src/SMESHUtils/SMESH_Octree.cxx b/src/SMESHUtils/SMESH_Octree.cxx index e7b049722..4c9d4dbef 100644 --- a/src/SMESHUtils/SMESH_Octree.cxx +++ b/src/SMESHUtils/SMESH_Octree.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2019 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 @@ -77,3 +77,20 @@ double SMESH_Octree::maxSize() const } return 0.; } + +//================================================================================ +/*! + * \brief Change size of a box by a factor; each dimension changes independently of others + */ +//================================================================================ + +void SMESH_Octree::enlargeByFactor( Bnd_B3d* box, double factor ) const +{ + if ( !box->IsVoid() ) + { + gp_XYZ halfSize = 0.5 * ( box->CornerMax() - box->CornerMin() ); + for ( int iDim = 1; iDim <= 3; ++iDim ) + halfSize.SetCoord( iDim, factor * halfSize.Coord( iDim )); + box->SetHSize( halfSize ); + } +}