Salome HOME
MeshFormatWriter and MeshFormaReader are in MEDCOUPLING namespace
[modules/smesh.git] / src / ADAPT_I / HOMARD_YACS_i.cxx
1 // Copyright (C) 2011-2020  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, or (at your option) any later version.
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 // Remarques :
21 // L'ordre de description des fonctions est le meme dans tous les fichiers
22 // HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
23 // 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
24 // 2. Les caracteristiques
25 // 3. Le lien avec les autres structures
26 //
27 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
28 //
29
30 #include "HOMARD_YACS_i.hxx"
31 #include "ADAPT_Gen_i.hxx"
32 #include "HOMARD_YACS.hxx"
33 #include "HOMARD_DriverTools.hxx"
34
35 #include "SALOMEDS_Tool.hxx"
36
37 #include "utilities.h"
38
39 //=============================================================================
40 /*!
41  *  standard constructor
42  */
43 //=============================================================================
44 HOMARD_YACS_i::HOMARD_YACS_i()
45 {
46   MESSAGE( "Default constructor, not for use" );
47   ASSERT( 0 );
48 }
49 //=============================================================================
50 /*!
51  *  standard constructor
52  */
53 //=============================================================================
54 HOMARD_YACS_i::HOMARD_YACS_i( CORBA::ORB_ptr orb,
55                                         ADAPT::ADAPT_Gen_var engine )
56 {
57   MESSAGE("constructor");
58   _gen_i = engine;
59   _orb = orb;
60   myHomardYACS = new ::HOMARD_YACS();
61   ASSERT( myHomardYACS );
62 }
63 //=============================================================================
64 /*!
65  *  standard destructor
66  */
67 //=============================================================================
68 HOMARD_YACS_i::~HOMARD_YACS_i()
69 {
70 }
71 //=============================================================================
72 //=============================================================================
73 // Generalites
74 //=============================================================================
75 //=============================================================================
76 void HOMARD_YACS_i::SetName( const char* Name )
77 {
78   ASSERT( myHomardYACS );
79   myHomardYACS->SetName( Name );
80 }
81 //=============================================================================
82 char* HOMARD_YACS_i::GetName()
83 {
84   ASSERT( myHomardYACS );
85   return CORBA::string_dup( myHomardYACS->GetName().c_str() );
86 }
87 //=============================================================================
88 CORBA::Long HOMARD_YACS_i::Delete( CORBA::Long Option )
89 {
90   ASSERT( myHomardYACS );
91   char* YACSName = GetName() ;
92   MESSAGE ( "Delete : destruction du schema " << YACSName << ", Option = " << Option );
93   return _gen_i->DeleteYACS(YACSName, Option) ;
94 }
95 //=============================================================================
96 char* HOMARD_YACS_i::GetDumpPython()
97 {
98   ASSERT( myHomardYACS );
99   return CORBA::string_dup( myHomardYACS->GetDumpPython().c_str() );
100 }
101 //=============================================================================
102 std::string HOMARD_YACS_i::Dump() const
103 {
104   return ADAPT::Dump( *myHomardYACS );
105 }
106 //=============================================================================
107 bool HOMARD_YACS_i::Restore( const std::string& stream )
108 {
109   return ADAPT::Restore( *myHomardYACS, stream );
110 }
111 //=============================================================================
112 //=============================================================================
113 // Caracteristiques
114 //=============================================================================
115 //=============================================================================
116 void HOMARD_YACS_i::SetType( CORBA::Long Type )
117 {
118   ASSERT( myHomardYACS );
119   myHomardYACS->SetType( Type );
120 }
121 //=============================================================================
122 CORBA::Long HOMARD_YACS_i::GetType()
123 {
124   ASSERT( myHomardYACS );
125   return  CORBA::Long( myHomardYACS->GetType() );
126 }
127 //=============================================================================
128 //=============================================================================
129 // Caracteristiques de la convergence
130 //=============================================================================
131 //=============================================================================
132 void HOMARD_YACS_i::SetMaxIter( CORBA::Long MaxIter )
133 {
134   ASSERT( myHomardYACS );
135   myHomardYACS->SetMaxIter( MaxIter );
136 }
137 //=============================================================================
138 CORBA::Long HOMARD_YACS_i::GetMaxIter()
139 {
140   ASSERT( myHomardYACS );
141   return  CORBA::Long( myHomardYACS->GetMaxIter() );
142 }
143 //=============================================================================
144 void HOMARD_YACS_i::SetMaxNode( CORBA::Long MaxNode )
145 {
146   ASSERT( myHomardYACS );
147   myHomardYACS->SetMaxNode( MaxNode );
148 }
149 //=============================================================================
150 CORBA::Long HOMARD_YACS_i::GetMaxNode()
151 {
152   ASSERT( myHomardYACS );
153   return  CORBA::Long( myHomardYACS->GetMaxNode() );
154 }
155 //=============================================================================
156 void HOMARD_YACS_i::SetMaxElem( CORBA::Long MaxElem )
157 {
158   ASSERT( myHomardYACS );
159   myHomardYACS->SetMaxElem( MaxElem );
160 }
161 //=============================================================================
162 CORBA::Long HOMARD_YACS_i::GetMaxElem()
163 {
164   ASSERT( myHomardYACS );
165   return  CORBA::Long( myHomardYACS->GetMaxElem() );
166 }
167 //=============================================================================
168 void HOMARD_YACS_i::SetTestConvergence( CORBA::Long TypeTest, CORBA::Double VRef)
169 {
170   ASSERT( myHomardYACS );
171   myHomardYACS->SetTestConvergence( TypeTest, VRef );
172 }
173 //=============================================================================
174 CORBA::Long HOMARD_YACS_i::GetTestConvergenceType()
175 {
176   ASSERT( myHomardYACS );
177   return  CORBA::Long( myHomardYACS->GetTestConvergenceType() );
178 }
179 //=============================================================================
180 CORBA::Double HOMARD_YACS_i::GetTestConvergenceVRef()
181 {
182   ASSERT( myHomardYACS );
183   return  CORBA::Long( myHomardYACS->GetTestConvergenceVRef() );
184 }
185 //=============================================================================
186 //=============================================================================
187 // Repertoire et fichiers
188 //=============================================================================
189 //=============================================================================
190 void HOMARD_YACS_i::SetDirName( const char* NomDir )
191 {
192   ASSERT( myHomardYACS );
193   myHomardYACS->SetDirName( NomDir );
194 }
195 //=============================================================================
196 char* HOMARD_YACS_i::GetDirName()
197 {
198   ASSERT( myHomardYACS );
199   return CORBA::string_dup( myHomardYACS->GetDirName().c_str() );
200 }
201 //=============================================================================
202 void HOMARD_YACS_i::SetMeshFile( const char* MeshFile )
203 {
204   ASSERT( myHomardYACS );
205   myHomardYACS->SetMeshFile( MeshFile );
206 }
207 //=============================================================================
208 char* HOMARD_YACS_i::GetMeshFile()
209 {
210   ASSERT( myHomardYACS );
211   return CORBA::string_dup( myHomardYACS->GetMeshFile().c_str() );
212 }
213 //=============================================================================
214 void HOMARD_YACS_i::SetScriptFile( const char* ScriptFile )
215 {
216   ASSERT( myHomardYACS );
217   myHomardYACS->SetScriptFile( ScriptFile );
218 }
219 //=============================================================================
220 char* HOMARD_YACS_i::GetScriptFile()
221 {
222   ASSERT( myHomardYACS );
223   return CORBA::string_dup( myHomardYACS->GetScriptFile().c_str() );
224 }
225 //=============================================================================
226 void HOMARD_YACS_i::SetXMLFile( const char* XMLFile )
227 {
228   ASSERT( myHomardYACS );
229   MESSAGE ( "SetXMLFile : SetXMLFile = " << XMLFile );
230   myHomardYACS->SetXMLFile( XMLFile );
231 }
232 //=============================================================================
233 char* HOMARD_YACS_i::GetXMLFile()
234 {
235   ASSERT( myHomardYACS );
236   return CORBA::string_dup( myHomardYACS->GetXMLFile().c_str() );
237 }
238 //=============================================================================
239 //=============================================================================
240 // Liens avec les autres structures
241 //=============================================================================
242 //=============================================================================
243 void HOMARD_YACS_i::SetCaseName( const char* NomCas )
244 {
245   ASSERT( myHomardYACS );
246   myHomardYACS->SetCaseName( NomCas );
247 }
248 //=============================================================================
249 char* HOMARD_YACS_i::GetCaseName()
250 {
251   ASSERT( myHomardYACS );
252   return CORBA::string_dup( myHomardYACS->GetCaseName().c_str() );
253 }
254 //=============================================================================
255 CORBA::Long HOMARD_YACS_i::Write()
256 {
257 //
258   char* nomYACS = GetName() ;
259   return _gen_i->YACSWrite(nomYACS) ;
260 }
261 //=============================================================================
262 CORBA::Long HOMARD_YACS_i::WriteOnFile( const char* XMLFile )
263 {
264   MESSAGE ( "WriteOnFile : ecriture du schema sur " << XMLFile );
265   ASSERT( myHomardYACS );
266 //
267 // Memorisation du fichier associe
268   SetXMLFile( XMLFile ) ;
269 //
270 // Nom du schema
271   char* nomYACS = GetName() ;
272   return _gen_i->YACSWriteOnFile(nomYACS, XMLFile) ;
273 }
274 //=============================================================================
275 //=============================================================================
276 //=============================================================================
277 // Divers
278 //=============================================================================
279 //=============================================================================