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() {
38 GraphEditor::InNode::InNode(GraphBase::GOTONode * aGOTONode ) {
39 _ComputingNode = aGOTONode ;
40 _GOTONode = aGOTONode ;
44 //ostream * fdebug = NULL ;
45 GraphEditor::InNode::InNode( CORBA::ORB_ptr ORB,
46 SALOME_NamingService * ptrNamingService ,
47 GraphBase::ListOfFuncName aFuncName ,
48 GraphBase::ListOfPythonFunctions aPythonFunction ,
49 const SALOME_ModuleCatalog::Service& aService ,
50 const char * ComponentName ,
51 const char * NodeInterfaceName ,
52 const char * NodeName ,
53 const SUPERV::KindOfNode akind ,
54 const SUPERV::SDate NodeFirstCreation ,
55 const SUPERV::SDate NodeLastModification ,
56 const char * NodeEditorRelease ,
57 const char * NodeAuthor ,
58 const char * NodeComputer ,
59 const char * NodeComment ,
60 const bool GeneratedName ,
63 int * Graph_prof_debug,
64 ofstream * Graph_fdebug) {
65 SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
66 // cout << "GraphEditor::InNode::InNode GraphBase::Base::_fdebug " << GraphBase::Base::_fdebug << endl ;
67 cdebug_in << "GraphEditor::InNode::InNode" << endl ;
68 // if ( GraphBase::Base::_fdebug )
69 // *GraphBase::Base::_fdebug << endl << "xxx-->" << " " << "GraphEditor::InNode::InNode" << endl ;
71 // (*fdebug) << endl << "xxxxxx-->" << " " << "GraphEditor::InNode::InNode" << endl ;
72 // cout << "GraphEditor::InNode::InNode GraphBase::Base::_fdebug " << GraphBase::Base::_fdebug << endl ;
73 _ComputingNode = NULL ;
78 _EndOfLoopNode = NULL ;
80 _EndOfSwitchNode = NULL ;
82 case SUPERV::ComputingNode : {
83 cdebug << "GraphEditor::InNode::InNode SUPERV::ComputingNode : " << NodeName << endl ;
84 _ComputingNode = new GraphBase::ComputingNode( ORB , ptrNamingService , aService ,
87 NodeLastModification ,
88 NodeEditorRelease , NodeAuthor ,
89 NodeComment , GeneratedName ,
91 Graph_prof_debug , Graph_fdebug ) ;
94 case SUPERV::FactoryNode : {
95 // cout << "GraphEditor::InNode::InNode SUPERV::FactoryNode : " << NodeName << endl ;
96 cdebug << "GraphEditor::InNode::InNode SUPERV::FactoryNode : " << NodeName << endl ;
97 _FactoryNode = new GraphBase::FactoryNode( ORB , ptrNamingService , aService ,
98 ComponentName , NodeInterfaceName ,
101 NodeLastModification ,
102 NodeEditorRelease , NodeAuthor ,
103 NodeComputer , NodeComment ,
104 GeneratedName , NodeX , NodeY ,
105 Graph_prof_debug , Graph_fdebug ) ;
106 // cout << "GraphEditor::InNode::InNode SUPERV::FactoryNode : " << NodeName << endl ;
107 _ComputingNode = (GraphBase::ComputingNode *) _FactoryNode ;
110 case SUPERV::InLineNode : {
111 cdebug << "GraphEditor::InNode::InNode SUPERV::InLineNode : " << NodeName << endl ;
112 _InLineNode = new GraphBase::InLineNode( ORB , ptrNamingService ,
113 aFuncName[0].c_str() , *aPythonFunction[0] ,
115 NodeFirstCreation , NodeLastModification ,
116 NodeEditorRelease , NodeAuthor ,
117 NodeComment , GeneratedName ,
119 Graph_prof_debug , Graph_fdebug ) ;
120 _ComputingNode = (GraphBase::ComputingNode *) _InLineNode ;
123 case SUPERV::MacroNode : {
124 cdebug << "GraphEditor::InNode::InNode SUPERV::MacroNode : " << NodeName << endl ;
125 _GraphMacroNode = new GraphBase::Graph( ORB , ptrNamingService ,
126 // aFuncName[0].c_str() , *aPythonFunction[0] ,
129 // NodeFirstCreation , NodeLastModification ,
130 // NodeEditorRelease , NodeAuthor ,
131 // NodeComment , GeneratedName ,
133 Graph_prof_debug , Graph_fdebug ) ;
134 _ComputingNode = (GraphBase::ComputingNode *) _GraphMacroNode ;
135 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
136 _GOTONode = (GraphBase::GOTONode *) _InLineNode ;
137 _GraphMacroNode->Coordinates( NodeX , NodeY ) ;
140 case SUPERV::GOTONode : {
141 cdebug << "GraphEditor::InNode::InNode SUPERV::GOTONode : " << NodeName << endl ;
142 _GOTONode = new GraphBase::GOTONode( ORB , ptrNamingService ,
143 aFuncName[0].c_str() , *aPythonFunction[0] ,
145 NodeFirstCreation , NodeLastModification ,
146 NodeEditorRelease , NodeAuthor ,
147 NodeComment , GeneratedName ,
149 Graph_prof_debug , Graph_fdebug ) ;
150 _ComputingNode = (GraphBase::ComputingNode *) _GOTONode ;
151 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
154 case SUPERV::LoopNode : {
155 cdebug << "GraphEditor::InNode::InNode SUPERV::LoopNode : " << NodeName << endl ;
156 _LoopNode = new GraphBase::LoopNode( ORB , ptrNamingService ,
157 aFuncName[0].c_str() , *aPythonFunction[0] ,
158 aFuncName[1].c_str() , *aPythonFunction[1] ,
159 aFuncName[2].c_str() , *aPythonFunction[2] ,
161 NodeFirstCreation , NodeLastModification ,
162 NodeEditorRelease , NodeAuthor ,
163 NodeComment , GeneratedName ,
165 Graph_prof_debug , Graph_fdebug ) ;
166 _ComputingNode = (GraphBase::ComputingNode *) _LoopNode ;
167 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
168 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
171 case SUPERV::EndLoopNode : {
172 cdebug << "GraphEditor::InNode::InNode SUPERV::EndOfLoopNode : " << NodeName << endl ;
173 _EndOfLoopNode = new GraphBase::EndOfLoopNode(
174 ORB , ptrNamingService ,
175 aFuncName[0].c_str() , *aPythonFunction[0] ,
177 NodeFirstCreation , NodeLastModification ,
178 NodeEditorRelease , NodeAuthor ,
179 NodeComment , GeneratedName ,
181 Graph_prof_debug , Graph_fdebug ) ;
182 _ComputingNode = (GraphBase::ComputingNode *) _EndOfLoopNode ;
183 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
184 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
187 case SUPERV::SwitchNode : {
188 cdebug << "GraphEditor::InNode::InNode SUPERV::SwitchNode : " << NodeName << endl ;
189 _SwitchNode = new GraphBase::SwitchNode( ORB , ptrNamingService ,
190 aFuncName[0].c_str() , *aPythonFunction[0] ,
192 NodeFirstCreation , NodeLastModification ,
193 NodeEditorRelease , NodeAuthor ,
194 NodeComment , GeneratedName ,
196 Graph_prof_debug , Graph_fdebug ) ;
197 _ComputingNode = (GraphBase::ComputingNode *) _SwitchNode ;
198 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
199 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
202 case SUPERV::EndSwitchNode : {
203 cdebug << "GraphEditor::InNode::InNode SUPERV::EndOfSwitchNode : " << NodeName << endl ;
204 _EndOfSwitchNode = new GraphBase::EndOfSwitchNode(
205 ORB , ptrNamingService ,
206 aFuncName[0].c_str() , *aPythonFunction[0] ,
208 NodeFirstCreation , NodeLastModification ,
209 NodeEditorRelease , NodeAuthor ,
210 NodeComment , GeneratedName ,
212 Graph_prof_debug , Graph_fdebug ) ;
213 _ComputingNode = (GraphBase::ComputingNode *) _EndOfSwitchNode ;
214 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
215 _InLineNode = (GraphBase::InLineNode *) _ComputingNode ;
218 case SUPERV::DataFlowGraph : {
219 cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::DataFlowGraph : " << NodeName << endl ;
221 case SUPERV::DataStreamGraph : {
222 cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::DataStreamGraph : " << NodeName << endl ;
224 case SUPERV::UnknownNode : {
225 cdebug << "GraphEditor::InNode::InNode ERROR SUPERV::UnknownNode : " << NodeName << endl ;
228 _ComputingNode->InNode( this ) ;
229 cdebug_out << "GraphEditor::InNode::InNode " << (void *) this
230 << " _ComputingNode " << (void *) _ComputingNode << endl ;
233 GraphEditor::InNode::~InNode() {