]> SALOME platform Git repositories - modules/superv.git/blob - src/GraphBase/DataFlowBase_DataNode.hxx
Salome HOME
*** empty log message ***
[modules/superv.git] / src / GraphBase / DataFlowBase_DataNode.hxx
1 //  SUPERV GraphBase : contains fondamental classes for Services, Input Ports, Output Ports Links and Nodes.
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : DataFlowBase_DataNode.hxx
25 //  Author : Jean Rahuel, CEA
26 //  Module : SUPERV
27 //  $Header:
28
29 #ifndef _DATAFLOWBASE_DATANODE_HXX
30 #define _DATAFLOWBASE_DATANODE_HXX
31
32 #include "DataFlowBase_InLineNode.hxx"
33
34 namespace GraphBase {
35
36   class DataNode : public InLineNode {
37
38     private:
39
40       bool                     _Created ;
41
42     protected :
43
44       GraphBase::PortsOfNode * _DataFlowDataPorts ;
45
46     public:
47
48       DataNode() ;
49       DataNode( CORBA::ORB_ptr ORB ,
50                 SALOME_NamingService* ptrNamingService ,
51                 const char *DataFlowName ) ;
52       DataNode( CORBA::ORB_ptr ORB ,
53                 SALOME_NamingService* ptrNamingService ,
54                 const SALOME_ModuleCatalog::Service& DataFlowService ,
55                 const char *DataFlowName ,
56                 const SUPERV::KindOfNode DataFlowkind ,
57                 const SUPERV::SDate DataFlowFirstCreation ,
58                 const SUPERV::SDate DataFlowLastModification ,
59                 const char * DataFlowEditorRelease ,
60                 const char * DataFlowAuthor ,
61                 const char * DataFlowComment ) ;
62       virtual ~DataNode() ;
63
64       void DataService( CORBA::ORB_ptr ORB ,
65                         const SALOME_ModuleCatalog::Service aService ,
66                         int * Graph_prof_debug ,
67                         ofstream * Graph_fdebug ) ;
68
69       int CheckDataServerNodes() const ;
70
71 // Mirrored methods of _DataFlowDataPorts of DataNode :
72 // GetIn... gives the Out which is the input of InPort of the DataFlow
73 // GetOut... gives the In which gets the output of OutPort of the DataFlow
74       const int GetNodeInDataNodePortsSize() const {
75                 return _DataFlowDataPorts->GetNodeOutPortsSize() ; } ;
76       const OutPort *GetNodeInDataNodePort(int i) const {
77                     return _DataFlowDataPorts->GetNodeOutPort( i ) ; } ;
78       OutPort *GetChangeNodeInDataNodePort(int i) const {
79               return _DataFlowDataPorts->GetChangeNodeOutPort( i ) ; } ;
80       const int GetNodeOutDataNodePortsSize() const {
81                 return _DataFlowDataPorts->GetNodeInPortsSize() ; } ;
82       const InPort *GetNodeOutDataNodePort(int i) const {
83                    return _DataFlowDataPorts->GetNodeInPort( i ) ; } ;
84       InPort *GetChangeNodeOutDataNodePort(int i) const {
85              return _DataFlowDataPorts->GetChangeNodeInPort( i ) ; } ;
86
87       OutPort * GetChangeInDataNodePort( const char * DataFlowInPortName ) {
88                 return _DataFlowDataPorts->GetChangeOutPort( DataFlowInPortName ) ; } ;
89       InPort * GetChangeOutDataNodePort( const char * DataFlowOutPortName ) {
90                return _DataFlowDataPorts->GetChangeInPort( DataFlowOutPortName ) ; } ;
91
92       void DataNodeInfo(ostream & s ) const ;
93
94       void ListDatas(ostream & f) const ;
95
96 //      bool SaveXML( ostream &f , char *Tabs , 
97       bool SaveXML( QDomDocument & Graph , QDomElement & info , 
98                     int X , int Y ) const {
99            GraphBase::ListOfFuncName aFuncNames ; 
100            aFuncNames.resize( 0 ) ;
101            GraphBase::ListOfPythonFunctions aVoidList ;
102 //           return GraphBase::ComputingNode::SaveXML( f , Tabs , "" , "" , "" , "" ,
103            return GraphBase::ComputingNode::SaveXML( Graph , info , "" , "" , "" , "" ,
104                                                      aFuncNames , aVoidList , X , Y ) ; } ;
105
106       bool SavePY( ostream &f , const char * aGraphName ,
107                    int X , int Y ) const {
108            GraphBase::ListOfFuncName aFuncNames ; 
109            aFuncNames.resize( 0 ) ;
110            GraphBase::ListOfPythonFunctions aVoidList ;
111            return GraphBase::ComputingNode::SavePY( f , aGraphName , "" , "" , "" , NULL ,
112                                                     aFuncNames , aVoidList , X , Y ) ; } ;
113   } ;
114
115 } ;
116
117 #endif