1 //=============================================================================
2 // File : GNode_Impl.hxx
4 // Author : Jean Rahuel
6 // Copyright : CEA 2003
8 //=============================================================================
10 #ifndef _GNODE_IMPL_HXX_
11 #define _GNODE_IMPL_HXX_
17 #include <SALOMEconfig.h>
18 #include "SALOME_Component_i.hxx"
19 #include "SALOME_LifeCycleCORBA.hxx"
21 #include "INode_Impl.hxx"
22 #include "Port_Impl.hxx"
24 #include "DataFlowEditor_DataFlow.hxx"
25 #include "DataFlowExecutor_DataFlow.hxx"
27 class GNode_Impl : public INode_Impl ,
28 public POA_SUPERV::GNode {
32 PortableServer::POA_ptr _Poa ;
33 PortableServer::ObjectId * _ContId ;
37 GNode_Impl( CORBA::ORB_ptr orb ,
38 PortableServer::POA_ptr poa ,
39 PortableServer::ObjectId * contId ,
40 const char *instanceName ,
41 const char *interfaceName ,
42 GraphEditor::DataFlow * DataFlowEditor ,
43 const char * FuncName ,
44 const SUPERV::ListOfStrings & PythonFunction ,
45 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::GOTONode ) ;
46 GNode_Impl( CORBA::ORB_ptr orb ,
47 PortableServer::POA_ptr poa ,
48 PortableServer::ObjectId * contId ,
49 const char *instanceName ,
50 const char *interfaceName ,
51 GraphEditor::DataFlow * DataFlowEditor ,
52 GraphBase::ListOfFuncName FuncNameList ,
53 GraphBase::ListOfPythonFunctions PythonFunctionList ,
54 const SUPERV::KindOfNode NodeKindOfNode = SUPERV::GOTONode ) ;
55 GNode_Impl( CORBA::ORB_ptr orb ,
56 PortableServer::POA_ptr poa ,
57 PortableServer::ObjectId * contId ,
58 const char *instanceName ,
59 const char *interfaceName ,
60 GraphEditor::DataFlow * DataFlowEditor ,
61 GraphEditor::InNode * DataFlowNode ) ;
62 virtual ~GNode_Impl() ;
63 virtual void destroy() ;
64 virtual bool Delete() ;
66 virtual bool SetCoupled( const char * anInLineNode ) {
67 GraphBase::InLineNode * CoupledINode = (GraphBase::InLineNode * ) DataFlowEditor()->GetGraphNode( anInLineNode ) ;
68 cout << Name() << ".SetCoupled " << anInLineNode << endl ;
69 if ( CoupledINode && ( IsGOTO() &&
70 ( CoupledINode->IsInLineNode() || CoupledINode->IsLoopNode() ||
71 CoupledINode->IsSwitchNode() ) ) ||
72 ( !IsGOTO() && ( IsLoop() || IsSwitch() ||
73 IsEndLoop() || IsEndSwitch() ) ) ) {
74 DataFlowNode()->CoupledNode( CoupledINode ) ;
76 DataFlowEditor()->AddLink( Name() , "Default" ,
77 CoupledINode->Name() , "Default" ) ;
79 else if ( IsLoop() || IsEndLoop() ) {
80 DataFlowEditor()->AddLink( Name() , "DoLoop" ,
81 CoupledINode->Name() , "DoLoop" ) ;
83 else if ( IsGOTO() ) {
84 DataFlowEditor()->AddLink( Name() , "OutGate" ,
85 CoupledINode->Name() , "InGate" ) ;
87 cout << "SetCoupled " << CoupledINode->Name() << endl ;
90 cout << Name() << ".SetCoupled ERROR " << anInLineNode << " " << CoupledINode
93 cout << " kinfOkCoupled " << CoupledINode->Kind() ;
97 virtual SUPERV::INode_ptr Coupled() ;
99 virtual GraphBase::GOTONode * BaseNode() {
100 return DataFlowNode()->GOTONode() ; } ;