1 // SUPERV GraphEditor : contains classes that permit edition of graphs
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : DataFlowEditor_InNode.cxx
32 #include "DataFlowEditor_InNode.hxx"
34 GraphEditor::InNode::InNode() {
37 //ostream * fdebug = NULL ;
38 GraphEditor::InNode::InNode( CORBA::ORB_ptr ORB,
39 SALOME_NamingService * ptrNamingService ,
40 GraphBase::ListOfFuncName aFuncName ,
41 GraphBase::ListOfPythonFunctions aPythonFunction ,
42 const SALOME_ModuleCatalog::Service& aService ,
43 const char * ComponentName ,
44 const char * NodeInterfaceName ,
45 const char * NodeName ,
46 const SUPERV::KindOfNode akind ,
47 const SUPERV::SDate NodeFirstCreation ,
48 const SUPERV::SDate NodeLastModification ,
49 const char * NodeEditorRelease ,
50 const char * NodeAuthor ,
51 const char * NodeComputer ,
52 const char * NodeComment ,
53 const bool GeneratedName ,
56 int * Graph_prof_debug,
57 ofstream * Graph_fdebug) {
58 SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
59 // cout << "GraphEditor::InNode::InNode GraphBase::Base::_fdebug " << GraphBase::Base::_fdebug << endl ;
60 cdebug_in << "GraphEditor::InNode::InNode" << endl ;
61 // if ( GraphBase::Base::_fdebug )
62 // *GraphBase::Base::_fdebug << endl << "xxx-->" << " " << "GraphEditor::InNode::InNode" << endl ;
64 // (*fdebug) << endl << "xxxxxx-->" << " " << "GraphEditor::InNode::InNode" << endl ;
65 // cout << "GraphEditor::InNode::InNode GraphBase::Base::_fdebug " << GraphBase::Base::_fdebug << endl ;
66 _ComputingNode = NULL ;
71 _EndOfLoopNode = NULL ;
73 _EndOfSwitchNode = NULL ;
75 case SUPERV::ComputingNode : {
76 cdebug << "GraphEditor::InNode::InNode SUPERV::ComputingNode : " << NodeName << endl ;
77 _ComputingNode = new GraphBase::ComputingNode( ORB , ptrNamingService , aService ,
80 NodeLastModification ,
81 NodeEditorRelease , NodeAuthor ,
82 NodeComment , GeneratedName ,
84 Graph_prof_debug , Graph_fdebug ) ;
87 case SUPERV::FactoryNode : {
88 // cout << "GraphEditor::InNode::InNode SUPERV::FactoryNode : " << NodeName << endl ;
89 cdebug << "GraphEditor::InNode::InNode SUPERV::FactoryNode : " << NodeName << endl ;
90 _FactoryNode = new GraphBase::FactoryNode( ORB , ptrNamingService , aService ,
91 ComponentName , NodeInterfaceName ,
94 NodeLastModification ,
95 NodeEditorRelease , NodeAuthor ,
96 NodeComputer , NodeComment ,
97 GeneratedName , X , Y ,
98 Graph_prof_debug , Graph_fdebug ) ;
99 // cout << "GraphEditor::InNode::InNode SUPERV::FactoryNode : " << NodeName << endl ;
100 _ComputingNode = (GraphBase::ComputingNode *) _FactoryNode ;
103 case SUPERV::InLineNode : {
104 cdebug << "GraphEditor::InNode::InNode SUPERV::InLineNode : " << NodeName << endl ;
105 _InLineNode = new GraphBase::InLineNode( ORB , ptrNamingService ,
106 aFuncName[0].c_str() , *aPythonFunction[0] ,
108 NodeFirstCreation , NodeLastModification ,
109 NodeEditorRelease , NodeAuthor ,
110 NodeComment , GeneratedName ,
112 Graph_prof_debug , Graph_fdebug ) ;
113 _ComputingNode = (GraphBase::ComputingNode *) _InLineNode ;
116 case SUPERV::GOTONode : {
117 cdebug << "GraphEditor::InNode::InNode SUPERV::GOTONode : " << NodeName << endl ;
118 _GOTONode = new GraphBase::GOTONode( ORB , ptrNamingService ,
119 aFuncName[0].c_str() , *aPythonFunction[0] ,
121 NodeFirstCreation , NodeLastModification ,
122 NodeEditorRelease , NodeAuthor ,
123 NodeComment , GeneratedName ,
125 Graph_prof_debug , Graph_fdebug ) ;
126 _ComputingNode = (GraphBase::ComputingNode *) _GOTONode ;
127 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
130 case SUPERV::LoopNode : {
131 cdebug << "GraphEditor::InNode::InNode SUPERV::LoopNode : " << NodeName << endl ;
132 _LoopNode = new GraphBase::LoopNode( ORB , ptrNamingService ,
133 aFuncName[0].c_str() , *aPythonFunction[0] ,
134 aFuncName[1].c_str() , *aPythonFunction[1] ,
135 aFuncName[2].c_str() , *aPythonFunction[2] ,
137 NodeFirstCreation , NodeLastModification ,
138 NodeEditorRelease , NodeAuthor ,
139 NodeComment , GeneratedName ,
141 Graph_prof_debug , Graph_fdebug ) ;
142 _ComputingNode = (GraphBase::ComputingNode *) _LoopNode ;
143 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
144 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
147 case SUPERV::EndLoopNode : {
148 cdebug << "GraphEditor::InNode::InNode SUPERV::EndOfLoopNode : " << NodeName << endl ;
149 _EndOfLoopNode = new GraphBase::EndOfLoopNode(
150 ORB , ptrNamingService ,
151 aFuncName[0].c_str() , *aPythonFunction[0] ,
153 NodeFirstCreation , NodeLastModification ,
154 NodeEditorRelease , NodeAuthor ,
155 NodeComment , GeneratedName ,
157 Graph_prof_debug , Graph_fdebug ) ;
158 _ComputingNode = (GraphBase::ComputingNode *) _EndOfLoopNode ;
159 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
160 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
163 case SUPERV::SwitchNode : {
164 cdebug << "GraphEditor::InNode::InNode SUPERV::SwitchNode : " << NodeName << endl ;
165 _SwitchNode = new GraphBase::SwitchNode( ORB , ptrNamingService ,
166 aFuncName[0].c_str() , *aPythonFunction[0] ,
168 NodeFirstCreation , NodeLastModification ,
169 NodeEditorRelease , NodeAuthor ,
170 NodeComment , GeneratedName ,
172 Graph_prof_debug , Graph_fdebug ) ;
173 _ComputingNode = (GraphBase::ComputingNode *) _SwitchNode ;
174 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
175 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
178 case SUPERV::EndSwitchNode : {
179 cdebug << "GraphEditor::InNode::InNode SUPERV::EndOfSwitchNode : " << NodeName << endl ;
180 _EndOfSwitchNode = new GraphBase::EndOfSwitchNode(
181 ORB , ptrNamingService ,
182 aFuncName[0].c_str() , *aPythonFunction[0] ,
184 NodeFirstCreation , NodeLastModification ,
185 NodeEditorRelease , NodeAuthor ,
186 NodeComment , GeneratedName ,
188 Graph_prof_debug , Graph_fdebug ) ;
189 _ComputingNode = (GraphBase::ComputingNode *) _EndOfSwitchNode ;
190 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
191 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
194 case SUPERV::DataFlowGraph : {
195 cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::DataFlowGraph : " << NodeName << endl ;
197 case SUPERV::DataStreamGraph : {
198 cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::DataStreamGraph : " << NodeName << endl ;
200 case SUPERV::UnknownNode : {
201 cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::UnknownNode : " << NodeName << endl ;
204 _ComputingNode->InNode( this ) ;
205 cdebug_out << "GraphEditor::InNode::InNode " << (void *) this
206 << " _ComputingNode " << (void *) _ComputingNode << endl ;
209 GraphEditor::InNode::~InNode() {