Salome HOME
PAL9048, PAL9342, PAL9133
[modules/superv.git] / src / GraphEditor / DataFlowEditor_OutNode.hxx
index a439910e61bd12b3f55feeb9e6950cca4703cd71..4369702ffa95da4897426fbc11790512a87c9fa4 100644 (file)
@@ -50,7 +50,8 @@ namespace GraphEditor {
 
       CORBA::ORB_ptr _Orb;
 
-      bool Valid(bool kLoopSwitch = true ) ;
+//      bool Valid(bool kLoopSwitch = true ) ;
+      bool Valid() ;
       bool Executable() ;
 
       bool LoadNodes( map< string , int > & aMapOfNodes ,
@@ -170,9 +171,15 @@ namespace GraphEditor {
            return _Graph->RemoveNode( NodeName ) ; } ;
       bool ReNameNode( const char* OldNodeName ,
                        const char* NewNodeName ) {
-           DateModification() ;
-           _Valid = false ;
-           return _Graph->ReNameNode( OldNodeName , NewNodeName ) ; } ;
+//PAL9048 JR Debug : a node may not have the same name as the graph
+           if ( strcmp( Graph()->Name() , NewNodeName ) ) {
+             DateModification() ;
+             _Valid = false ;
+             return _Graph->ReNameNode( OldNodeName , NewNodeName ) ;
+          }
+           cdebug << "Editor::OutNode::ReNameNode ERROR "  << NewNodeName << " already exists"
+                  << endl ;
+           return false ; } ;
 
       void Coordinates( const int X , const int Y ) {
            return _Graph->Coordinates( X , Y ) ; } ;
@@ -272,15 +279,19 @@ namespace GraphEditor {
                          const int index , long &X , long &Y ) ;
 
 
-      bool IsValid(bool kLoopSwitch = true ) {
+//      bool IsValid(bool kLoopSwitch = true ) {
+      bool IsValid( ) {
            if ( !_Valid )
-             Valid( kLoopSwitch ) ;
+//             Valid( kLoopSwitch ) ;
+             Valid() ;
            return _Valid ; } ;
       bool IsNotValid() const {
            return !_Valid ; } ;
       bool UnValid() ;
 
       bool IsExecutable() {
+           cdebug_in << "Editor::OutNode::IsExecutable() " << " _Valid " << _Valid
+                     << " _Executable " << _Executable << endl;
            if ( !_Valid )
              Valid() ;
            if ( _Valid ) {
@@ -289,6 +300,8 @@ namespace GraphEditor {
           }
            else
              _Executable = false ;
+           cdebug_out << "Editor::OutNode::IsExecutable() " << " _Valid " << _Valid
+                      << " _Executable " << _Executable << endl ;
            return _Executable ; } ;
       bool IsNotExecutable() const {
            return !_Executable ; } ;