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 void HOMARD_YACS_i::SetMaxIter( CORBA::Long MaxIter )
129 ASSERT( myHomardYACS );
130 myHomardYACS->SetMaxIter( MaxIter );
132 //=============================================================================
133 CORBA::Long HOMARD_YACS_i::GetMaxIter()
135 ASSERT( myHomardYACS );
136 return CORBA::Long( myHomardYACS->GetMaxIter() );
138 //=============================================================================
139 void HOMARD_YACS_i::SetMaxNode( CORBA::Long MaxNode )
141 ASSERT( myHomardYACS );
142 myHomardYACS->SetMaxNode( MaxNode );
144 //=============================================================================
145 CORBA::Long HOMARD_YACS_i::GetMaxNode()
147 ASSERT( myHomardYACS );
148 return CORBA::Long( myHomardYACS->GetMaxNode() );
150 //=============================================================================
151 void HOMARD_YACS_i::SetMaxElem( CORBA::Long MaxElem )
153 ASSERT( myHomardYACS );
154 myHomardYACS->SetMaxElem( MaxElem );
156 //=============================================================================
157 CORBA::Long HOMARD_YACS_i::GetMaxElem()
159 ASSERT( myHomardYACS );
160 return CORBA::Long( myHomardYACS->GetMaxElem() );
162 //=============================================================================
163 void HOMARD_YACS_i::SetDirName( const char* NomDir )
165 ASSERT( myHomardYACS );
166 myHomardYACS->SetDirName( NomDir );
168 //=============================================================================
169 char* HOMARD_YACS_i::GetDirName()
171 ASSERT( myHomardYACS );
172 return CORBA::string_dup( myHomardYACS->GetDirName().c_str() );
174 //=============================================================================
175 void HOMARD_YACS_i::SetMeshFile( const char* MeshFile )
177 ASSERT( myHomardYACS );
178 myHomardYACS->SetMeshFile( MeshFile );
180 //=============================================================================
181 char* HOMARD_YACS_i::GetMeshFile()
183 ASSERT( myHomardYACS );
184 return CORBA::string_dup( myHomardYACS->GetMeshFile().c_str() );
186 //=============================================================================
187 void HOMARD_YACS_i::SetScriptFile( const char* ScriptFile )
189 ASSERT( myHomardYACS );
190 myHomardYACS->SetScriptFile( ScriptFile );
192 //=============================================================================
193 char* HOMARD_YACS_i::GetScriptFile()
195 ASSERT( myHomardYACS );
196 return CORBA::string_dup( myHomardYACS->GetScriptFile().c_str() );
198 //=============================================================================
199 void HOMARD_YACS_i::SetXMLFile( const char* XMLFile )
201 ASSERT( myHomardYACS );
202 MESSAGE ( "SetXMLFile : SetXMLFile = " << XMLFile );
203 myHomardYACS->SetXMLFile( XMLFile );
205 //=============================================================================
206 char* HOMARD_YACS_i::GetXMLFile()
208 ASSERT( myHomardYACS );
209 return CORBA::string_dup( myHomardYACS->GetXMLFile().c_str() );
211 //=============================================================================
212 //=============================================================================
213 // Liens avec les autres structures
214 //=============================================================================
215 //=============================================================================
216 void HOMARD_YACS_i::SetCaseName( const char* NomCas )
218 ASSERT( myHomardYACS );
219 myHomardYACS->SetCaseName( NomCas );
221 //=============================================================================
222 char* HOMARD_YACS_i::GetCaseName()
224 ASSERT( myHomardYACS );
225 return CORBA::string_dup( myHomardYACS->GetCaseName().c_str() );
227 //=============================================================================
228 CORBA::Long HOMARD_YACS_i::Write()
231 char* nomYACS = GetName() ;
232 return _gen_i->YACSWrite(nomYACS) ;
234 //=============================================================================
235 CORBA::Long HOMARD_YACS_i::WriteOnFile( const char* XMLFile )
237 MESSAGE ( "WriteOnFile : ecriture du schema sur " << XMLFile );
238 ASSERT( myHomardYACS );
240 // Memorisation du fichier associe
241 SetXMLFile( XMLFile ) ;
244 char* nomYACS = GetName() ;
245 return _gen_i->YACSWriteOnFile(nomYACS, XMLFile) ;
247 //=============================================================================
248 //=============================================================================
249 //=============================================================================
251 //=============================================================================
252 //=============================================================================