]> SALOME platform Git repositories - modules/superv.git/blobdiff - src/GraphEditor/DataFlowEditor_OutNode.cxx
Salome HOME
Merge from OCC_development_generic_2006
[modules/superv.git] / src / GraphEditor / DataFlowEditor_OutNode.cxx
index 5221b4f8f01ffc09eb0b925e8236f1798842bc0d..52d6601074ac71b7ad3b5b52e0a286e7d4f42d1a 100644 (file)
@@ -36,14 +36,11 @@ using namespace std;
 map< string , int > _MapOfGraphNames;
 
 string GraphInstanceName( const char * aGraphName ) {
+  // mkr : PAL8004 -->
+  // For Macro nodes : names of subgraphs must be unique and differ from the main dataflow
+  // name (i.e. the dataflow with MacroLevel = 0).
+  // It is neccessary for reqursive call of LoadDataFlows(...) method for MacroNodes execution.
   int GraphInstanceNumber = _MapOfGraphNames[ aGraphName ] ;
-  if ( GraphInstanceNumber ) {
-    _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ;
-  }
-  else {
-    GraphInstanceNumber = 0 ;
-    _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ;
-  }
   string theGraphInstanceName = string( aGraphName ) ;
   if ( GraphInstanceNumber ) {
     theGraphInstanceName += "_" ;
@@ -51,6 +48,10 @@ string GraphInstanceName( const char * aGraphName ) {
     astr << GraphInstanceNumber ;
     theGraphInstanceName += astr.str() ;
   }
+  if ( theGraphInstanceName != string( aGraphName ) )
+    _MapOfGraphNames[ theGraphInstanceName ] = GraphInstanceNumber ;
+  _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ;
+  // mkr : PAL8004 <--
   return theGraphInstanceName ;
 }