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.hxx
27 #ifndef _DATAFLOWEDITOR_INNODE_HXX
28 #define _DATAFLOWEDITOR_INNODE_HXX
30 #include "DataFlowBase_Graph.hxx"
31 #include "DataFlowBase_FactoryNode.hxx"
32 #include "DataFlowBase_GOTONode.hxx"
33 #include "DataFlowBase_LoopNode.hxx"
34 #include "DataFlowBase_EndOfLoopNode.hxx"
35 #include "DataFlowBase_SwitchNode.hxx"
36 #include "DataFlowBase_EndOfSwitchNode.hxx"
38 namespace GraphEditor {
40 class InNode : public GraphBase::Base {
44 GraphBase::ComputingNode * _ComputingNode ;
45 GraphBase::FactoryNode * _FactoryNode ;
46 GraphBase::InLineNode * _InLineNode ;
47 GraphBase::GOTONode * _GOTONode ;
48 GraphBase::LoopNode * _LoopNode ;
49 GraphBase::EndOfLoopNode * _EndOfLoopNode ;
50 GraphBase::SwitchNode * _SwitchNode ;
51 GraphBase::EndOfSwitchNode * _EndOfSwitchNode ;
52 GraphBase::Graph * _GraphMacroNode ;
57 // InNode(GraphBase::GOTONode * aGOTONode ) ;
58 InNode( CORBA::ORB_ptr ORB,
59 SALOME_NamingService* ptrNamingService ,
60 GraphBase::ListOfFuncName aFuncName ,
61 GraphBase::ListOfPythonFunctions aPythonFunction ,
62 const SALOME_ModuleCatalog::Service& NodeService ,
63 const char *NodeComponentName ,
64 const char* NodeInterfaceName ,
65 const char *NodeName ,
66 const SUPERV::KindOfNode akind ,
67 const SUPERV::SDate NodeFirstCreation ,
68 const SUPERV::SDate NodeLastModification ,
69 const char * NodeEditorRelease ,
70 const char * NodeAuthor ,
71 const char * NodeComputer ,
72 const char * NodeComment ,
73 const bool GeneratedName ,
76 int * Graph_prof_debug = NULL ,
77 ofstream * Graph_fdebug = NULL ) ;
80 char * Name() const { return _ComputingNode->Name() ; } ;
81 const char *const * NamePtr() const {
82 return _ComputingNode->NamePtr() ; } ;
84 SUPERV::KindOfNode Kind() const {
85 return _ComputingNode->Kind() ; } ;
86 const bool IsComputingNode() const {
87 return _ComputingNode->IsComputingNode() ; } ;
88 const bool IsFactoryNode() const {
89 return _ComputingNode->IsFactoryNode() ; } ;
90 const bool IsInLineNode() const {
91 return _ComputingNode->IsInLineNode() ; } ;
92 const bool IsOneOfInLineNodes() const {
93 return _ComputingNode->IsOneOfInLineNodes() ; } ;
94 const bool IsOneOfGOTONodes() const {
95 return _ComputingNode->IsOneOfGOTONodes() ; } ;
96 const bool IsMacroNode() const {
97 return _ComputingNode->IsMacroNode() ; } ;
98 const bool IsDataFlowNode() const {
99 return _ComputingNode->IsDataFlowNode() ; } ;
100 const bool IsDataStreamNode() const {
101 return _ComputingNode->IsDataStreamNode() ; } ;
102 const bool IsGOTONode() const {
103 return _ComputingNode->IsGOTONode() ; } ;
104 const bool IsLoopNode() const {
105 return _ComputingNode->IsLoopNode() ; } ;
106 const bool IsEndLoopNode() const {
107 return _ComputingNode->IsEndLoopNode() ; } ;
108 const bool IsSwitchNode() const {
109 return _ComputingNode->IsSwitchNode() ; } ;
110 const bool IsEndSwitchNode() const {
111 return _ComputingNode->IsEndSwitchNode() ; } ;
112 const bool IsHeadNode() const {
113 return _ComputingNode->IsHeadNode() ; } ;
114 GraphBase::ComputingNode * ComputingNode() {
115 return _ComputingNode ; } ;
116 GraphBase::FactoryNode * FactoryNode() {
117 return _FactoryNode ; } ;
118 GraphBase::GOTONode * GOTONode() {
123 if ( _EndOfLoopNode )
124 return _EndOfLoopNode ;
127 if ( _EndOfSwitchNode )
128 return _EndOfSwitchNode ;
131 GraphBase::GOTONode * GOTONode() const {
136 if ( _EndOfLoopNode )
137 return _EndOfLoopNode ;
140 if ( _EndOfSwitchNode )
141 return _EndOfSwitchNode ;
144 GraphBase::InLineNode * InLineNode() {
145 GraphBase::InLineNode * aNode = GOTONode() ;
150 GraphBase::InLineNode * InLineNode() const {
151 GraphBase::InLineNode * aNode = GOTONode() ;
156 GraphBase::LoopNode * LoopNode() {
157 return _LoopNode ; } ;
158 GraphBase::EndOfLoopNode * EndOfLoopNode() {
159 return _EndOfLoopNode ; } ;
160 GraphBase::SwitchNode * SwitchNode() {
161 return _SwitchNode ; } ;
162 GraphBase::EndOfSwitchNode * EndOfSwitchNode() {
163 return _EndOfSwitchNode ; } ;
164 GraphBase::Graph * GraphMacroNode() {
165 return _GraphMacroNode ; } ;
167 SUPERV::CNode_var ObjRef() const { return _ComputingNode->ObjRef() ; } ;
168 void SetObjRef(SUPERV::CNode_var aNode) {
169 _ComputingNode->SetObjRef( aNode ) ; } ;
171 CNode_Impl * ObjImpl() const { return _ComputingNode->ObjImpl() ; } ;
172 void SetObjImpl( CNode_Impl * aGraph ) {
173 _ComputingNode->SetObjImpl( aGraph ) ; } ;
175 const SALOME_ModuleCatalog::Service * GetService() const {
176 return _ComputingNode->GetService() ; } ;
178 SUPERV::SDate FirstCreation() const {
179 return _ComputingNode->FirstCreation() ; } ;
180 SUPERV::SDate LastModification() const {
181 return _ComputingNode->LastModification() ; } ;
182 char* Author() const {
183 return my_strdup( _ComputingNode->Author() ) ; }
184 char* EditorRelease() const {
185 return my_strdup( _ComputingNode->EditorRelease() ) ; } ;
186 char * Comment() const {
187 return my_strdup( _ComputingNode->Comment() ) ; } ;
188 bool Author( const char * anAuthor ) {
189 return _ComputingNode->Author( anAuthor ) ; } ;
190 bool EditorRelease( const char* anEditorRelease ) {
191 return _ComputingNode->EditorRelease( anEditorRelease ) ; } ;
192 bool Comment( const char *c ) {
193 return _ComputingNode->Comment( c ) ; };
195 GraphBase::SNode * GetInfo() {
196 return _ComputingNode->GetInfo() ; } ;
198 GraphBase::InPort * AddInPort( const char * InputParameterName ,
199 const char * InputParameterType ,
200 const SUPERV::KindOfPort aKindOfPort ) {
201 return _ComputingNode->AddInPort( InputParameterName ,
204 GraphBase::OutPort * AddOutPort( const char * OutputParameterName ,
205 const char * OutputParameterType ,
206 const SUPERV::KindOfPort aKindOfPort ) {
207 return _ComputingNode->AddOutPort( OutputParameterName ,
208 OutputParameterType ,
210 int IncrDataStreamInPorts() {
211 return _ComputingNode->IncrDataStreamInPorts() ;
213 int IncrDataStreamOutPorts() {
214 return _ComputingNode->IncrDataStreamOutPorts() ;
217 void DelInPort( const char * InputParameterName ) {
218 _ComputingNode->DelInPort( InputParameterName ) ; } ;
219 void DelOutPort( const char * OutputParameterName ) {
220 _ComputingNode->DelOutPort( OutputParameterName ) ; } ;
222 bool IsLinked(const char * ToServiceParameterName ) {
223 return _ComputingNode->IsLinked( ToServiceParameterName ) ; } ;
224 bool HasInput(const char * ToServiceParameterName ) {
225 return _ComputingNode->HasInput( ToServiceParameterName ) ; } ;
227 // void InOutPort( GraphBase::InPort * InputPort ,
228 // GraphBase::OutPort * OutputPort ) {
229 // return _ComputingNode->InOutPort( InputPort , OutputPort ) ; } ;
231 const int GetNodeInPortsSize() const {
232 return _ComputingNode->GetNodeInPortsSize() ; } ;
233 const GraphBase::InPort *GetNodeInPort(int i) const {
234 return _ComputingNode->GetNodeInPort( i ) ; } ;
235 GraphBase::InPort *GetChangeNodeInPort(int i) const {
236 return _ComputingNode->GetChangeNodeInPort( i ) ; } ;
237 const int GetNodeOutPortsSize() const {
238 return _ComputingNode->GetNodeOutPortsSize() ; } ;
239 const GraphBase::OutPort *GetNodeOutPort(int i) const {
240 return _ComputingNode->GetNodeOutPort( i ) ; } ;
241 GraphBase::OutPort *GetChangeNodeOutPort(int i) const {
242 return _ComputingNode->GetChangeNodeOutPort( i ) ; } ;
244 const GraphBase::InPort *GetInPort( const char *name ) {
245 return _ComputingNode->GetInPort( name ) ; } ;
246 const GraphBase::OutPort *GetOutPort( const char *name ) {
247 return _ComputingNode->GetOutPort( name ) ; } ;
248 GraphBase::InPort *GetChangeInPort( const char *name ) {
249 return _ComputingNode->GetChangeInPort( name ) ; } ;
250 GraphBase::OutPort *GetChangeOutPort( const char *name ) {
251 return _ComputingNode->GetChangeOutPort( name ) ; } ;
253 void SetPythonFunction( const char * aFuncName ,
254 const SUPERV::ListOfStrings & aPythonFunction ) {
255 InLineNode()->SetPythonFunction( aFuncName , aPythonFunction ) ; }
256 const SUPERV::ListOfStrings * PythonFunction() const {
257 return InLineNode()->PythonFunction() ; } ;
258 char * PyFuncName() const {
259 return InLineNode()->PyFuncName() ; } ;
261 void SetPyMorePythonFunction( const char * aMoreName ,
262 const SUPERV::ListOfStrings & aMorePythonFunction ) {
263 _LoopNode->SetMorePythonFunction( aMoreName , aMorePythonFunction ) ; }
264 SUPERV::ListOfStrings * PyMorePythonFunction() const {
265 return _LoopNode->MorePythonFunction() ; } ;
266 char * PyMoreName() {
267 return _LoopNode->PyMoreName() ; };
269 void SetPyNextPythonFunction( const char * aNextName ,
270 const SUPERV::ListOfStrings & aNextPythonFunction ) {
271 _LoopNode->SetNextPythonFunction( aNextName , aNextPythonFunction ) ; }
272 SUPERV::ListOfStrings * PyNextPythonFunction() const {
273 return _LoopNode->NextPythonFunction() ; } ;
274 char * PyNextName() {
275 return _LoopNode->PyNextName() ; } ;
277 void CoupledNode( GraphBase::InLineNode * aCoupledNode ) {
278 _GOTONode->CoupledNode( aCoupledNode ) ; } ;
279 GraphBase::InLineNode * CoupledNode() {
280 return _GOTONode->CoupledNode() ; } ;
283 return _ComputingNode->SubGraph() ; } ;
284 int SubStreamGraph() {
285 return _ComputingNode->SubStreamGraph() ; } ;
287 char * ComponentName() const {
288 return _FactoryNode->ComponentName() ; } ;
289 char * InterfaceName() const {
290 return _FactoryNode->InterfaceName() ; } ;
291 char * Computer() const {
292 return _FactoryNode->Computer() ; } ;
294 bool ComponentName( const char * aComponentName ) {
295 return _FactoryNode->ComponentName( aComponentName ) ; } ;
296 bool InterfaceName( const char * anInterfaceName ) {
297 return _FactoryNode->InterfaceName( anInterfaceName ) ; } ;
298 bool Computer( const char *c ) {
299 return _FactoryNode->Computer( c ) ; } ;
301 void Coordinates( const int X , const int Y ) {
302 _ComputingNode->Coordinates( X , Y ) ; } ;
304 return _ComputingNode->XCoordinate () ; } ;
306 return _ComputingNode->YCoordinate () ; } ;