Salome HOME
Merge from OCC_development_generic_2006
[modules/superv.git] / src / GraphEditor / DataFlowEditor_DataFlow.lxx
index e048755c5e0921662043f421db53a66067494586..24f63f6f932c1423e893233dab6e184265c81c0f 100644 (file)
@@ -33,6 +33,8 @@ inline void GraphEditor::DataFlow::ReadOnly() {
   _ReadOnly = true ;
 }
 
+//JR 07.07.2005 : old code from the first prototype
+#if 0
 inline char * GraphEditor::DataFlow::DataFlowInfo() {
   ostringstream s;
   IsValid() ;
@@ -56,6 +58,7 @@ inline char * GraphEditor::DataFlow::NodeInfo( const char * aNodeName ) {
     s << aNodeName << " not found" << ends ;
   return CORBA::string_dup( s.str().c_str() );
 }
+#endif
 
 inline bool GraphEditor::DataFlow::LoadDataFlow( const GraphBase::SGraph * aDataFlow ) {
   if ( _ReadOnly )
@@ -292,7 +295,7 @@ inline bool GraphEditor::DataFlow::AddLinkCoord(
                          const int nXY ,
                          const int* X ,
                          const int* Y ) {
-  _EditedAfterExecution = true ;
+  //_EditedAfterExecution = true ; // mkr : fix for bug IPAL9818
   return GraphEditor::OutNode::AddLinkCoord( FromNodeName ,
                                              FromServiceParameterName ,
                                              ToNodeName ,
@@ -308,7 +311,7 @@ inline bool GraphEditor::DataFlow::AddLinkCoord(
                          const int index ,
                          const int X ,
                          const int Y ) {
-  _EditedAfterExecution = true ;
+  //_EditedAfterExecution = true ; // mkr : fix for bug IPAL9818
   return GraphEditor::OutNode::AddLinkCoord( FromNodeName ,
                                              FromServiceParameterName ,
                                              ToNodeName ,
@@ -324,7 +327,7 @@ inline bool GraphEditor::DataFlow::ChangeLinkCoord(
                          const int index ,
                          const int X ,
                          const int Y ) {
-  _EditedAfterExecution = true ;
+  //_EditedAfterExecution = true ; // mkr : fix for bug IPAL9818
   return GraphEditor::OutNode::ChangeLinkCoord( FromNodeName ,
                                                 FromServiceParameterName ,
                                                 ToNodeName ,
@@ -338,7 +341,7 @@ inline bool GraphEditor::DataFlow::RemoveLinkCoord(
                          const char* ToNodeName ,
                          const char* ToServiceParameterName ,
                          const int index ) {
-  _EditedAfterExecution = true ;
+  //_EditedAfterExecution = true ; // mkr : fix for bug IPAL9818
   return GraphEditor::OutNode::RemoveLinkCoord( FromNodeName ,
                                                 FromServiceParameterName ,
                                                 ToNodeName ,
@@ -424,8 +427,10 @@ inline const CORBA::Any GraphEditor::DataFlow::GetOutData(
 
 //JR Optional parameter kLoopSwitch (default = true) :
 //In some cases we do not need to check the validity of loops and switchs
-inline bool GraphEditor::DataFlow::IsValid(bool kLoopSwitch ) {
-  return GraphEditor::OutNode::IsValid( kLoopSwitch ) ;
+//inline bool GraphEditor::DataFlow::IsValid(bool kLoopSwitch ) {
+inline bool GraphEditor::DataFlow::IsValid() {
+//  return GraphEditor::OutNode::IsValid( kLoopSwitch ) ;
+  return GraphEditor::OutNode::IsValid() ;
 }
 
 inline bool GraphEditor::DataFlow::IsExecutable() {
@@ -470,35 +475,49 @@ inline bool GraphEditor::DataFlow::IsReadOnly() {
 }
 
 inline long GraphEditor::DataFlow::LevelMax() {
-  if ( !IsValid() ) {
+//  if ( !IsValid( false ) ) {
+//  if ( !IsExecutable() ) {
+  // mkr : IPAL9974 -->
+  int SubStreamGraphsNumber = 0 ;
+  if ( !IsValid() || !Graph()->Sort( SubStreamGraphsNumber ) ) {
+  // mkr : IPAL9974 <-- 
     return 0 ;
   }
   return Graph()->LevelMax() ;
 }
 
 inline SUPERV::ListOfStrings * GraphEditor::DataFlow::LevelNodes(long aLevel ) {
-  if ( !IsValid( false ) ) {
+//  if ( !IsValid( false ) ) {
+//  if ( !IsExecutable() ) {
+  if ( !IsValid() ) { // mkr : IPAL9974
     return ((SUPERV::ListOfStrings * ) NULL ) ;
   }
   return Graph()->LevelNodes( aLevel ) ;
 }
 
 inline long GraphEditor::DataFlow::ThreadsMax() {
-  if ( !IsValid() ) {
+//  if ( !IsValid() ) {
+//  if ( !IsExecutable() ) {
+  // mkr : IPAL9974 -->
+  int SubStreamGraphsNumber = 0 ;      
+  if ( !IsValid()  || !Graph()->Sort( SubStreamGraphsNumber ) ) {
+  // mkr : IPAL9974 <--
     return 0 ;
   }
   return Graph()->ThreadsMax() ;
 }
 
 inline long GraphEditor::DataFlow::SubGraphsNumber() {
-  if ( !IsValid() ) {
+//  if ( !IsValid() ) {
+  if ( !IsExecutable() ) {
     return 0 ;
   }
   return Graph()->SubGraphsNumber() ;
 }
 
 inline long GraphEditor::DataFlow::SubStreamGraphsNumber() {
-  if ( !IsValid() ) {
+//  if ( !IsValid() ) {
+  if ( !IsExecutable() ) {
     return 0 ;
   }
   return StreamGraph()->SubStreamGraphsNumber() ;