1 // Copyright (C) 2011-2023 CEA, EDF
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
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
27 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
30 #include "HOMARD_YACS_i.hxx"
31 #include "HOMARD_Gen_i.hxx"
32 #include "HOMARD_YACS.hxx"
33 #include "HOMARD_DriverTools.hxx"
35 #include "SALOMEDS_Tool.hxx"
37 #include "utilities.h"
39 //=============================================================================
41 * standard constructor
43 //=============================================================================
44 HOMARD_YACS_i::HOMARD_YACS_i()
46 MESSAGE( "Default constructor, not for use" );
49 //=============================================================================
51 * standard constructor
53 //=============================================================================
54 HOMARD_YACS_i::HOMARD_YACS_i( CORBA::ORB_ptr orb,
55 HOMARD::HOMARD_Gen_var engine )
57 MESSAGE("constructor");
60 myHomardYACS = new ::HOMARD_YACS();
61 ASSERT( myHomardYACS );
63 //=============================================================================
67 //=============================================================================
68 HOMARD_YACS_i::~HOMARD_YACS_i()
71 //=============================================================================
72 //=============================================================================
74 //=============================================================================
75 //=============================================================================
76 void HOMARD_YACS_i::SetName( const char* Name )
78 ASSERT( myHomardYACS );
79 myHomardYACS->SetName( Name );
81 //=============================================================================
82 char* HOMARD_YACS_i::GetName()
84 ASSERT( myHomardYACS );
85 return CORBA::string_dup( myHomardYACS->GetName().c_str() );
87 //=============================================================================
88 CORBA::Long HOMARD_YACS_i::Delete( CORBA::Long Option )
90 ASSERT( myHomardYACS );
91 char* YACSName = GetName() ;
92 MESSAGE ( "Delete : destruction du schema " << YACSName << ", Option = " << Option );
93 return _gen_i->DeleteYACS(YACSName, Option) ;
95 //=============================================================================
96 char* HOMARD_YACS_i::GetDumpPython()
98 ASSERT( myHomardYACS );
99 return CORBA::string_dup( myHomardYACS->GetDumpPython().c_str() );
101 //=============================================================================
102 std::string HOMARD_YACS_i::Dump() const
104 return HOMARD::Dump( *myHomardYACS );
106 //=============================================================================
107 bool HOMARD_YACS_i::Restore( const std::string& stream )
109 return HOMARD::Restore( *myHomardYACS, stream );
111 //=============================================================================
112 //=============================================================================
114 //=============================================================================
115 //=============================================================================
116 void HOMARD_YACS_i::SetType( CORBA::Long Type )
118 ASSERT( myHomardYACS );
119 myHomardYACS->SetType( Type );
121 //=============================================================================
122 CORBA::Long HOMARD_YACS_i::GetType()
124 ASSERT( myHomardYACS );
125 return CORBA::Long( myHomardYACS->GetType() );
127 //=============================================================================
128 //=============================================================================
129 // Caracteristiques de la convergence
130 //=============================================================================
131 //=============================================================================
132 void HOMARD_YACS_i::SetMaxIter( CORBA::Long MaxIter )
134 ASSERT( myHomardYACS );
135 myHomardYACS->SetMaxIter( MaxIter );
137 //=============================================================================
138 CORBA::Long HOMARD_YACS_i::GetMaxIter()
140 ASSERT( myHomardYACS );
141 return CORBA::Long( myHomardYACS->GetMaxIter() );
143 //=============================================================================
144 void HOMARD_YACS_i::SetMaxNode( CORBA::Long MaxNode )
146 ASSERT( myHomardYACS );
147 myHomardYACS->SetMaxNode( MaxNode );
149 //=============================================================================
150 CORBA::Long HOMARD_YACS_i::GetMaxNode()
152 ASSERT( myHomardYACS );
153 return CORBA::Long( myHomardYACS->GetMaxNode() );
155 //=============================================================================
156 void HOMARD_YACS_i::SetMaxElem( CORBA::Long MaxElem )
158 ASSERT( myHomardYACS );
159 myHomardYACS->SetMaxElem( MaxElem );
161 //=============================================================================
162 CORBA::Long HOMARD_YACS_i::GetMaxElem()
164 ASSERT( myHomardYACS );
165 return CORBA::Long( myHomardYACS->GetMaxElem() );
167 //=============================================================================
168 void HOMARD_YACS_i::SetTestConvergence( CORBA::Long TypeTest, CORBA::Double VRef)
170 ASSERT( myHomardYACS );
171 myHomardYACS->SetTestConvergence( TypeTest, VRef );
173 //=============================================================================
174 CORBA::Long HOMARD_YACS_i::GetTestConvergenceType()
176 ASSERT( myHomardYACS );
177 return CORBA::Long( myHomardYACS->GetTestConvergenceType() );
179 //=============================================================================
180 CORBA::Double HOMARD_YACS_i::GetTestConvergenceVRef()
182 ASSERT( myHomardYACS );
183 return CORBA::Long( myHomardYACS->GetTestConvergenceVRef() );
185 //=============================================================================
186 //=============================================================================
187 // Repertoire et fichiers
188 //=============================================================================
189 //=============================================================================
190 void HOMARD_YACS_i::SetDirName( const char* NomDir )
192 ASSERT( myHomardYACS );
193 myHomardYACS->SetDirName( NomDir );
195 //=============================================================================
196 char* HOMARD_YACS_i::GetDirName()
198 ASSERT( myHomardYACS );
199 return CORBA::string_dup( myHomardYACS->GetDirName().c_str() );
201 //=============================================================================
202 void HOMARD_YACS_i::SetMeshFile( const char* MeshFile )
204 ASSERT( myHomardYACS );
205 myHomardYACS->SetMeshFile( MeshFile );
207 //=============================================================================
208 char* HOMARD_YACS_i::GetMeshFile()
210 ASSERT( myHomardYACS );
211 return CORBA::string_dup( myHomardYACS->GetMeshFile().c_str() );
213 //=============================================================================
214 void HOMARD_YACS_i::SetScriptFile( const char* ScriptFile )
216 ASSERT( myHomardYACS );
217 myHomardYACS->SetScriptFile( ScriptFile );
219 //=============================================================================
220 char* HOMARD_YACS_i::GetScriptFile()
222 ASSERT( myHomardYACS );
223 return CORBA::string_dup( myHomardYACS->GetScriptFile().c_str() );
225 //=============================================================================
226 void HOMARD_YACS_i::SetXMLFile( const char* XMLFile )
228 ASSERT( myHomardYACS );
229 MESSAGE ( "SetXMLFile : SetXMLFile = " << XMLFile );
230 myHomardYACS->SetXMLFile( XMLFile );
232 //=============================================================================
233 char* HOMARD_YACS_i::GetXMLFile()
235 ASSERT( myHomardYACS );
236 return CORBA::string_dup( myHomardYACS->GetXMLFile().c_str() );
238 //=============================================================================
239 //=============================================================================
240 // Liens avec les autres structures
241 //=============================================================================
242 //=============================================================================
243 void HOMARD_YACS_i::SetCaseName( const char* NomCas )
245 ASSERT( myHomardYACS );
246 myHomardYACS->SetCaseName( NomCas );
248 //=============================================================================
249 char* HOMARD_YACS_i::GetCaseName()
251 ASSERT( myHomardYACS );
252 return CORBA::string_dup( myHomardYACS->GetCaseName().c_str() );
254 //=============================================================================
255 CORBA::Long HOMARD_YACS_i::Write()
258 char* nomYACS = GetName() ;
259 return _gen_i->YACSWrite(nomYACS) ;
261 //=============================================================================
262 CORBA::Long HOMARD_YACS_i::WriteOnFile( const char* XMLFile )
264 MESSAGE ( "WriteOnFile : ecriture du schema sur " << XMLFile );
265 ASSERT( myHomardYACS );
267 // Memorisation du fichier associe
268 SetXMLFile( XMLFile ) ;
271 char* nomYACS = GetName() ;
272 return _gen_i->YACSWriteOnFile(nomYACS, XMLFile) ;
274 //=============================================================================
275 //=============================================================================
276 //=============================================================================
278 //=============================================================================
279 //=============================================================================