Salome HOME
method getViewType() added that returns CANVAS, CONTROL or CANVASTABLE constant corre...
[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  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : DataFlowBase_InDataStreamPort.cxx
8 //  Author : Jean Rahuel
9 //  Module : SUPERV
10 //  $Header:
11
12 using namespace std;
13
14 #include "DataFlowBase_InDataStreamPort.hxx"
15
16 GraphBase::InDataStreamPort::InDataStreamPort() :
17   GraphBase::InPort::InPort() {
18   _KindOfSchema = SUPERV::SCHENULL ;
19   _KindOfInterpolation = SUPERV::INTERNULL ;
20   _KindOfExtrapolation = SUPERV::EXTRANULL ;
21   cdebug << "GraphBase::InDataStreamPort::InDataStreamPort " << this << " "  << PortName() << " " << _KindOfSchema << " " << _KindOfInterpolation
22          << " " << _KindOfExtrapolation << endl ;
23 }
24
25 GraphBase::InDataStreamPort::InDataStreamPort( 
26            const char *const * NodeName ,
27            const SALOME_ModuleCatalog::ServicesParameter aserviceParameter ,
28            const SALOME_ModuleCatalog::DataStreamDependency aDependency ,
29            const SUPERV::KindOfSchema aKindOfSchema ,
30            const SUPERV::KindOfInterpolation aKindOfInterpolation ,
31            const SUPERV::KindOfExtrapolation aKindOfExtrapolation ) :
32   InPort( NodeName , aserviceParameter , SUPERV::DataStreamParameter , aDependency ) {
33   if ( aDependency == SALOME_ModuleCatalog::DATASTREAM_TEMPORAL ) {
34     _KindOfSchema = aKindOfSchema ;
35     _KindOfInterpolation = aKindOfInterpolation ;
36     _KindOfExtrapolation = aKindOfExtrapolation ;
37   }
38   else {
39     _KindOfSchema = SUPERV::SCHENULL ;
40     _KindOfInterpolation = SUPERV::INTERNULL ;
41     _KindOfExtrapolation = SUPERV::EXTRANULL ;
42   }
43   cdebug << "GraphBase::InDataStreamPort::InDataStreamPort " << this << " " << PortName() << " " << _KindOfSchema << " " << _KindOfInterpolation
44          << " " << _KindOfExtrapolation << endl ;
45 }
46
47 GraphBase::InDataStreamPort::~InDataStreamPort() {
48   cdebug << "GraphBase::InDataStreamPort::~InDataStreamPort " << this << endl ;
49 }
50
51 bool GraphBase::InDataStreamPort::SetParams( const SUPERV::KindOfSchema aKindOfSchema ,
52                                              const SUPERV::KindOfInterpolation aKindOfInterpolation ,
53                                              const SUPERV::KindOfExtrapolation aKindOfExtrapolation ) {
54   bool RetVal = true ;
55   if ( Dependency() == SALOME_ModuleCatalog::DATASTREAM_TEMPORAL ) {
56     _KindOfSchema = aKindOfSchema ;
57     _KindOfInterpolation = aKindOfInterpolation ;
58     _KindOfExtrapolation = aKindOfExtrapolation ;
59   }
60   else {
61     _KindOfSchema = SUPERV::SCHENULL ;
62     _KindOfInterpolation = SUPERV::INTERNULL ;
63     _KindOfExtrapolation = SUPERV::EXTRANULL ;
64     RetVal = false ;
65   }
66   cdebug << "GraphBase::InDataStreamPort::SetParams RetVal " << RetVal << " " << PortName() << " " << _KindOfSchema << " "
67          << _KindOfInterpolation << " " << _KindOfExtrapolation << endl ;
68   return RetVal ;
69 }
70
71 void GraphBase::InDataStreamPort::Params( SUPERV::KindOfSchema & aKindOfSchema ,
72                                           SUPERV::KindOfInterpolation & aKindOfInterpolation ,
73                                           SUPERV::KindOfExtrapolation & aKindOfExtrapolation ) const {
74   aKindOfSchema = _KindOfSchema ;
75   aKindOfInterpolation = _KindOfInterpolation ;
76   aKindOfExtrapolation = _KindOfExtrapolation ;
77   cdebug << "GraphBase::InDataStreamPort::Params " << PortName() << " " << _KindOfSchema << " " << _KindOfInterpolation << " "
78          << _KindOfExtrapolation << endl ;
79 }
80
81 ostream & operator<< (ostream & f ,const SUPERV::KindOfSchema & s ) {
82   switch (s) {
83   case SUPERV::SCHENULL :
84     f << "SCHENULL";
85     break;
86   case SUPERV::TI :
87     f << "TI";
88     break;
89   case SUPERV::TF :
90     f << "TF";
91     break;
92   case SUPERV::DELTA :
93     f << "DELTA";
94     break;
95   default :
96     f << "UndefinedKindOfSchema";
97     break;
98   }
99
100   return f;
101 }
102
103 ostream & operator<< (ostream & f ,const SUPERV::KindOfInterpolation & s ) {
104   switch (s) {
105   case SUPERV::INTERNULL :
106     f << "INTERNULL";
107     break;
108   case SUPERV::L0 :
109     f << "L0";
110     break;
111   case SUPERV::L1 :
112     f << "L1";
113     break;
114   default :
115     f << "UndefinedKindOfInterpolation";
116     break;
117   }
118
119   return f;
120 }
121
122 ostream & operator<< (ostream & f ,const SUPERV::KindOfExtrapolation & s ) {
123   switch (s) {
124   case SUPERV::EXTRANULL :
125     f << "EXTRANULL";
126     break;
127   case SUPERV::E0 :
128     f << "E0";
129     break;
130   case SUPERV::E1 :
131     f << "E1";
132     break;
133   default :
134     f << "UndefinedKindOfExtrapolation";
135     break;
136   }
137
138   return f;
139 }
140