Salome HOME
desactive traces
[modules/hydro.git] / src / HYDROData / HYDROData_Tree.hxx
old mode 100644 (file)
new mode 100755 (executable)
index c946caa..1c67bc6
@@ -29,6 +29,9 @@
 #ifndef _HYDROData_Tree_HXX_
 #define _HYDROData_Tree_HXX_
 
+#include <HYDROData_Tool.h>
+#include <Message_ProgressSentry.hxx>
+
 //================================================================================
 
 //! Data limiting the tree height
@@ -204,6 +207,10 @@ void HYDROData_Tree<BND_BOX, NB_CHILDREN>::buildChildren()
         root = root->myFather;
       rootSize = root->maxSize();
     }
+  
+  Handle(Message_ProgressIndicator) aZIProgress = myLevel == 0 ? HYDROData_Tool::GetZIProgress() : NULL;
+  Message_ProgressSentry aPSentry(aZIProgress, "QuadTree", 0, NB_CHILDREN + 1, 1);
+
   for (int i = 0; i < NB_CHILDREN; i++)
     {
       // The child is of the same type than its father (For instance, a HYDROData_OctreeNode)
@@ -224,9 +231,16 @@ void HYDROData_Tree<BND_BOX, NB_CHILDREN>::buildChildren()
   // --- After building the NB_CHILDREN boxes, we put the data into the children.
   buildChildrenData();
 
+  if (aPSentry.More()) {
+    aPSentry.Next();
+  }
+
   // --- After we pass to the next level of the Tree
-  for (int i = 0; i < NB_CHILDREN; i++)
+  for (int i = 0; i < NB_CHILDREN && aPSentry.More(); i++, aPSentry.Next()) {
     myChildren[i]->buildChildren();
+  }
+
+  aPSentry.Relieve();
 }
 
 /*!