1 // SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : DataFlowBase_DataNode.hxx
25 // Author : Jean Rahuel, CEA
29 #ifndef _DATAFLOWBASE_DATANODE_HXX
30 #define _DATAFLOWBASE_DATANODE_HXX
32 #include "DataFlowBase_GOTONode.hxx"
36 class DataNode : public GOTONode {
44 GraphBase::PortsOfNode * _DataFlowDataPorts ;
49 DataNode( CORBA::ORB_ptr ORB ,
50 SALOME_NamingService* ptrNamingService ,
51 const char *DataFlowName ,
52 const SUPERV::KindOfNode DataFlowkind ,
53 int * Graph_prof_debug ,
54 ofstream * Graph_fdebug ) ;
55 DataNode( CORBA::ORB_ptr ORB ,
56 SALOME_NamingService* ptrNamingService ,
57 const SALOME_ModuleCatalog::Service& DataFlowService ,
58 const char *DataFlowName ,
59 const SUPERV::KindOfNode DataFlowkind ,
60 const SUPERV::SDate DataFlowFirstCreation ,
61 const SUPERV::SDate DataFlowLastModification ,
62 const char * DataFlowEditorRelease ,
63 const char * DataFlowAuthor ,
64 const char * DataFlowComment ) ;
67 void DataService( CORBA::ORB_ptr ORB ,
68 const SALOME_ModuleCatalog::Service aService ,
69 int * Graph_prof_debug ,
70 ofstream * Graph_fdebug ) ;
72 int CheckDataServerNodes() const ;
74 // Mirrored methods of _DataFlowDataPorts of DataNode :
75 // GetIn... gives the Out which is the input of InPort of the DataFlow
76 // GetOut... gives the In which gets the output of OutPort of the DataFlow
77 const int GetNodeInDataNodePortsSize() const {
78 return _DataFlowDataPorts->GetNodeOutPortsSize() ; } ;
79 const OutPort *GetNodeInDataNodePort(int i) const {
80 return _DataFlowDataPorts->GetNodeOutPort( i ) ; } ;
81 OutPort *GetChangeNodeInDataNodePort(int i) const {
82 return _DataFlowDataPorts->GetChangeNodeOutPort( i ) ; } ;
83 const int GetNodeOutDataNodePortsSize() const {
84 return _DataFlowDataPorts->GetNodeInPortsSize() ; } ;
85 const InPort *GetNodeOutDataNodePort(int i) const {
86 return _DataFlowDataPorts->GetNodeInPort( i ) ; } ;
87 InPort *GetChangeNodeOutDataNodePort(int i) const {
88 return _DataFlowDataPorts->GetChangeNodeInPort( i ) ; } ;
90 OutPort * GetChangeInDataNodePort( const char * DataFlowInPortName ) {
91 return _DataFlowDataPorts->GetChangeOutPort( DataFlowInPortName ) ; } ;
92 InPort * GetChangeOutDataNodePort( const char * DataFlowOutPortName ) {
93 return _DataFlowDataPorts->GetChangeInPort( DataFlowOutPortName ) ; } ;
95 void DataNodeInfo(ostream & s ) const ;
97 void ListDatas(ostream & f) const ;
99 // bool SaveXML( ostream &f , char *Tabs ,
100 bool SaveXML( QDomDocument & Graph , QDomElement & info ,
101 int X , int Y ) const {
102 GraphBase::ListOfFuncName aFuncNames ;
103 aFuncNames.resize( 0 ) ;
104 GraphBase::ListOfPythonFunctions aVoidList ;
105 // return GraphBase::ComputingNode::SaveXML( f , Tabs , "" , "" , "" , "" ,
106 return GraphBase::ComputingNode::SaveXML( Graph , info , "" , "" , "" , "" ,
107 aFuncNames , aVoidList , X , Y ) ; } ;
109 bool SavePY( ostream &f , const char * aGraphName ,
110 int X , int Y ) const {
111 GraphBase::ListOfFuncName aFuncNames ;
112 aFuncNames.resize( 0 ) ;
113 GraphBase::ListOfPythonFunctions aVoidList ;
114 return GraphBase::ComputingNode::SavePY( f , aGraphName , "" , "" , "" , NULL ,
115 aFuncNames , aVoidList , X , Y ) ; } ;