X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_Octree.cxx;h=3c94c852846566cb78cb1c9e0d62956adfa6e825;hb=5c49d3d8ef7848e3eca007eb38d6513668413b0c;hp=859fe3f3901d6bb41bdb3475d335d7f255c39498;hpb=7eda9ca931ed2a11cb5e4637e4ffe19f5c061115;p=modules%2Fsmesh.git diff --git a/src/SMESHUtils/SMESH_Octree.cxx b/src/SMESHUtils/SMESH_Octree.cxx index 859fe3f39..3c94c8528 100644 --- a/src/SMESHUtils/SMESH_Octree.cxx +++ b/src/SMESHUtils/SMESH_Octree.cxx @@ -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 ); + } +}