Salome HOME
Initial merge of branch 'BR_HYDRO_IMPS_2016' into BR_PORTING_OCCT_7
[modules/hydro.git] / src / HYDROData / HYDROData_QuadtreeNode.cxx
index 64d3ecb06288a5af74f1a807b301c17cb74c3cae..11fe12cd2e51c99fa5a3a253be6d05728662b266 100644 (file)
@@ -47,14 +47,14 @@ HYDROData_QuadtreeNode::HYDROData_QuadtreeNode(Nodes_3D* theNodes,
                                                const int maxLevel,
                                                const int maxNbNodes,
                                                const double minBoxSize) :
-    HYDROData_Quadtree(new Limit(maxLevel, minBoxSize, maxNbNodes)), myNodes(theNodes)
+    HYDROData_Quadtree(new Limit(maxLevel, minBoxSize, maxNbNodes)), myNodes(theNodes), myPrecision(0.25)
 {
-  DEBTRACE("---------------------------- HYDROData_QuadtreeNode root constructor");
+  //DEBTRACE("---------------------------- HYDROData_QuadtreeNode root constructor");
    if (myNodes)
     {
-      DEBTRACE(" --- start compute");
+      //DEBTRACE(" --- start compute");
       compute();
-      DEBTRACE(" --- end compute");
+      //DEBTRACE(" --- end compute");
     }
 }
 
@@ -62,10 +62,9 @@ HYDROData_QuadtreeNode::HYDROData_QuadtreeNode(Nodes_3D* theNodes,
  * \brief Constructor used to allocate a child
  */
 HYDROData_QuadtreeNode::HYDROData_QuadtreeNode() :
-    HYDROData_Quadtree()
+    HYDROData_Quadtree(), myNodes(0), myPrecision(0.25)
 {
-  if (myNodes == 0)
-    myNodes = new Nodes_3D();
+  myNodes = new Nodes_3D();
 }
 
 /*!
@@ -89,11 +88,11 @@ void HYDROData_QuadtreeNode::setNodesAndCompute(Nodes_3D* theNodes)
   myNodes = theNodes;
   if (myNodes)
     {
-      DEBTRACE(" --- start compute");
+      //DEBTRACE(" --- start compute");
       compute();
-      DEBTRACE(" --- end compute : children & height " << this->nbChildren() << " " << this->getHeight());
-      DEBTRACE("Bounding box min: " << this->myBox->CornerMin().X() << " "  << this->myBox->CornerMin().Y());
-      DEBTRACE("Bounding box max: " << this->myBox->CornerMax().X() << " "  << this->myBox->CornerMax().Y());
+      //DEBTRACE(" --- end compute : children & height " << this->nbChildren() << " " << this->getHeight());
+      //DEBTRACE("Bounding box min: " << this->myBox->CornerMin().X() << " "  << this->myBox->CornerMin().Y());
+      //DEBTRACE("Bounding box max: " << this->myBox->CornerMax().X() << " "  << this->myBox->CornerMax().Y());
     }
 }
 
@@ -124,7 +123,7 @@ Bnd_B2d* HYDROData_QuadtreeNode::buildRootBox()
   Nodes_3D::iterator it = myNodes->begin();
   for (; it != myNodes->end(); it++)
     {
-      const gp_XYZ* n1 = *it;
+      const gpi_XYZ* n1 = *it;
       gp_XY p1(n1->X(), n1->Y());
       box->Add(p1);
     }
@@ -163,7 +162,7 @@ void HYDROData_QuadtreeNode::buildChildrenData()
   Nodes_3D::iterator it = myNodes->begin();
   while (it != myNodes->end())
     {
-      gp_XYZ* n1 = *it;
+      gpi_XYZ* n1 = *it;
       int ChildBoxNum = getChildIndex(n1->X(), n1->Y(), mid);
       HYDROData_QuadtreeNode* myChild = dynamic_cast<HYDROData_QuadtreeNode*>(myChildren[ChildBoxNum]);
       myChild->myNodes->push_back(n1);
@@ -188,7 +187,7 @@ void HYDROData_QuadtreeNode::buildChildrenData()
  * \param Result - list of Nodes potentials to be near Node
  */
 void HYDROData_QuadtreeNode::NodesAround(const gp_XY& Node,
-                                         list<const gp_XYZ*>* Result,
+                                         list<const gpi_XYZ*>* Result,
                                          const double precision)
 {
   gp_XY p(Node);
@@ -218,7 +217,7 @@ void HYDROData_QuadtreeNode::NodesAround(const gp_XY& Node,
  *  \retval bool - true if an exact overlapping found !!!
  */
 bool HYDROData_QuadtreeNode::NodesAround(const gp_XY& node,
-                                         map<double, const gp_XYZ*>& dist2Nodes,
+                                         map<double, const gpi_XYZ*>& dist2Nodes,
                                          double precision)
 {
   if (!dist2Nodes.empty())
@@ -247,7 +246,7 @@ bool HYDROData_QuadtreeNode::NodesAround(const gp_XY& node,
           Nodes_3D::iterator nIt = myNodes->begin();
           for (; nIt != myNodes->end(); ++nIt)
             {
-              const gp_XYZ* p = *nIt;
+              const gpi_XYZ* p = *nIt;
               gp_XY p2(p->X(), p->Y());
               double dist2 = (node - p2).SquareModulus();
               if (dist2 < minDist)