1 // SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : DataFlowBase_GOTONode.cxx
8 // Author : Jean Rahuel, CEA
16 #include "DataFlowBase_GOTONode.hxx"
18 GraphBase::GOTONode::GOTONode() :
19 GraphBase::InLineNode::InLineNode() {
22 cdebug << "GraphBase::GOTONode::GOTONode " << this
23 << " _Name " << (void *) Name() << " " << Name() << " _Comment "
24 << (void *) Comment() << " " << Comment() << " " << endl ;
28 GraphBase::GOTONode::GOTONode( CORBA::ORB_ptr ORB ,
29 SALOME_NamingService* ptrNamingService ,
30 const char *FuncName ,
31 const SUPERV::ListOfStrings & aPythonFunction ,
32 const char *NodeName ,
33 const SUPERV::KindOfNode akind ,
34 const SUPERV::SDate NodeFirstCreation ,
35 const SUPERV::SDate NodeLastModification ,
36 const char * NodeEditorRelease ,
37 const char * NodeAuthor ,
38 const char * NodeComment ,
39 const bool GeneratedName ,
42 int * Graph_prof_debug ,
43 ofstream * Graph_fdebug ) :
44 GraphBase::InLineNode::InLineNode( ORB , ptrNamingService , FuncName , aPythonFunction ,
45 NodeName , akind , NodeFirstCreation ,
46 NodeLastModification , NodeEditorRelease ,
47 NodeAuthor , NodeComment , GeneratedName ,
48 X , Y , Graph_prof_debug , Graph_fdebug ) {
51 cdebug_in << "GraphBase::GOTONode::GOTONode " << this
52 << "' _Name " << (void *) Name() << " '" << Name() << " _Comment "
53 << (void *) Comment() << " " << Comment() << " "
54 << " KindOfNode " << Kind() << " FuncName " << FuncName
55 << " ServiceName " << ServiceName() << " In("
56 << ServiceInParameter().length()
57 << ") Out(" << ServiceOutParameter().length() << ")" << endl ;
59 cdebug_out << "GraphBase::GOTONode::GOTONode" << endl;
62 GraphBase::GOTONode::~GOTONode() {
63 cdebug << "GraphBase::GOTONode::~GOTONode " << this
64 << " _Name " << (void *) Name() << " " << Name() << " _Comment "
65 << (void *) Comment() << " " << Comment() << " " << endl ;
66 // if ( _ComponentName != NULLSTRING )
67 // delete [] _ComponentName ;
69 // delete [] _EditorRelease ;
70 // if ( _Author != NULLSTRING )
71 // delete [] _Author ;
72 // if ( _Computer != FACTORYSERVER )
73 // delete [] _Computer;
74 // if ( _Comment != NULLSTRING )
75 // delete [] _Comment;
78 //bool GraphBase::GOTONode::SaveXML( ostream &f , char *Tabs ,
79 bool GraphBase::GOTONode::SaveXML( QDomDocument & Graph , QDomElement & info ,
80 int XCoordinate , int YCoordinate ) const {
81 GraphBase::ListOfFuncName aFuncNames ;
82 GraphBase::ListOfPythonFunctions aPythonFunction ;
84 aFuncNames.resize( 1 ) ;
85 aFuncNames[0] = CORBA::string_dup( PyFuncName() ) ;
86 aPythonFunction.resize( 1 ) ;
87 aPythonFunction[0] = PythonFunction() ;
89 char * CoupledName = "" ;
90 if ( CoupledNode() ) {
91 CoupledName = CoupledNode()->Name() ;
93 // return GraphBase::ComputingNode::SaveXML( f , Tabs , "" , "" , "" ,
94 return GraphBase::ComputingNode::SaveXML( Graph , info , "" , "" , "" ,
96 aFuncNames , aPythonFunction ,
97 XCoordinate , YCoordinate ) ;
100 bool GraphBase::GOTONode::SavePY( ostream &f , const char * aGraphName ,
101 int XCoordinate , int YCoordinate ) const {
102 GraphBase::ListOfFuncName aFuncNames ;
103 GraphBase::ListOfPythonFunctions aPythonFunction ;
104 if ( PyFuncName() ) {
105 aFuncNames.resize( 1 ) ;
106 aFuncNames[0] = CORBA::string_dup( PyFuncName() ) ;
107 aPythonFunction.resize( 1 ) ;
108 aPythonFunction[0] = PythonFunction() ;
110 return GraphBase::ComputingNode::SavePY( f , aGraphName , "" , "" , "" ,
112 aFuncNames , aPythonFunction ,
113 XCoordinate , YCoordinate ) ;