]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/engine/ComposedNode.cxx
Salome HOME
Manage initnode and finalizenode in the foreachloop progress bar.
[modules/yacs.git] / src / engine / ComposedNode.cxx
index 39fa5bef897a073f92d1940cbc14747a97944498..69870fa47361573d05655d249615ade665cdeb68 100644 (file)
@@ -1045,7 +1045,7 @@ void ComposedNode::checkInMyDescendance(Node *nodeToTest) const throw(YACS::Exce
  */
 ComposedNode *ComposedNode::getLowestCommonAncestor(Node *node1, Node *node2) throw(YACS::Exception)
 {
-  const char what[]="2 nodes does not share the same genealogy";
+  const char what[]="The two nodes do not share the same genealogy";
   if(node1==0 || node2==0)
     throw Exception(what);
   ComposedNode *temp;
@@ -1131,6 +1131,24 @@ list<Node *> ComposedNode::getAllRecursiveNodes()
   return ret;
 }
 
+
+//! Get the progress weight for all elementary nodes
+/*!
+ * Only elementary nodes have weight. A simple composed node only sum up weight of all his descendants
+ * (working is different for loop or switch nodes)
+ */
+list<ProgressWeight> ComposedNode::getProgressWeight() const
+{
+  list<ProgressWeight> ret;
+  list<Node *> setOfNode=edGetDirectDescendants();
+  for(list<Node *>::const_iterator iter=setOfNode.begin();iter!=setOfNode.end();iter++)
+    {
+      list<ProgressWeight> myCurrentSet=((ComposedNode*)(*iter))->getProgressWeight();
+      ret.insert(ret.end(),myCurrentSet.begin(),myCurrentSet.end());
+    }
+  return ret;
+}
+
 //! Get the input port name 
 /*!
  * get the input port name used by the current node, recursively built with children names.