Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/smesh.git] / src / SMESH / SMESH_Octree.cxx
index 5b224ae5d8ff163c56c6b4a097cb6373e3f43bea..93d241c7e3232ec29be81313474a3c444e08ec34 100644 (file)
@@ -71,8 +71,9 @@ SMESH_Octree::~SMESH_Octree ()
 //===========================================================================
 void SMESH_Octree::setBox(const Bnd_B3d* box)
 {
 //===========================================================================
 void SMESH_Octree::setBox(const Bnd_B3d* box)
 {
-  delete myBox;
-  myBox=new Bnd_B3d(*box);
+//   delete myBox;
+//   myBox=new Bnd_B3d(*box);
+  *myBox = *box;
 }
 
 //===========================================================================
 }
 
 //===========================================================================
@@ -81,11 +82,12 @@ void SMESH_Octree::setBox(const Bnd_B3d* box)
  * \param box          - Set box to the 3d Bounding Box of the Octree
  */
 //===========================================================================
  * \param box          - Set box to the 3d Bounding Box of the Octree
  */
 //===========================================================================
-void SMESH_Octree::getBox(Bnd_B3d* box)
+void SMESH_Octree::getBox(Bnd_B3d& box)
 {
 {
-  if(box != NULL)
-    delete box;
-  box = new Bnd_B3d (*myBox);
+//   if(box != NULL)
+//     delete box;
+//   box = new Bnd_B3d (*myBox);
+  box = *myBox;
 }
 
 //===========================================================================
 }
 
 //===========================================================================
@@ -135,7 +137,7 @@ void SMESH_Octree::Compute()
 //=================================================================
 void SMESH_Octree::buildChildren()
 {
 //=================================================================
 void SMESH_Octree::buildChildren()
 {
-  myChildren = new (SMESH_Octree*)[8];
+  myChildren = new SMESH_Octree*[8];
 
   gp_XYZ min = myBox->CornerMin();
   gp_XYZ max = myBox->CornerMax();
 
   gp_XYZ min = myBox->CornerMin();
   gp_XYZ max = myBox->CornerMax();