X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_Quadtree.cxx;h=5b5e36137fc8cfd394e4a039c70b3d8bc2e3e491;hb=16a07c876163e3c993e41db77e9181789b7324b8;hp=680c4db0a068df194684422b7f0e86cfc3323c1f;hpb=1067ffa6e7e5c394e3a1b17219d8b355a57607cd;p=modules%2Fsmesh.git diff --git a/src/SMESHUtils/SMESH_Quadtree.cxx b/src/SMESHUtils/SMESH_Quadtree.cxx index 680c4db0a..5b5e36137 100644 --- a/src/SMESHUtils/SMESH_Quadtree.cxx +++ b/src/SMESHUtils/SMESH_Quadtree.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 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 @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -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 ); + } +}