Salome HOME
23514: EDF 16031 - SMESH freezes
[modules/smesh.git] / src / SMESHUtils / SMESH_Quadtree.cxx
index 9d8a6ebf4739998a0e1470d3a360f0e06142996a..38cd2ef09a3d7e69a2bdcf9eb330003b26ac7843 100644 (file)
@@ -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 );
+  }
+}