Salome HOME
Mise à jour de la documentation
[modules/homard.git] / src / HOMARD_I / HOMARD_YACS_i.cxx
1 // Copyright (C) 2011-2013  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 // Remarques :
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
25 //
26 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
27 //
28
29 #include "HOMARD_YACS_i.hxx"
30 #include "HOMARD_Gen_i.hxx"
31 #include "HOMARD_YACS.hxx"
32 #include "HOMARD_DriverTools.hxx"
33
34 #include "SALOMEDS_Tool.hxx"
35
36 #include "utilities.h"
37
38 //=============================================================================
39 /*!
40  *  standard constructor
41  */
42 //=============================================================================
43 HOMARD_YACS_i::HOMARD_YACS_i()
44 {
45   MESSAGE( "Default constructor, not for use" );
46   ASSERT( 0 );
47 }
48 //=============================================================================
49 /*!
50  *  standard constructor
51  */
52 //=============================================================================
53 HOMARD_YACS_i::HOMARD_YACS_i( CORBA::ORB_ptr orb,
54                                         HOMARD::HOMARD_Gen_var engine )
55 {
56   MESSAGE("constructor");
57   _gen_i = engine;
58   _orb = orb;
59   myHomardYACS = new ::HOMARD_YACS();
60   ASSERT( myHomardYACS );
61 }
62 //=============================================================================
63 /*!
64  *  standard destructor
65  */
66 //=============================================================================
67 HOMARD_YACS_i::~HOMARD_YACS_i()
68 {
69 }
70 //=============================================================================
71 //=============================================================================
72 // Generalites
73 //=============================================================================
74 //=============================================================================
75 void HOMARD_YACS_i::SetName( const char* Name )
76 {
77   ASSERT( myHomardYACS );
78   myHomardYACS->SetName( Name );
79 }
80 //=============================================================================
81 char* HOMARD_YACS_i::GetName()
82 {
83   ASSERT( myHomardYACS );
84   return CORBA::string_dup( myHomardYACS->GetName().c_str() );
85 }
86 //=============================================================================
87 CORBA::Long HOMARD_YACS_i::Delete( CORBA::Long Option )
88 {
89   ASSERT( myHomardYACS );
90   char* YACSName = GetName() ;
91   MESSAGE ( "Delete : destruction du schema " << YACSName << ", Option = " << Option );
92   return _gen_i->DeleteYACS(YACSName, Option) ;
93 }
94 //=============================================================================
95 char* HOMARD_YACS_i::GetDumpPython()
96 {
97   ASSERT( myHomardYACS );
98   return CORBA::string_dup( myHomardYACS->GetDumpPython().c_str() );
99 }
100 //=============================================================================
101 std::string HOMARD_YACS_i::Dump() const
102 {
103   return HOMARD::Dump( *myHomardYACS );
104 }
105 //=============================================================================
106 bool HOMARD_YACS_i::Restore( const std::string& stream )
107 {
108   return HOMARD::Restore( *myHomardYACS, stream );
109 }
110 //=============================================================================
111 //=============================================================================
112 // Caracteristiques
113 //=============================================================================
114 //=============================================================================
115 void HOMARD_YACS_i::SetType( CORBA::Long Type )
116 {
117   ASSERT( myHomardYACS );
118   myHomardYACS->SetType( Type );
119 }
120 //=============================================================================
121 CORBA::Long HOMARD_YACS_i::GetType()
122 {
123   ASSERT( myHomardYACS );
124   return  CORBA::Long( myHomardYACS->GetType() );
125 }
126 void HOMARD_YACS_i::SetDirName( const char* NomDir )
127 {
128   ASSERT( myHomardYACS );
129   myHomardYACS->SetDirName( NomDir );
130 }
131 //=============================================================================
132 char* HOMARD_YACS_i::GetDirName()
133 {
134   ASSERT( myHomardYACS );
135   return CORBA::string_dup( myHomardYACS->GetDirName().c_str() );
136 }
137 //=============================================================================
138 void HOMARD_YACS_i::SetMeshFile( const char* MeshFile )
139 {
140   ASSERT( myHomardYACS );
141   myHomardYACS->SetMeshFile( MeshFile );
142 }
143 //=============================================================================
144 char* HOMARD_YACS_i::GetMeshFile()
145 {
146   ASSERT( myHomardYACS );
147   return CORBA::string_dup( myHomardYACS->GetMeshFile().c_str() );
148 }
149 //=============================================================================
150 void HOMARD_YACS_i::SetScriptFile( const char* ScriptFile )
151 {
152   ASSERT( myHomardYACS );
153   myHomardYACS->SetScriptFile( ScriptFile );
154 }
155 //=============================================================================
156 char* HOMARD_YACS_i::GetScriptFile()
157 {
158   ASSERT( myHomardYACS );
159   return CORBA::string_dup( myHomardYACS->GetScriptFile().c_str() );
160 }
161 //=============================================================================
162 //=============================================================================
163 // Liens avec les autres structures
164 //=============================================================================
165 //=============================================================================
166 void HOMARD_YACS_i::SetCaseName( const char* NomCas )
167 {
168   ASSERT( myHomardYACS );
169   myHomardYACS->SetCaseName( NomCas );
170 }
171 //=============================================================================
172 char* HOMARD_YACS_i::GetCaseName()
173 {
174   ASSERT( myHomardYACS );
175   return CORBA::string_dup( myHomardYACS->GetCaseName().c_str() );
176 }
177 //=============================================================================
178 CORBA::Long HOMARD_YACS_i::Write()
179 {
180   MESSAGE ( "Write : ecriture du schema");
181 //
182   char* nomYACS = GetName() ;
183   return _gen_i->YACSWrite(nomYACS) ;
184 }
185 //=============================================================================
186 CORBA::Long HOMARD_YACS_i::WriteOnFile( const char* YACSFile )
187 {
188   MESSAGE ( "WriteOnFile : ecriture du schema sur " << YACSFile );
189   ASSERT( myHomardYACS );
190 //
191 // Nom du schema
192   char* nomYACS = GetName() ;
193   MESSAGE ( "WriteOnFile : ecriture du schema " << nomYACS);
194   return _gen_i->YACSWriteOnFile(nomYACS, YACSFile) ;
195 }
196 //=============================================================================
197 //=============================================================================
198 //=============================================================================
199 // Divers
200 //=============================================================================
201 //=============================================================================