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