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 GraphEditor::InNode::InNode( CORBA::ORB_ptr ORB,
38 SALOME_NamingService* ptrNamingService ,
39 GraphBase::ListOfFuncName aFuncName ,
40 GraphBase::ListOfPythonFunctions aPythonFunction ,
41 const SALOME_ModuleCatalog::Service& aService ,
42 const char * ComponentName ,
43 const char* NodeInterfaceName ,
44 const char * NodeName ,
45 const SUPERV::KindOfNode akind ,
46 const SUPERV::SDate NodeFirstCreation ,
47 const SUPERV::SDate NodeLastModification ,
48 const char * NodeEditorRelease ,
49 const char * NodeAuthor ,
50 const char * NodeComputer ,
51 const char * NodeComment ,
52 const bool GeneratedName ,
55 int * Graph_prof_debug,
56 ostream * Graph_fdebug) {
57 SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
59 _ComputingNode = NULL ;
64 _EndOfLoopNode = NULL ;
66 _EndOfSwitchNode = NULL ;
68 case SUPERV::ComputingNode : {
69 cdebug << "GraphEditor::InNode::InNode SUPERV::ComputingNode : " << NodeName ;
70 _ComputingNode = new GraphBase::ComputingNode( ORB , ptrNamingService , aService ,
73 NodeLastModification ,
74 NodeEditorRelease , NodeAuthor ,
75 NodeComment , GeneratedName ,
77 Graph_prof_debug , Graph_fdebug ) ;
80 case SUPERV::FactoryNode : {
81 cdebug << "GraphEditor::InNode::InNode SUPERV::FactoryNode : " << NodeName ;
82 _FactoryNode = new GraphBase::FactoryNode( ORB , ptrNamingService , aService ,
83 ComponentName , NodeInterfaceName ,
86 NodeLastModification ,
87 NodeEditorRelease , NodeAuthor ,
88 NodeComputer , NodeComment ,
89 GeneratedName , X , Y ,
90 Graph_prof_debug , Graph_fdebug ) ;
91 _ComputingNode = (GraphBase::ComputingNode *) _FactoryNode ;
94 case SUPERV::InLineNode : {
95 cdebug << "GraphEditor::InNode::InNode SUPERV::InLineNode : " << NodeName ;
96 _InLineNode = new GraphBase::InLineNode( ORB , ptrNamingService ,
97 aFuncName[0].c_str() , *aPythonFunction[0] ,
99 NodeFirstCreation , NodeLastModification ,
100 NodeEditorRelease , NodeAuthor ,
101 NodeComment , GeneratedName ,
103 Graph_prof_debug , Graph_fdebug ) ;
104 _ComputingNode = (GraphBase::ComputingNode *) _InLineNode ;
107 case SUPERV::GOTONode : {
108 cdebug << "GraphEditor::InNode::InNode SUPERV::GOTONode : " << NodeName ;
109 _GOTONode = new GraphBase::GOTONode( ORB , ptrNamingService ,
110 aFuncName[0].c_str() , *aPythonFunction[0] ,
112 NodeFirstCreation , NodeLastModification ,
113 NodeEditorRelease , NodeAuthor ,
114 NodeComment , GeneratedName ,
116 Graph_prof_debug , Graph_fdebug ) ;
117 _ComputingNode = (GraphBase::ComputingNode *) _GOTONode ;
120 case SUPERV::LoopNode : {
121 cdebug << "GraphEditor::InNode::InNode SUPERV::LoopNode : " << NodeName ;
122 _LoopNode = new GraphBase::LoopNode( ORB , ptrNamingService ,
123 aFuncName[0].c_str() , *aPythonFunction[0] ,
124 aFuncName[1].c_str() , *aPythonFunction[1] ,
125 aFuncName[2].c_str() , *aPythonFunction[2] ,
127 NodeFirstCreation , NodeLastModification ,
128 NodeEditorRelease , NodeAuthor ,
129 NodeComment , GeneratedName ,
131 Graph_prof_debug , Graph_fdebug ) ;
132 _ComputingNode = (GraphBase::ComputingNode *) _LoopNode ;
133 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
136 case SUPERV::EndLoopNode : {
137 cdebug << "GraphEditor::InNode::InNode SUPERV::EndOfLoopNode : " << NodeName ;
138 _EndOfLoopNode = new GraphBase::EndOfLoopNode(
139 ORB , ptrNamingService ,
140 aFuncName[0].c_str() , *aPythonFunction[0] ,
142 NodeFirstCreation , NodeLastModification ,
143 NodeEditorRelease , NodeAuthor ,
144 NodeComment , GeneratedName ,
146 Graph_prof_debug , Graph_fdebug ) ;
147 _ComputingNode = (GraphBase::ComputingNode *) _EndOfLoopNode ;
148 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
151 case SUPERV::SwitchNode : {
152 cdebug << "GraphEditor::InNode::InNode SUPERV::SwitchNode : " << NodeName ;
153 _SwitchNode = new GraphBase::SwitchNode( ORB , ptrNamingService ,
154 aFuncName[0].c_str() , *aPythonFunction[0] ,
156 NodeFirstCreation , NodeLastModification ,
157 NodeEditorRelease , NodeAuthor ,
158 NodeComment , GeneratedName ,
160 Graph_prof_debug , Graph_fdebug ) ;
161 _ComputingNode = (GraphBase::ComputingNode *) _SwitchNode ;
162 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
165 case SUPERV::EndSwitchNode : {
166 cdebug << "GraphEditor::InNode::InNode SUPERV::EndOfSwitchNode : " << NodeName ;
167 _EndOfSwitchNode = new GraphBase::EndOfSwitchNode(
168 ORB , ptrNamingService ,
169 aFuncName[0].c_str() , *aPythonFunction[0] ,
171 NodeFirstCreation , NodeLastModification ,
172 NodeEditorRelease , NodeAuthor ,
173 NodeComment , GeneratedName ,
175 Graph_prof_debug , Graph_fdebug ) ;
176 _ComputingNode = (GraphBase::ComputingNode *) _EndOfSwitchNode ;
177 _GOTONode = (GraphBase::GOTONode *) _ComputingNode ;
181 cdebug << "GraphEditor::InNode::InNode " << (void *) this
182 << " _ComputingNode " << (void *) _ComputingNode ;
183 _ComputingNode->InNode( this ) ;
186 GraphEditor::InNode::~InNode() {