Salome HOME
Point 2.3 of "SUPERVISOR: Current state - bugs/improvements" :
[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_GOTONode.hxx"
33
34 namespace GraphBase {
35
36   class DataNode : public GOTONode {
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                 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 ) ;
65       virtual ~DataNode() ;
66
67       void DataService( CORBA::ORB_ptr ORB ,
68                         const SALOME_ModuleCatalog::Service aService ,
69                         int * Graph_prof_debug ,
70                         ofstream * Graph_fdebug ) ;
71
72       int CheckDataServerNodes() const ;
73
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 ) ; } ;
89
90       OutPort * GetChangeInDataNodePort( const char * DataFlowInPortName ) {
91                 return _DataFlowDataPorts->GetChangeOutPort( DataFlowInPortName ) ; } ;
92       InPort * GetChangeOutDataNodePort( const char * DataFlowOutPortName ) {
93                return _DataFlowDataPorts->GetChangeInPort( DataFlowOutPortName ) ; } ;
94
95       void DataNodeInfo(ostream & s ) const ;
96
97       void ListDatas(ostream & f) const ;
98
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 ) ; } ;
108
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 ) ; } ;
116   } ;
117
118 } ;
119
120 #endif