Salome HOME
Merge from V6_3_BR 06/06/2011
[modules/homard.git] / src / HOMARD_I / HOMARD_Iteration_i.cxx
1 // Copyright (C) 2011  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "HOMARD_Iteration_i.hxx"
21 #include "HOMARD_Gen_i.hxx"
22 #include "HOMARD_Iteration.hxx"
23 #include "HOMARD_DriverTools.hxx"
24
25 #include "utilities.h"
26
27 //=============================================================================
28 /*!
29  *  standard constructor
30  */
31 //=============================================================================
32 HOMARD_Iteration_i::HOMARD_Iteration_i()
33 {
34   MESSAGE( "Default constructor, not for use" );
35   ASSERT( 0 );
36 }
37
38 //=============================================================================
39 /*!
40  *  standard constructor
41  */
42 //=============================================================================
43 HOMARD_Iteration_i::HOMARD_Iteration_i( CORBA::ORB_ptr orb,
44                                         HOMARD::HOMARD_Gen_var engine )
45 {
46   MESSAGE( "HOMARD_Iteration_i" );
47   _gen_i = engine;
48   _orb = orb;
49   myHomardIteration = new ::HOMARD_Iteration();
50   ASSERT( myHomardIteration );
51 }
52
53 //=============================================================================
54 /*!
55  *  standard destructor
56  */
57 //=============================================================================
58 HOMARD_Iteration_i::~HOMARD_Iteration_i()
59 {
60 }
61
62 //=============================================================================
63 /*!
64  */
65 //=============================================================================
66 void HOMARD_Iteration_i::SetName( const char* NomIter )
67 {
68   ASSERT( myHomardIteration );
69   myHomardIteration->SetName( NomIter );
70 }
71
72 //=============================================================================
73 char* HOMARD_Iteration_i::GetName()
74 {
75   ASSERT( myHomardIteration );
76   return CORBA::string_dup( myHomardIteration->GetName().c_str() );
77 }
78
79 //=============================================================================
80 char* HOMARD_Iteration_i::GetDumpPython()
81 {
82   ASSERT( myHomardIteration );
83   return CORBA::string_dup( myHomardIteration->GetDumpPython().c_str() );
84 }
85
86 //=============================================================================
87
88 //=============================================================================
89 void HOMARD_Iteration_i::SetEtat( CORBA::Boolean Etat )
90 {
91   ASSERT( myHomardIteration );
92   myHomardIteration->SetEtat( Etat );
93 }
94
95 //=============================================================================
96 CORBA::Boolean HOMARD_Iteration_i::GetEtat()
97 {
98   ASSERT( myHomardIteration );
99   return CORBA::Boolean( myHomardIteration->GetEtat());
100 }
101
102 //=============================================================================
103 void HOMARD_Iteration_i::SetNumber( CORBA::Long NumIter )
104 {
105   ASSERT( myHomardIteration );
106   myHomardIteration->SetNumber( NumIter );
107 }
108
109 //=============================================================================
110 CORBA::Long HOMARD_Iteration_i::GetNumber()
111 {
112   ASSERT( myHomardIteration );
113   return  myHomardIteration->GetNumber() ;
114 }
115
116 //=============================================================================
117 void HOMARD_Iteration_i::SetMeshName( const char* NomMesh )
118 {
119   ASSERT( myHomardIteration );
120   myHomardIteration->SetMeshName( NomMesh );
121 }
122
123 //=============================================================================
124 char* HOMARD_Iteration_i::GetMeshName()
125 {
126   ASSERT( myHomardIteration );
127   return CORBA::string_dup( myHomardIteration->GetMeshName().c_str() );
128 }
129
130 //=============================================================================
131 char* HOMARD_Iteration_i::GetIterParent()
132 {
133   ASSERT( myHomardIteration );
134   return CORBA::string_dup( myHomardIteration->GetIterParent().c_str() );
135
136 }
137
138 //=============================================================================
139 HOMARD::listeIterFilles* HOMARD_Iteration_i::GetIterations()
140 {
141   ASSERT( myHomardIteration );
142   const std::list<std::string>& maListe = myHomardIteration->GetIterations();
143   HOMARD::listeIterFilles_var aResult = new HOMARD::listeIterFilles;
144   aResult->length( maListe.size() );
145   std::list<std::string>::const_iterator it;
146   int i = 0;
147   for ( it = maListe.begin(); it != maListe.end(); it++ )
148   {
149     aResult[i++] = CORBA::string_dup( (*it).c_str() );
150   }
151   return aResult._retn();
152 }
153
154 //=============================================================================
155 void HOMARD_Iteration_i::SetIterParent( const char* NomIterParent )
156 {
157   ASSERT( myHomardIteration );
158   myHomardIteration->SetIterParent( NomIterParent );
159 }
160
161 //=============================================================================
162 void HOMARD_Iteration_i::AddIteration( const char* NomIter )
163 {
164   ASSERT( myHomardIteration );
165   myHomardIteration->AddIteration( NomIter );
166 }
167
168 //=============================================================================
169 CORBA::Boolean  HOMARD_Iteration_i::Compute()
170 {
171   ASSERT( myHomardIteration );
172   return  CORBA::Boolean( myHomardIteration->Compute() );
173 }
174
175 //=============================================================================
176 void HOMARD_Iteration_i::SetMeshFile( const char* MeshFile )
177 {
178   ASSERT( myHomardIteration );
179   myHomardIteration->SetMeshFile( MeshFile );
180 }
181
182 //=============================================================================
183 char* HOMARD_Iteration_i::GetMeshFile()
184 {
185   ASSERT( myHomardIteration );
186   return CORBA::string_dup( myHomardIteration->GetMeshFile().c_str() );
187 }
188
189 //=============================================================================
190 char* HOMARD_Iteration_i::GetCaseName()
191 {
192   ASSERT( myHomardIteration );
193   return CORBA::string_dup( myHomardIteration->GetCaseName().c_str() );
194 }
195
196 //=============================================================================
197 void HOMARD_Iteration_i::SetCaseName( const char* NomCas )
198 {
199   ASSERT( myHomardIteration );
200   myHomardIteration->SetCaseName( NomCas );
201 }
202
203 //=============================================================================
204 char* HOMARD_Iteration_i::GetDirName()
205 {
206   ASSERT( myHomardIteration );
207   return CORBA::string_dup( myHomardIteration->GetDirName().c_str() );
208 }
209
210 //=============================================================================
211 void HOMARD_Iteration_i::SetDirName( const char* NomDir )
212 {
213   ASSERT( myHomardIteration );
214   myHomardIteration->SetDirName( NomDir );
215 }
216
217 //=============================================================================
218 char* HOMARD_Iteration_i::GetHypoName()
219 {
220   ASSERT( myHomardIteration );
221   return CORBA::string_dup( myHomardIteration->GetHypoName().c_str() );
222
223 }
224
225 //=============================================================================
226 void HOMARD_Iteration_i::SetHypoName( const char* NomHypo )
227 {
228   ASSERT( myHomardIteration );
229   myHomardIteration->SetHypoName( NomHypo );
230 }
231
232 //=============================================================================
233 void HOMARD_Iteration_i::SetFieldFile( const char* FieldFile )
234 {
235   ASSERT( myHomardIteration );
236   myHomardIteration->SetFieldFile( FieldFile );
237 }
238
239 //=============================================================================
240 char* HOMARD_Iteration_i::GetFieldFile()
241 {
242   ASSERT( myHomardIteration );
243   return CORBA::string_dup( myHomardIteration->GetFieldFile().c_str() );
244 }
245
246 //=============================================================================
247 void HOMARD_Iteration_i::SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank )
248 {
249   ASSERT( myHomardIteration );
250   myHomardIteration->SetTimeStepRank( TimeStep, Rank );
251 }
252
253 //=============================================================================
254 CORBA::Long HOMARD_Iteration_i::GetTimeStep()
255 {
256   ASSERT( myHomardIteration );
257   return  CORBA::Long( myHomardIteration->GetTimeStep() );
258 }
259
260 //=============================================================================
261 CORBA::Long HOMARD_Iteration_i::GetRank()
262 {
263   ASSERT( myHomardIteration );
264   return  CORBA::Long( myHomardIteration->GetRank() );
265 }
266
267 //=============================================================================
268 void HOMARD_Iteration_i::SetMessFile( const char* MessFile )
269 {
270   ASSERT( myHomardIteration );
271   myHomardIteration->SetMessFile( MessFile );
272 }
273
274 //=============================================================================
275 char* HOMARD_Iteration_i::GetMessFile()
276 {
277   ASSERT( myHomardIteration );
278   return CORBA::string_dup( myHomardIteration->GetMessFile().c_str() );
279 }
280 //=============================================================================
281 std::string HOMARD_Iteration_i::Dump() const
282 {
283   return HOMARD::Dump( *myHomardIteration );
284 }
285
286 //=============================================================================
287 bool HOMARD_Iteration_i::Restore( const std::string& stream )
288 {
289   return HOMARD::Restore( *myHomardIteration, stream );
290 }