1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
23 // File : SNode_Impl.cxx
24 // Author : Jean Rahuel
33 //#include "utilities.h"
35 #include "SNode_Impl.hxx"
37 SNode_Impl::SNode_Impl() {
40 SNode_Impl::SNode_Impl( CORBA::ORB_ptr orb ,
41 PortableServer::POA_ptr poa ,
42 PortableServer::ObjectId * contId ,
43 const char *instanceName ,
44 const char *interfaceName ,
45 GraphEditor::DataFlow * aDataFlowEditor ,
46 const char * FuncName ,
47 const SUPERV::ListOfStrings & PythonFunction ,
48 const SUPERV::KindOfNode NodeKindOfNode ) :
49 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
50 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , FuncName , PythonFunction , NodeKindOfNode ) {
51 // MESSAGE( NodeName << " " );
52 beginService( "SNode_Impl::SNode_Impl" );
54 _id = _poa->activate_object(_thisObj);
55 _Orb = CORBA::ORB::_duplicate(orb);
58 // DataFlowNode( DataFlowEditor()->AddNode( NodeService , NodeComponentName ,
59 // NodeInterfaceName , NodeName ,
60 // NodeKindOfNode ) ) ;
61 // DataFlowNode( DataFlowEditor()->AddNode( SALOME_ModuleCatalog::Service() ,
63 // NodeKindOfNode ) ) ;
64 endService( "SNode_Impl::SNode_Impl" );
67 SNode_Impl::SNode_Impl( CORBA::ORB_ptr orb ,
68 PortableServer::POA_ptr poa ,
69 PortableServer::ObjectId * contId ,
70 const char *instanceName ,
71 const char *interfaceName ,
72 GraphEditor::DataFlow * aDataFlowEditor ,
73 GraphEditor::InNode * aDataFlowNode ) :
74 // Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) {
75 GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) {
76 MESSAGE( DataFlowNode()->Name() << " " );
77 beginService( "SNode_Impl::SNode_Impl" );
79 _id = _poa->activate_object(_thisObj);
80 _Orb = CORBA::ORB::_duplicate(orb);
83 endService( "SNode_Impl::SNode_Impl" );
86 SNode_Impl::~SNode_Impl() {
87 beginService( "SNode_Impl::~SNode_Impl" );
88 endService( "SNode_Impl::~SNode_Impl" );
91 void SNode_Impl::destroy() {
92 beginService( "SNode_Impl::Destroy" );
93 if ( DataFlowEditor()->IsEditing() ) {
94 SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
96 _poa->deactivate_object(*_id) ;
97 // CORBA::release(_poa) ;
99 // _thisObj->_remove_ref();
102 MESSAGE("SNode_Impl::destroy ERROR ") ;
104 if ( !CORBA::is_nil( aCoupled ) ) {
105 // aCoupled->SetCoupled( "" ) ; : Used in GraphBase::Graph::RemoveNode( EndSwitchNode ) :
106 aCoupled->destroy() ;
108 // Valid() only after deletion of the corresponding EndSwitchNode :
109 DataFlowEditor()->UnValid() ;
111 endService( "SNode_Impl::Destroy" );
114 bool SNode_Impl::Delete() {
115 beginService( "SNode_Impl::Delete" );
116 bool RetVal = false ;
117 if ( DataFlowEditor()->IsEditing() ) {
119 RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
120 // Valid() only after deletion of the corresponding EndLoopNode :
122 // RetVal = DataFlowEditor()->IsValid() ;
125 endService( "SNode_Impl::Delete" );