]> SALOME platform Git repositories - modules/superv.git/blob - src/GraphBase/DataFlowBase_GOTONode.cxx
Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/superv.git] / src / GraphBase / DataFlowBase_GOTONode.cxx
1 using namespace std;
2 //=============================================================================
3 // File      : DataFlowBase_GOTONode.cxx
4 // Created   : 2003
5 // Author    : Jean Rahuel, CEA
6 // Project   : SALOME
7 // $Header:
8 //=============================================================================
9
10 #include <strstream>
11 #include <iostream>
12
13 #include "DataFlowBase_GOTONode.hxx"
14
15 GraphBase::GOTONode::GOTONode() :
16   GraphBase::InLineNode::InLineNode() {
17
18   CoupledNode( NULL ) ;
19   cdebug << "GraphBase::GOTONode::GOTONode "  << this 
20          << " _Name " << (void *) Name() << " " << Name() << " _Comment "
21          << (void *) Comment() << " "  << Comment() << " "  << endl ;
22
23 }
24
25 GraphBase::GOTONode::GOTONode( CORBA::ORB_ptr ORB ,
26                                SALOME_NamingService* ptrNamingService ,
27                                const char *FuncName ,
28                                const SUPERV::ListOfStrings & aPythonFunction ,
29                                const char *NodeName ,
30                                const SUPERV::KindOfNode akind ,
31                                const SUPERV::SDate NodeFirstCreation ,
32                                const SUPERV::SDate NodeLastModification  ,
33                                const char * NodeEditorRelease ,
34                                const char * NodeAuthor ,
35                                const char * NodeComment ,
36                                const bool   GeneratedName ,
37                                const long   X ,
38                                const long   Y ,
39                                int * Graph_prof_debug ,
40                                ostream * Graph_fdebug ) :
41   GraphBase::InLineNode::InLineNode( ORB , ptrNamingService , FuncName , aPythonFunction ,
42                                      NodeName , akind , NodeFirstCreation ,
43                                      NodeLastModification  , NodeEditorRelease ,
44                                      NodeAuthor , NodeComment , GeneratedName ,
45                                      X , Y , Graph_prof_debug , Graph_fdebug ) {
46
47   CoupledNode( NULL ) ;
48   cdebug_in << "GraphBase::GOTONode::GOTONode "  << this 
49             << "' _Name " << (void *) Name() << " '" << Name() << " _Comment "
50             << (void *) Comment() << " "  << Comment() << " " 
51             << " KindOfNode " << Kind() << " FuncName " << FuncName
52             << " ServiceName " << ServiceName() << " In("
53             << ServiceInParameter().length()
54             << ") Out(" << ServiceOutParameter().length() << ")" << endl ;
55
56   cdebug_out << "GraphBase::GOTONode::GOTONode" << endl;
57 }
58
59 GraphBase::GOTONode::~GOTONode() {
60   cdebug << "GraphBase::GOTONode::~GOTONode "  << this 
61          << " _Name " << (void *) Name() << " " << Name() << " _Comment "
62          << (void *) Comment() << " "  << Comment() << " "  << endl ;
63 //  if ( _ComponentName != NULLSTRING )
64 //    delete [] _ComponentName ;
65 //  delete [] _Name ;
66 //  delete [] _EditorRelease ;
67 //  if ( _Author != NULLSTRING )
68 //    delete [] _Author ;
69 //  if ( _Computer != FACTORYSERVER )
70 //    delete [] _Computer;
71 //  if ( _Comment != NULLSTRING )
72 //    delete [] _Comment;
73 }
74
75 //bool GraphBase::GOTONode::SaveXML( ostream &f , char *Tabs ,
76 bool GraphBase::GOTONode::SaveXML( QDomDocument & Graph , QDomElement & info ,
77                                    int XCoordinate , int YCoordinate ) const {
78   GraphBase::ListOfFuncName aFuncNames ; 
79   GraphBase::ListOfPythonFunctions aPythonFunction ;
80   if ( PyFuncName() ) {
81     aFuncNames.resize( 1 ) ;
82     aFuncNames[0] = CORBA::string_dup( PyFuncName() ) ;
83     aPythonFunction.resize( 1 ) ;
84     aPythonFunction[0] = PythonFunction() ;
85   }
86   char * CoupledName = "" ;
87   if ( CoupledNode() ) {
88     CoupledName = CoupledNode()->Name() ;
89   }
90 //  return GraphBase::ComputingNode::SaveXML( f , Tabs , "" , "" , "" ,
91   return GraphBase::ComputingNode::SaveXML( Graph , info , "" , "" , "" ,
92                                             CoupledName ,
93                                             aFuncNames , aPythonFunction ,
94                                             XCoordinate , YCoordinate ) ;
95 }
96
97 bool GraphBase::GOTONode::SavePY( ostream &f , const char * aGraphName ,
98                                   int XCoordinate , int YCoordinate ) const {
99   GraphBase::ListOfFuncName aFuncNames ; 
100   GraphBase::ListOfPythonFunctions aPythonFunction ;
101   if ( PyFuncName() ) {
102     aFuncNames.resize( 1 ) ;
103     aFuncNames[0] = CORBA::string_dup( PyFuncName() ) ;
104     aPythonFunction.resize( 1 ) ;
105     aPythonFunction[0] = PythonFunction() ;
106   }
107   return GraphBase::ComputingNode::SavePY( f , aGraphName , "" , "" , "" ,
108                                            CoupledNode() ,
109                                            aFuncNames , aPythonFunction ,
110                                            XCoordinate , YCoordinate ) ;
111 }
112