1 // Copyright (C) 2011-2013 CEA/DEN, EDF R&D
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.
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
20 // L'ordre de description des fonctions est le meme dans tous les fichiers
21 // HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
22 // 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
23 // 2. Les caracteristiques
24 // 3. Le lien avec les autres structures
26 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
29 #include "HOMARD_YACS_i.hxx"
30 #include "HOMARD_Gen_i.hxx"
31 #include "HOMARD_YACS.hxx"
32 #include "HOMARD_DriverTools.hxx"
34 #include "SALOMEDS_Tool.hxx"
36 #include "utilities.h"
38 //=============================================================================
40 * standard constructor
42 //=============================================================================
43 HOMARD_YACS_i::HOMARD_YACS_i()
45 MESSAGE( "Default constructor, not for use" );
48 //=============================================================================
50 * standard constructor
52 //=============================================================================
53 HOMARD_YACS_i::HOMARD_YACS_i( CORBA::ORB_ptr orb,
54 HOMARD::HOMARD_Gen_var engine )
56 MESSAGE("constructor");
59 myHomardYACS = new ::HOMARD_YACS();
60 ASSERT( myHomardYACS );
62 //=============================================================================
66 //=============================================================================
67 HOMARD_YACS_i::~HOMARD_YACS_i()
70 //=============================================================================
71 //=============================================================================
73 //=============================================================================
74 //=============================================================================
75 void HOMARD_YACS_i::SetName( const char* Name )
77 ASSERT( myHomardYACS );
78 myHomardYACS->SetName( Name );
80 //=============================================================================
81 char* HOMARD_YACS_i::GetName()
83 ASSERT( myHomardYACS );
84 return CORBA::string_dup( myHomardYACS->GetName().c_str() );
86 //=============================================================================
87 CORBA::Long HOMARD_YACS_i::Delete( CORBA::Long Option )
89 ASSERT( myHomardYACS );
90 char* YACSName = GetName() ;
91 MESSAGE ( "Delete : destruction du schema " << YACSName << ", Option = " << Option );
92 return _gen_i->DeleteYACS(YACSName, Option) ;
94 //=============================================================================
95 char* HOMARD_YACS_i::GetDumpPython()
97 ASSERT( myHomardYACS );
98 return CORBA::string_dup( myHomardYACS->GetDumpPython().c_str() );
100 //=============================================================================
101 std::string HOMARD_YACS_i::Dump() const
103 return HOMARD::Dump( *myHomardYACS );
105 //=============================================================================
106 bool HOMARD_YACS_i::Restore( const std::string& stream )
108 return HOMARD::Restore( *myHomardYACS, stream );
110 //=============================================================================
111 //=============================================================================
113 //=============================================================================
114 //=============================================================================
115 void HOMARD_YACS_i::SetType( CORBA::Long Type )
117 ASSERT( myHomardYACS );
118 myHomardYACS->SetType( Type );
120 //=============================================================================
121 CORBA::Long HOMARD_YACS_i::GetType()
123 ASSERT( myHomardYACS );
124 return CORBA::Long( myHomardYACS->GetType() );
126 //=============================================================================
127 //=============================================================================
128 // Caracteristiques de la convergence
129 //=============================================================================
130 //=============================================================================
131 void HOMARD_YACS_i::SetMaxIter( CORBA::Long MaxIter )
133 ASSERT( myHomardYACS );
134 myHomardYACS->SetMaxIter( MaxIter );
136 //=============================================================================
137 CORBA::Long HOMARD_YACS_i::GetMaxIter()
139 ASSERT( myHomardYACS );
140 return CORBA::Long( myHomardYACS->GetMaxIter() );
142 //=============================================================================
143 void HOMARD_YACS_i::SetMaxNode( CORBA::Long MaxNode )
145 ASSERT( myHomardYACS );
146 myHomardYACS->SetMaxNode( MaxNode );
148 //=============================================================================
149 CORBA::Long HOMARD_YACS_i::GetMaxNode()
151 ASSERT( myHomardYACS );
152 return CORBA::Long( myHomardYACS->GetMaxNode() );
154 //=============================================================================
155 void HOMARD_YACS_i::SetMaxElem( CORBA::Long MaxElem )
157 ASSERT( myHomardYACS );
158 myHomardYACS->SetMaxElem( MaxElem );
160 //=============================================================================
161 CORBA::Long HOMARD_YACS_i::GetMaxElem()
163 ASSERT( myHomardYACS );
164 return CORBA::Long( myHomardYACS->GetMaxElem() );
166 //=============================================================================
167 void HOMARD_YACS_i::SetTestConvergence( CORBA::Long TypeTest, CORBA::Double VRef)
169 ASSERT( myHomardYACS );
170 myHomardYACS->SetTestConvergence( TypeTest, VRef );
172 //=============================================================================
173 CORBA::Long HOMARD_YACS_i::GetTestConvergenceType()
175 ASSERT( myHomardYACS );
176 return CORBA::Long( myHomardYACS->GetTestConvergenceType() );
178 //=============================================================================
179 CORBA::Double HOMARD_YACS_i::GetTestConvergenceVRef()
181 ASSERT( myHomardYACS );
182 return CORBA::Long( myHomardYACS->GetTestConvergenceVRef() );
184 //=============================================================================
185 //=============================================================================
186 // Repertoire et fichiers
187 //=============================================================================
188 //=============================================================================
189 void HOMARD_YACS_i::SetDirName( const char* NomDir )
191 ASSERT( myHomardYACS );
192 myHomardYACS->SetDirName( NomDir );
194 //=============================================================================
195 char* HOMARD_YACS_i::GetDirName()
197 ASSERT( myHomardYACS );
198 return CORBA::string_dup( myHomardYACS->GetDirName().c_str() );
200 //=============================================================================
201 void HOMARD_YACS_i::SetMeshFile( const char* MeshFile )
203 ASSERT( myHomardYACS );
204 myHomardYACS->SetMeshFile( MeshFile );
206 //=============================================================================
207 char* HOMARD_YACS_i::GetMeshFile()
209 ASSERT( myHomardYACS );
210 return CORBA::string_dup( myHomardYACS->GetMeshFile().c_str() );
212 //=============================================================================
213 void HOMARD_YACS_i::SetScriptFile( const char* ScriptFile )
215 ASSERT( myHomardYACS );
216 myHomardYACS->SetScriptFile( ScriptFile );
218 //=============================================================================
219 char* HOMARD_YACS_i::GetScriptFile()
221 ASSERT( myHomardYACS );
222 return CORBA::string_dup( myHomardYACS->GetScriptFile().c_str() );
224 //=============================================================================
225 void HOMARD_YACS_i::SetXMLFile( const char* XMLFile )
227 ASSERT( myHomardYACS );
228 MESSAGE ( "SetXMLFile : SetXMLFile = " << XMLFile );
229 myHomardYACS->SetXMLFile( XMLFile );
231 //=============================================================================
232 char* HOMARD_YACS_i::GetXMLFile()
234 ASSERT( myHomardYACS );
235 return CORBA::string_dup( myHomardYACS->GetXMLFile().c_str() );
237 //=============================================================================
238 //=============================================================================
239 // Liens avec les autres structures
240 //=============================================================================
241 //=============================================================================
242 void HOMARD_YACS_i::SetCaseName( const char* NomCas )
244 ASSERT( myHomardYACS );
245 myHomardYACS->SetCaseName( NomCas );
247 //=============================================================================
248 char* HOMARD_YACS_i::GetCaseName()
250 ASSERT( myHomardYACS );
251 return CORBA::string_dup( myHomardYACS->GetCaseName().c_str() );
253 //=============================================================================
254 CORBA::Long HOMARD_YACS_i::Write()
257 char* nomYACS = GetName() ;
258 return _gen_i->YACSWrite(nomYACS) ;
260 //=============================================================================
261 CORBA::Long HOMARD_YACS_i::WriteOnFile( const char* XMLFile )
263 MESSAGE ( "WriteOnFile : ecriture du schema sur " << XMLFile );
264 ASSERT( myHomardYACS );
266 // Memorisation du fichier associe
267 SetXMLFile( XMLFile ) ;
270 char* nomYACS = GetName() ;
271 return _gen_i->YACSWriteOnFile(nomYACS, XMLFile) ;
273 //=============================================================================
274 //=============================================================================
275 //=============================================================================
277 //=============================================================================
278 //=============================================================================