]> SALOME platform Git repositories - modules/superv.git/blob - src/GraphBase/DataFlowBase_InDataStreamPort.cxx
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/superv.git] / src / GraphBase / DataFlowBase_InDataStreamPort.cxx
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : DataFlowBase_InDataStreamPort.cxx
23 //  Author : Jean Rahuel
24 //  Module : SUPERV
25
26 using namespace std;
27
28 #include "DataFlowBase_InDataStreamPort.hxx"
29
30 GraphBase::InDataStreamPort::InDataStreamPort() :
31   GraphBase::InPort::InPort() {
32   _KindOfSchema = SUPERV::SCHENULL ;
33   _KindOfInterpolation = SUPERV::INTERNULL ;
34   _KindOfExtrapolation = SUPERV::EXTRANULL ;
35   cdebug << "GraphBase::InDataStreamPort::InDataStreamPort " << this << " "  << PortName() << " " << _KindOfSchema << " " << _KindOfInterpolation
36          << " " << _KindOfExtrapolation << endl ;
37 }
38
39 GraphBase::InDataStreamPort::InDataStreamPort( 
40            const char *const * NodeName ,
41            const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
42            const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
43            const SUPERV::KindOfSchema aKindOfSchema ,
44            const SUPERV::KindOfInterpolation aKindOfInterpolation ,
45            const SUPERV::KindOfExtrapolation aKindOfExtrapolation ) :
46   InPort( NodeName , aserviceParameter , SUPERV::DataStreamParameter , aDependency ) {
47   if ( aDependency == SALOME_ModuleCatalog::DATASTREAM_TEMPORAL ) {
48     _KindOfSchema = aKindOfSchema ;
49     _KindOfInterpolation = aKindOfInterpolation ;
50     _KindOfExtrapolation = aKindOfExtrapolation ;
51   }
52   else {
53     _KindOfSchema = SUPERV::SCHENULL ;
54     _KindOfInterpolation = SUPERV::INTERNULL ;
55     _KindOfExtrapolation = SUPERV::EXTRANULL ;
56   }
57   cdebug << "GraphBase::InDataStreamPort::InDataStreamPort " << this << " " << PortName() << " " << _KindOfSchema << " " << _KindOfInterpolation
58          << " " << _KindOfExtrapolation << endl ;
59 }
60
61 GraphBase::InDataStreamPort::~InDataStreamPort() {
62   cdebug << "GraphBase::InDataStreamPort::~InDataStreamPort " << this << endl ;
63 }
64
65 bool GraphBase::InDataStreamPort::SetParams( const SUPERV::KindOfSchema aKindOfSchema ,
66                                              const SUPERV::KindOfInterpolation aKindOfInterpolation ,
67                                              const SUPERV::KindOfExtrapolation aKindOfExtrapolation ) {
68   bool RetVal = true ;
69   if ( Dependency() == SALOME_ModuleCatalog::DATASTREAM_TEMPORAL ) {
70     _KindOfSchema = aKindOfSchema ;
71     _KindOfInterpolation = aKindOfInterpolation ;
72     _KindOfExtrapolation = aKindOfExtrapolation ;
73   }
74   else {
75     _KindOfSchema = SUPERV::SCHENULL ;
76     _KindOfInterpolation = SUPERV::INTERNULL ;
77     _KindOfExtrapolation = SUPERV::EXTRANULL ;
78     RetVal = false ;
79   }
80   cdebug << "GraphBase::InDataStreamPort::SetParams RetVal " << RetVal << " " << PortName() << " " << _KindOfSchema << " "
81          << _KindOfInterpolation << " " << _KindOfExtrapolation << endl ;
82   return RetVal ;
83 }
84
85 void GraphBase::InDataStreamPort::Params( SUPERV::KindOfSchema & aKindOfSchema ,
86                                           SUPERV::KindOfInterpolation & aKindOfInterpolation ,
87                                           SUPERV::KindOfExtrapolation & aKindOfExtrapolation ) const {
88   aKindOfSchema = _KindOfSchema ;
89   aKindOfInterpolation = _KindOfInterpolation ;
90   aKindOfExtrapolation = _KindOfExtrapolation ;
91   cdebug << "GraphBase::InDataStreamPort::Params " << PortName() << " " << _KindOfSchema << " " << _KindOfInterpolation << " "
92          << _KindOfExtrapolation << endl ;
93 }
94
95 ostream & operator<< (ostream & f ,const SUPERV::KindOfSchema & s ) {
96   switch (s) {
97   case SUPERV::SCHENULL :
98     f << "SCHENULL";
99     break;
100   case SUPERV::TI :
101     f << "TI";
102     break;
103   case SUPERV::TF :
104     f << "TF";
105     break;
106   case SUPERV::DELTA :
107     f << "DELTA";
108     break;
109   default :
110     f << "UndefinedKindOfSchema";
111     break;
112   }
113
114   return f;
115 }
116
117 ostream & operator<< (ostream & f ,const SUPERV::KindOfInterpolation & s ) {
118   switch (s) {
119   case SUPERV::INTERNULL :
120     f << "INTERNULL";
121     break;
122   case SUPERV::L0 :
123     f << "L0";
124     break;
125   case SUPERV::L1 :
126     f << "L1";
127     break;
128   default :
129     f << "UndefinedKindOfInterpolation";
130     break;
131   }
132
133   return f;
134 }
135
136 ostream & operator<< (ostream & f ,const SUPERV::KindOfExtrapolation & s ) {
137   switch (s) {
138   case SUPERV::EXTRANULL :
139     f << "EXTRANULL";
140     break;
141   case SUPERV::E0 :
142     f << "E0";
143     break;
144   case SUPERV::E1 :
145     f << "E1";
146     break;
147   default :
148     f << "UndefinedKindOfExtrapolation";
149     break;
150   }
151
152   return f;
153 }
154