1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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
22 // SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
23 // File : DataFlowBase_DataNode.hxx
24 // Author : Jean Rahuel, CEA
28 #ifndef _DATAFLOWBASE_DATANODE_HXX
29 #define _DATAFLOWBASE_DATANODE_HXX
31 #include "DataFlowBase_GOTONode.hxx"
35 class DataNode : public GOTONode {
43 GraphBase::PortsOfNode * _DataFlowDataPorts ;
48 DataNode( CORBA::ORB_ptr ORB ,
49 SALOME_NamingService* ptrNamingService ,
50 const char *DataFlowName ,
51 const SUPERV::KindOfNode DataFlowkind ,
52 int * Graph_prof_debug ,
53 ofstream * Graph_fdebug ) ;
54 DataNode( CORBA::ORB_ptr ORB ,
55 SALOME_NamingService* ptrNamingService ,
56 const SALOME_ModuleCatalog::Service& DataFlowService ,
57 const char *DataFlowName ,
58 const SUPERV::KindOfNode DataFlowkind ,
59 const SUPERV::SDate DataFlowFirstCreation ,
60 const SUPERV::SDate DataFlowLastModification ,
61 const char * DataFlowEditorRelease ,
62 const char * DataFlowAuthor ,
63 const char * DataFlowComment ) ;
66 void DataService( CORBA::ORB_ptr ORB ,
67 const SALOME_ModuleCatalog::Service aService ,
68 int * Graph_prof_debug ,
69 ofstream * Graph_fdebug ) ;
71 int CheckDataServerNodes() const ;
73 // Mirrored methods of _DataFlowDataPorts of DataNode :
74 // GetIn... gives the Out which is the input of InPort of the DataFlow
75 // GetOut... gives the In which gets the output of OutPort of the DataFlow
76 const int GetNodeInDataNodePortsSize() const {
77 return _DataFlowDataPorts->GetNodeOutPortsSize() ; } ;
78 const OutPort *GetNodeInDataNodePort(int i) const {
79 return _DataFlowDataPorts->GetNodeOutPort( i ) ; } ;
80 OutPort *GetChangeNodeInDataNodePort(int i) const {
81 return _DataFlowDataPorts->GetChangeNodeOutPort( i ) ; } ;
82 const int GetNodeOutDataNodePortsSize() const {
83 return _DataFlowDataPorts->GetNodeInPortsSize() ; } ;
84 const InPort *GetNodeOutDataNodePort(int i) const {
85 return _DataFlowDataPorts->GetNodeInPort( i ) ; } ;
86 InPort *GetChangeNodeOutDataNodePort(int i) const {
87 return _DataFlowDataPorts->GetChangeNodeInPort( i ) ; } ;
89 OutPort * GetChangeInDataNodePort( const char * DataFlowInPortName ) {
90 return _DataFlowDataPorts->GetChangeOutPort( DataFlowInPortName ) ; } ;
91 InPort * GetChangeOutDataNodePort( const char * DataFlowOutPortName ) {
92 return _DataFlowDataPorts->GetChangeInPort( DataFlowOutPortName ) ; } ;
94 void DataNodeInfo(ostream & s ) const ;
96 void ListDatas(ostream & f) const ;
98 // bool SaveXML( ostream &f , char *Tabs ,
99 bool SaveXML( QDomDocument & Graph , QDomElement & info ,
100 int X , int Y ) const {
101 GraphBase::ListOfFuncName aFuncNames ;
102 aFuncNames.resize( 0 ) ;
103 GraphBase::ListOfPythonFunctions aVoidList ;
104 // return GraphBase::ComputingNode::SaveXML( f , Tabs , "" , "" , "" , "" ,
105 return GraphBase::ComputingNode::SaveXML( Graph , info , "" , "" , "" , "" ,
106 aFuncNames , aVoidList , X , Y ) ; } ;
108 bool SavePY( ostream &f , const char * aGraphName ,
109 int X , int Y ) const {
110 GraphBase::ListOfFuncName aFuncNames ;
111 aFuncNames.resize( 0 ) ;
112 GraphBase::ListOfPythonFunctions aVoidList ;
113 return GraphBase::ComputingNode::SavePY( f , aGraphName , "" , "" , "" , NULL ,
114 aFuncNames , aVoidList , X , Y ) ; } ;