1 // Copyright (C) 2011-2021 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, 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
20 #ifndef _SMESH_HOMARD_I_HXX_
21 #define _SMESH_HOMARD_I_HXX_
23 #include <SALOMEconfig.h>
24 #include CORBA_SERVER_HEADER(SMESH_Homard)
25 #include CORBA_CLIENT_HEADER(SALOMEDS)
26 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
27 #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
28 #include CORBA_CLIENT_HEADER(SMESH_Gen)
29 #include CORBA_CLIENT_HEADER(SMESH_Mesh)
32 #include "SMESH_Homard.hxx"
33 //#include "FrontTrack.hxx"
34 #include "SALOME_Component_i.hxx"
35 #include "SALOME_NamingService.hxx"
36 #include "Utils_CorbaException.hxx"
43 namespace SMESHHOMARD_I
46 class SMESH_I_EXPORT HOMARD_Boundary_i : public virtual SALOME::GenericObj_i,
47 public virtual POA_SMESHHOMARD::HOMARD_Boundary
50 HOMARD_Boundary_i(SMESHHOMARD::HOMARD_Gen_var gen_i);
53 virtual ~HOMARD_Boundary_i();
56 void SetName(const char* Name);
59 char* GetDumpPython();
62 void SetType(CORBA::Long Type);
63 CORBA::Long GetType();
65 void SetMeshName(const char* MeshName);
68 void SetDataFile(const char* DataFile);
71 void SetCylinder(double Xcentre, double Ycentre, double ZCentre,
72 double Xaxe, double Yaxe, double Zaxe,
74 void SetSphere(double Xcentre, double Ycentre, double ZCentre,
76 void SetConeR(double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1,
77 double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2);
78 void SetConeA(double Xaxe, double Yaxe, double Zaxe, double Angle,
79 double Xcentre, double Ycentre, double ZCentre);
80 void SetTorus(double Xcentre, double Ycentre, double ZCentre,
81 double Xaxe, double Yaxe, double Zaxe,
82 double rayonRev, double rayonPri);
84 SMESHHOMARD::double_array* GetCoords();
86 void SetLimit(double Xincr, double Yincr, double Zincr);
87 SMESHHOMARD::double_array* GetLimit();
89 void AddGroup(const char* Group);
90 void SetGroups(const SMESHHOMARD::ListGroupType& ListGroup);
91 SMESHHOMARD::ListGroupType* GetGroups();
93 // Liens avec les autres structures
94 void SetCaseCreation(const char* NomCaseCreation);
95 char* GetCaseCreation();
99 SMESHHOMARDImpl::HOMARD_Boundary* myHomardBoundary;
100 SMESHHOMARD::HOMARD_Gen_var _gen_i;
103 class SMESH_I_EXPORT HOMARD_Cas_i : public virtual SALOME::GenericObj_i,
104 public virtual POA_SMESHHOMARD::HOMARD_Cas
107 HOMARD_Cas_i(SMESHHOMARD::HOMARD_Gen_var gen_i);
110 virtual ~HOMARD_Cas_i();
113 char* GetDumpPython();
116 void SetDirName(const char* NomDir);
119 void SetBoundingBox(const SMESHHOMARD::extrema& LesExtremes);
120 SMESHHOMARD::extrema* GetBoundingBox();
122 void AddGroup(const char* Group);
123 void SetGroups(const SMESHHOMARD::ListGroupType& ListGroup);
124 SMESHHOMARD::ListGroupType* GetGroups();
126 void AddBoundary(const char* Boundary);
127 void AddBoundaryGroup(const char* Boundary, const char* Group);
128 SMESHHOMARD::ListBoundaryGroupType* GetBoundaryGroup();
129 void SupprBoundaryGroup();
131 void AddIteration(const char* NomIteration);
134 SMESHHOMARDImpl::HOMARD_Cas* myHomardCas;
135 SMESHHOMARD::HOMARD_Gen_var _gen_i;
138 class SMESH_I_EXPORT HOMARD_Iteration_i
141 HOMARD_Iteration_i(SMESHHOMARD::HOMARD_Gen_var gen_i);
142 HOMARD_Iteration_i();
144 virtual ~HOMARD_Iteration_i();
147 void SetName(const char* Name);
151 void SetDirNameLoc(const char* NomDir);
152 char* GetDirNameLoc();
156 void SetNumber(CORBA::Long NumIter);
157 CORBA::Long GetNumber();
159 void SetState(CORBA::Long etat);
160 CORBA::Long GetState();
162 void SetMeshName(const char* NomMesh);
165 void SetMeshFile(const char* MeshFile);
168 void SetLogFile(const char* LogFile);
171 void SetFileInfo(const char* FileInfo);
174 // Liens avec les autres structures
175 void SetCaseName(const char* NomCas);
179 void SetInfoCompute(CORBA::Long MessInfo);
180 CORBA::Long GetInfoCompute();
183 SMESHHOMARDImpl::HOMARD_Iteration* myHomardIteration;
184 SMESHHOMARD::HOMARD_Gen_var _gen_i;
187 class SMESH_I_EXPORT HOMARD_Gen_i : public virtual SALOME::GenericObj_i,
188 public virtual POA_SMESHHOMARD::HOMARD_Gen
192 virtual ~HOMARD_Gen_i();
195 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary,
196 CORBA::Long typeBoundary);
197 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryCAO (const char* nomBoundary,
198 const char* DataFile);
199 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary,
200 const char* MeshName, const char* DataFile);
201 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryCylinder
202 (const char* nomBoundary,
203 CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre,
204 CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis,
205 CORBA::Double Rayon);
206 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundarySphere
207 (const char* nomBoundary,
208 CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre,
209 CORBA::Double Rayon);
210 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryConeR
211 (const char* nomBoundary,
212 CORBA::Double Xcentre1, CORBA::Double Ycentre1, CORBA::Double Zcentre1,
213 CORBA::Double Rayon1,
214 CORBA::Double Xcentre2, CORBA::Double Ycentre2, CORBA::Double Zcentre2,
215 CORBA::Double Rayon2);
216 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryConeA
217 (const char* nomBoundary,
218 CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis,
220 CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre);
221 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryTorus
222 (const char* nomBoundary,
223 CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre,
224 CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis,
225 CORBA::Double RayonRev, CORBA::Double RayonPri);
227 SMESHHOMARD::HOMARD_Cas_ptr CreateCaseOnMesh (const char* MeshName,
228 SMESH::SMESH_Mesh_ptr smeshMesh,
229 const char* theWorkingDir);
230 SMESHHOMARD::HOMARD_Cas_ptr CreateCase (const char* MeshName,
231 const char* FileName,
232 const char* theWorkingDir);
234 HOMARD_Iteration_i* CreateIteration();
237 SMESHHOMARD::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary);
238 SMESHHOMARD::HOMARD_Cas_ptr GetCase ();
239 HOMARD_Iteration_i* GetIteration (CORBA::Long numIter);
241 SMESHHOMARD::listeBoundarys* GetAllBoundarysName();
243 void InvalideBoundary(const char* nomBoundary);
245 CORBA::Long DeleteBoundary(const char* nomBoundary);
246 CORBA::Long DeleteCase();
247 CORBA::Long DeleteIteration(int numIter);
249 void AddBoundaryGroup(const char* Boundary, const char* Group);
251 void AssociateCaseIter(int numIter, const char* labelIter);
252 char* CreateDirNameIter(const char* nomrep, CORBA::Long num);
254 CORBA::Long Compute();
255 CORBA::Long ComputeAdap(SMESHHOMARDImpl::HomardDriver* myDriver);
256 CORBA::Long ComputeCAO();
257 CORBA::Long ComputeCAObis();
258 char* ComputeDirManagement();
259 char* ComputeDirPaManagement();
260 int DriverTexteBoundary(SMESHHOMARDImpl::HomardDriver* myDriver);
262 void PublishResultInSmesh(const char* NomFich, CORBA::Long Option);
263 void DeleteResultInSmesh(std::string NomFich, std::string MeshName);
268 void SetConfType (CORBA::Long theConfType);
269 void SetKeepMedOUT (bool theKeepMedOUT);
270 void SetPublishMeshOUT (bool thePublishMeshOUT);
271 void SetMeshNameOUT (const char* theMeshNameOUT);
272 void SetMeshFileOUT (const char* theMeshFileOUT);
274 void SetVerboseLevel (CORBA::Long theVerboseLevel);
275 void SetKeepWorkingFiles(bool theKeepWorkingFiles);
276 void SetLogInFile(bool theLogInFile);
277 void SetLogFile (const char* theLogFile);
278 void SetRemoveLogOnSuccess(bool theRemoveLogOnSuccess);
281 SMESHHOMARD::HOMARD_Boundary_ptr newBoundary();
282 SMESHHOMARD::HOMARD_Cas_ptr newCase();
283 HOMARD_Iteration_i* newIteration();
287 SMESHHOMARDImpl::HOMARD_Gen* myHomard;
288 HOMARD_Iteration_i* myIteration0;
289 HOMARD_Iteration_i* myIteration1;
290 SMESHHOMARD::HOMARD_Cas_var myCase;
291 std::map<std::string, SMESHHOMARD::HOMARD_Boundary_var> _mesBoundarys;
294 int _ConfType; // Le type de conformite ou non conformite
296 bool _PublishMeshOUT;
297 bool _KeepWorkingFiles;
299 bool _RemoveLogOnSuccess;
301 std::string _MeshNameOUT;
302 std::string _MeshFileOUT;
303 std::string _LogFile;
307 SMESH::SMESH_Mesh_var _SmeshMesh;
308 std::string _TmpMeshFile;
311 SMESH_I_EXPORT std::vector<double> GetBoundingBoxInMedFile(const char * aFile);
312 SMESH_I_EXPORT std::set<std::string> GetListeGroupesInMedFile(const char * aFile);
314 }; // namespace SMESHHOMARD_I