Salome HOME
SMH: 3.0.0 preparation = merged version (POLYWORK + RTVDEBUG01) + adopation for new GUI
[modules/superv.git] / src / Supervision / LNode_Impl.cxx
index 6f06bf3e1b09eb14c70e82f0d5cc5ab88d2d5ec6..00d18232c43c44682c245248a4767abbf9c7cea4 100644 (file)
@@ -1,18 +1,21 @@
-using namespace std;
-//=============================================================================
-// File      : LNode_Impl.cxx
-// Created   : Nov 2001
-// Author    : Jean Rahuel
-// Project   : SALOME
-// $Header: 
-//=============================================================================
+//  SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
+//
+//  Copyright (C) 2003  CEA/DEN, EDF R&D
+//
+//
+//
+//  File   : LNode_Impl.cxx
+//  Author : Jean Rahuel
+//  Module : SUPERV
+//  $Header: 
 
+using namespace std;
 #include <stdio.h>
 #include <fstream>
-#include <strstream>
+//#include <sstream>
 #include <string>
 
-#include "utilities.h"
+//#include "utilities.h"
 
 #include "LNode_Impl.hxx"
 
@@ -76,25 +79,38 @@ LNode_Impl::~LNode_Impl() {
 void LNode_Impl::destroy() {
   beginService( "LNode_Impl::Destroy" );
   if ( DataFlowEditor()->IsEditing() ) {
+    SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
     if ( Delete() ) {
       _poa->deactivate_object(*_id) ;
       CORBA::release(_poa) ;
       delete(_id) ;
       _thisObj->_remove_ref();
     }
+    else {
+      MESSAGE("LNode_Impl::destroy ERROR ") ;
+    }
+    if ( !CORBA::is_nil( aCoupled ) ) {
+//      aCoupled->SetCoupled( "" ) ; : Used in GraphBase::Graph::RemoveNode( EndLoopNode ) :
+      aCoupled->destroy() ;
+    }
+// Valid() only after deletion of the corresponding EndLoopNode :
+    DataFlowEditor()->UnValid() ;
   }
   endService( "LNode_Impl::Destroy" );
 }
 
 bool LNode_Impl::Delete() {
-//  beginService( "LNode_Impl::Delete" );
-  bool RetVal = false ;
+  beginService( "LNode_Impl::Delete" );
+  bool RetVal = false ;  
   if ( DataFlowEditor()->IsEditing() ) {
+    DeletePorts() ;
     RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
-    if ( RetVal )
-      RetVal = DataFlowEditor()->IsValid() ;
+// Valid() only after deletion of the corresponding EndLoopNode :
+//    if ( RetVal ) {
+//      RetVal = DataFlowEditor()->IsValid() ;
+//    }
   }
-//  endService( "LNode_Impl::Delete" );
+  endService( "LNode_Impl::Delete" );
   return RetVal ;
 }