1 #ifndef _DATAFLOWEDITOR_DATAFLOW_LXX
2 #define _DATAFLOWEDITOR_DATAFLOW_LXX
4 #include "DataFlowEditor_OutNode.hxx"
6 inline void GraphEditor::DataFlow::ReadOnly() {
10 inline char * GraphEditor::DataFlow::DataFlowInfo() {
13 GraphEditor::DataFlow::DataFlow aDataFlow = *this ;
14 s << aDataFlow << ends ;
15 return CORBA::string_dup( s.str() );
18 inline char * GraphEditor::DataFlow::DataNodeInfo() {
21 GraphBase::DataNode::DataNodeInfo( s ) ;
22 return CORBA::string_dup(s.str());
25 inline char * GraphEditor::DataFlow::NodeInfo( const char * aNodeName ) {
27 if ( GetGraphNode( aNodeName ) )
28 GetGraphNode( aNodeName )->NodeInfo( s ) ;
30 s << aNodeName << " not found" << ends ;
31 return CORBA::string_dup( s.str() );
34 inline bool GraphEditor::DataFlow::LoadDataFlow(
35 const GraphBase::SGraph *aDataFlow ) {
38 return GraphEditor::OutNode::LoadDataFlow( aDataFlow ) ;
41 inline bool GraphEditor::DataFlow::LoadXml( const char* myFileName ) {
44 return GraphEditor::OutNode::LoadXml( myFileName ) ;
47 inline bool GraphEditor::DataFlow::LoadInfo( const GraphBase::SNode &aDataFlowInfo ) {
50 return GraphEditor::OutNode::LoadInfo( aDataFlowInfo ) ;
53 inline bool GraphEditor::DataFlow::SaveXml(const char* myFileName ) {
54 return GraphEditor::OutNode::SaveXml( myFileName ) ;
57 inline bool GraphEditor::DataFlow::SavePy(const char* myFileName ) {
58 return GraphEditor::OutNode::SavePy( myFileName ) ;
61 // get all DataFlow informations (for a .XML file) :
62 inline GraphBase::SGraph * GraphEditor::DataFlow::GetDataFlow() {
63 return GraphEditor::OutNode::GetDataFlow() ;
66 // void DateModification() ;
68 inline GraphBase::SNode * GraphEditor::DataFlow::GetInfo() const {
69 return GraphEditor::OutNode::GetInfo() ;
72 inline GraphBase::ListOfNodes * GraphEditor::DataFlow::GetNodes() const {
73 return GraphEditor::OutNode::GetNodes() ;
76 inline GraphBase::ListOfLinks * GraphEditor::DataFlow::GetLinks() const {
77 return GraphEditor::OutNode::GetLinks() ;
80 inline GraphBase::ListOfGraphs * GraphEditor::DataFlow::GetGraphs() const {
81 return GraphEditor::OutNode::GetGraphs() ;
84 inline GraphBase::ListOfLinks * GraphEditor::DataFlow::GetDatas() const {
85 return GraphEditor::OutNode::GetDatas() ;
88 inline const SALOME_ModuleCatalog::Service * GraphEditor::DataFlow::GetService() {
90 return GraphEditor::OutNode::GetService() ;
93 inline GraphEditor::InNode * GraphEditor::DataFlow::AddNode(
94 const SALOME_ModuleCatalog::Service& NodeService ,
95 const char* NodeComponentName ,
96 const char* NodeInterfaceName ,
98 const SUPERV::KindOfNode NodeKindOfNode,
99 GraphBase::ListOfFuncName aFuncName ,
100 GraphBase::ListOfPythonFunctions aPythonFunction ,
101 const SUPERV::SDate NodeFirstCreation,
102 const SUPERV::SDate NodeLastModification,
103 const char * NodeEditorRelease,
104 const char * NodeAuthor,
105 const char * NodeComputer,
106 const char * NodeComment,
110 return (GraphEditor::InNode * ) NULL ;
111 return GraphEditor::OutNode::AddNode( NodeService ,
112 aFuncName , aPythonFunction ,
115 NodeName , NodeKindOfNode ,
117 NodeLastModification ,
119 NodeAuthor , NodeComputer ,
120 NodeComment , NodeX , NodeY ) ;
123 inline GraphEditor::InNode * GraphEditor::DataFlow::GetNode( const char* NodeName ) {
124 return GraphEditor::OutNode::GetNode( NodeName ) ;
127 inline bool GraphEditor::DataFlow::RemoveNode( const char* NodeName ) {
130 return GraphEditor::OutNode::RemoveNode( NodeName ) ;
133 inline bool GraphEditor::DataFlow::ReNameNode( const char* OldNodeName ,
134 const char* NewNodeName ) {
137 return GraphEditor::OutNode::ReNameNode( OldNodeName , NewNodeName ) ;
140 inline const SALOME_ModuleCatalog::Service * GraphEditor::DataFlow::NodeService(
141 const char * aNodeName ) {
142 if ( GetGraphNode( aNodeName ) )
143 return GetGraphNode( aNodeName )->GetService() ;
147 inline void GraphEditor::DataFlow::Coordinates( const int X , const int Y ) {
148 return GraphEditor::OutNode::Coordinates( X , Y ) ;
151 inline const int GraphEditor::DataFlow::XCoordinate() {
152 return GraphEditor::OutNode::XCoordinate() ;
155 inline const int GraphEditor::DataFlow::YCoordinate() {
156 return GraphEditor::OutNode::YCoordinate() ;
159 inline void GraphEditor::DataFlow::Coordinates( const char* NodeName ,
160 const int X , const int Y ) {
161 return GraphEditor::OutNode::Coordinates( NodeName , X , Y ) ;
164 inline const int GraphEditor::DataFlow::XCoordinate( const char* NodeName ) {
165 return GraphEditor::OutNode::XCoordinate( NodeName ) ;
168 inline const int GraphEditor::DataFlow::YCoordinate( const char* NodeName ) {
169 return GraphEditor::OutNode::YCoordinate( NodeName ) ;
172 inline const GraphBase::InPort *GraphEditor::DataFlow::GetInPort( const char *name ) {
173 return GraphEditor::OutNode::GetInPort( name ) ;
175 inline const GraphBase::OutPort *GraphEditor::DataFlow::GetOutPort( const char *name ) {
176 return GraphEditor::OutNode::GetOutPort( name ) ;
178 inline GraphBase::InPort *GraphEditor::DataFlow::GetChangeInPort( const char *name ) {
179 return GraphEditor::OutNode::GetChangeInPort( name ) ;
181 inline GraphBase::OutPort *GraphEditor::DataFlow::GetChangeOutPort( const char *name ) {
182 return GraphEditor::OutNode::GetChangeOutPort( name ) ;
185 inline bool GraphEditor::DataFlow::HasInput(const char * ToServiceParameterName ) {
186 return GraphEditor::OutNode::HasInput( ToServiceParameterName ) ;
189 inline bool GraphEditor::DataFlow::AddLink( const char* FromNodeName ,
190 const char* FromServiceParameterName ,
191 const char* ToNodeName ,
192 const char* ToServiceParameterName ,
193 const CORBA::Any aValue ) {
196 CORBA::Any const * theValue = GetNode( FromNodeName )->GetOutPort( FromServiceParameterName )->Value() ; // Keep the type !
197 return GraphEditor::OutNode::AddLink( FromNodeName ,
198 FromServiceParameterName ,
200 ToServiceParameterName ,
204 inline bool GraphEditor::DataFlow::GetLink(const char* ToNodeName ,
205 const char* ToServiceParameterName ,
206 char** FromNodeName ,
207 char** FromServiceParameterName ) {
208 return GraphEditor::OutNode::GetLink( ToNodeName , ToServiceParameterName ,
210 FromServiceParameterName ) ;
213 inline GraphBase::SLink * GraphEditor::DataFlow::GetLink(
214 GraphBase::ComputingNode * aNode ,
215 const char* ToServiceParameterName ) {
216 return GraphBase::Graph::GetLink( aNode ,
217 aNode->GetChangeInPort( ToServiceParameterName ) ) ;
220 inline bool GraphEditor::DataFlow::AddLinkCoord(
221 const char* FromNodeName ,
222 const char* FromServiceParameterName ,
223 const char* ToNodeName ,
224 const char* ToServiceParameterName ,
228 return GraphEditor::OutNode::AddLinkCoord( FromNodeName ,
229 FromServiceParameterName ,
231 ToServiceParameterName ,
235 inline bool GraphEditor::DataFlow::AddLinkCoord(
236 const char* FromNodeName ,
237 const char* FromServiceParameterName ,
238 const char* ToNodeName ,
239 const char* ToServiceParameterName ,
243 return GraphEditor::OutNode::AddLinkCoord( FromNodeName ,
244 FromServiceParameterName ,
246 ToServiceParameterName ,
250 inline bool GraphEditor::DataFlow::ChangeLinkCoord(
251 const char* FromNodeName ,
252 const char* FromServiceParameterName ,
253 const char* ToNodeName ,
254 const char* ToServiceParameterName ,
258 return GraphEditor::OutNode::ChangeLinkCoord( FromNodeName ,
259 FromServiceParameterName ,
261 ToServiceParameterName ,
265 inline bool GraphEditor::DataFlow::RemoveLinkCoord(
266 const char* FromNodeName ,
267 const char* FromServiceParameterName ,
268 const char* ToNodeName ,
269 const char* ToServiceParameterName ,
271 return GraphEditor::OutNode::RemoveLinkCoord( FromNodeName ,
272 FromServiceParameterName ,
274 ToServiceParameterName ,
278 inline int GraphEditor::DataFlow::GetLinkCoordSize(
279 const char* FromNodeName ,
280 const char* FromServiceParameterName ,
281 const char* ToNodeName ,
282 const char* ToServiceParameterName ) {
283 return GraphEditor::OutNode::GetLinkCoordSize( FromNodeName ,
284 FromServiceParameterName ,
286 ToServiceParameterName ) ;
289 inline bool GraphEditor::DataFlow::GetLinkCoord(
290 const char* FromNodeName ,
291 const char* FromServiceParameterName ,
292 const char* ToNodeName ,
293 const char* ToServiceParameterName ,
295 return GraphEditor::OutNode::GetLinkCoord( FromNodeName ,
296 FromServiceParameterName ,
298 ToServiceParameterName ,
302 inline bool GraphEditor::DataFlow::GetLinkCoord(
303 const char* FromNodeName ,
304 const char* FromServiceParameterName ,
305 const char* ToNodeName ,
306 const char* ToServiceParameterName ,
307 const int index , long &X , long &Y ) {
308 return GraphEditor::OutNode::GetLinkCoord( FromNodeName ,
309 FromServiceParameterName ,
311 ToServiceParameterName ,
315 inline bool GraphEditor::DataFlow::RemoveLink(
316 const char* FromNodeName ,
317 const char* FromServiceParameterName ,
318 const char* ToNodeName ,
319 const char* ToServiceParameterName ) {
322 return GraphEditor::OutNode::RemoveLink( FromNodeName ,
323 FromServiceParameterName ,
325 ToServiceParameterName ) ;
328 inline bool GraphEditor::DataFlow::AddInputData( const char* ToNodeName ,
329 const char* ToParameterName ,
330 const CORBA::Any aValue ) {
332 GraphBase::Node *toNode ;
333 GraphBase::InPort *toPort ;
336 NodePort( ToNodeName , ToParameterName , &aNode , &aPort ) ;
337 toNode = GetChangeGraphNode( aNode ) ;
339 toPort = toNode->GetChangeInPort( aPort ) ;
340 if ( toPort && ( toPort->IsConnected() ||
341 toPort->IsDataConnected() ) ) {
342 RemoveLink( toNode->Name() , toPort->PortName() ) ;
353 return GraphBase::Graph::AddInputData( ToNodeName , ToParameterName ,
357 inline bool GraphEditor::DataFlow::AddInputSharedData(const char* ToNodeName1 ,
358 const char* ToParameterName1 ,
359 const char* ToNodeName2 ,
360 const char* ToParameterName2 ) {
363 return GraphEditor::OutNode::AddInputData( ToNodeName1 , ToParameterName1 ,
364 ToNodeName2 , ToParameterName2 ) ;
367 inline const CORBA::Any *GraphEditor::DataFlow::GetInData(
368 const char * ToNodeName ,
369 const char * ToParameterName ) {
370 return GraphEditor::OutNode::GetInData( ToNodeName ,
373 inline const CORBA::Any *GraphEditor::DataFlow::GetOutData(
374 const char * FromNodeName ,
375 const char * FromParameterName ) {
376 return GraphEditor::OutNode::GetOutData( FromNodeName ,
377 FromParameterName ) ;
380 inline bool GraphEditor::DataFlow::IsValid() {
381 return GraphEditor::OutNode::IsValid() ;
384 inline bool GraphEditor::DataFlow::IsExecutable() {
385 return GraphEditor::OutNode::IsExecutable() ;
388 inline bool GraphEditor::DataFlow::IsExecuting() {
389 if ( _DataFlowExecutor ) {
390 if ( _DataFlowExecutor->IsDone() ) {
403 inline bool GraphEditor::DataFlow::IsEditing() {
404 return !IsExecuting() ;
407 inline bool GraphEditor::DataFlow::IsReadOnly() {
411 inline long GraphEditor::DataFlow::LevelMax() {
414 return GraphBase::Graph::LevelMax() ;
417 inline SUPERV::ListOfStrings * GraphEditor::DataFlow::LevelNodes(long aLevel ) {
419 return ((SUPERV::ListOfStrings * ) NULL ) ;
420 return GraphBase::Graph::LevelNodes( aLevel ) ;
423 inline long GraphEditor::DataFlow::ThreadsMax() {
426 return GraphBase::Graph::ThreadsMax() ;
429 inline long GraphEditor::DataFlow::GraphsNumber() {
432 return GraphBase::Graph::GraphsNumber() ;
435 inline void GraphEditor::DataFlow::Executor(
436 GraphExecutor::DataFlow * DataFlowExecutor ) {
437 _DataFlowExecutor = DataFlowExecutor ;
440 inline GraphExecutor::DataFlow * GraphEditor::DataFlow::Executor() const {
441 return _DataFlowExecutor ;