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
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 #ifndef _SMESH_HOMARD_I_HXX_
31 #define _SMESH_HOMARD_I_HXX_
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_Homard)
35 #include CORBA_CLIENT_HEADER(SALOMEDS)
36 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
37 #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
38 #include CORBA_CLIENT_HEADER(SMESH_Gen)
41 #include "SMESH_Homard.hxx"
42 //#include "FrontTrack.hxx"
43 #include "SALOME_Component_i.hxx"
44 #include "SALOME_NamingService.hxx"
45 #include "Utils_CorbaException.hxx"
52 //namespace SMESHHOMARDImpl
54 // class HOMARD_Boundary;
56 // class HOMARD_Hypothesis;
57 // class HOMARD_Iteration;
60 namespace SMESHHOMARD_I
63 class SMESH_I_EXPORT HOMARD_Boundary_i:
64 public virtual Engines_Component_i,
65 public virtual POA_SMESHHOMARD::HOMARD_Boundary,
66 public virtual PortableServer::ServantBase
69 HOMARD_Boundary_i( CORBA::ORB_ptr orb, SMESHHOMARD::HOMARD_Gen_var gen_i );
72 virtual ~HOMARD_Boundary_i();
75 void SetName( const char* Name );
80 char* GetDumpPython();
82 std::string Dump() const;
83 bool Restore( const std::string& stream );
86 void SetType( CORBA::Long Type );
87 CORBA::Long GetType();
89 void SetMeshName( const char* MeshName );
92 void SetDataFile( const char* DataFile );
95 void SetCylinder( double Xcentre, double Ycentre, double ZCentre,
96 double Xaxe, double Yaxe, double Zaxe,
98 void SetSphere( double Xcentre, double Ycentre, double ZCentre,
100 void SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1,
101 double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2);
102 void SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle,
103 double Xcentre, double Ycentre, double ZCentre);
104 void SetTorus( double Xcentre, double Ycentre, double ZCentre,
105 double Xaxe, double Yaxe, double Zaxe,
106 double rayonRev, double rayonPri );
108 SMESHHOMARD::double_array* GetCoords();
110 void SetLimit( double Xincr, double Yincr, double Zincr);
111 SMESHHOMARD::double_array* GetLimit();
113 void AddGroup( const char* Group);
114 void SetGroups(const SMESHHOMARD::ListGroupType& ListGroup);
115 SMESHHOMARD::ListGroupType* GetGroups();
117 // Liens avec les autres structures
118 void SetCaseCreation( const char* NomCaseCreation );
119 char* GetCaseCreation();
123 SMESHHOMARDImpl::HOMARD_Boundary* myHomardBoundary;
126 SMESHHOMARD::HOMARD_Gen_var _gen_i;
129 class SMESH_I_EXPORT HOMARD_Cas_i:
130 public virtual Engines_Component_i,
131 public virtual POA_SMESHHOMARD::HOMARD_Cas,
132 public virtual PortableServer::ServantBase
135 HOMARD_Cas_i( CORBA::ORB_ptr orb, SMESHHOMARD::HOMARD_Gen_var gen_i );
138 virtual ~HOMARD_Cas_i();
141 void SetName( const char* Name );
144 CORBA::Long Delete( CORBA::Long Option );
146 char* GetDumpPython();
148 std::string Dump() const;
149 bool Restore( const std::string& stream );
152 void SetDirName( const char* NomDir );
155 CORBA::Long GetState();
157 CORBA::Long GetNumberofIter();
159 void SetConfType( CORBA::Long ConfType );
160 CORBA::Long GetConfType();
162 void SetExtType( CORBA::Long ExtType );
163 CORBA::Long GetExtType();
165 void SetBoundingBox( const SMESHHOMARD::extrema& LesExtremes );
166 SMESHHOMARD::extrema* GetBoundingBox();
168 void AddGroup( const char* Group);
169 void SetGroups(const SMESHHOMARD::ListGroupType& ListGroup);
170 SMESHHOMARD::ListGroupType* GetGroups();
172 void AddBoundary(const char* Boundary);
173 void AddBoundaryGroup(const char* Boundary, const char* Group);
174 SMESHHOMARD::ListBoundaryGroupType* GetBoundaryGroup();
175 void SupprBoundaryGroup( );
177 void SetPyram( CORBA::Long Pyram );
178 CORBA::Long GetPyram();
180 void MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte);
182 // Liens avec les autres structures
183 char* GetIter0Name();
184 SMESHHOMARD::HOMARD_Iteration_ptr GetIter0();
186 SMESHHOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name );
188 SMESHHOMARD::HOMARD_Iteration_ptr LastIteration();
190 void AddIteration( const char* NomIteration );
193 SMESHHOMARDImpl::HOMARD_Cas* myHomardCas;
196 SMESHHOMARD::HOMARD_Gen_var _gen_i;
199 class SMESH_I_EXPORT HOMARD_Hypothesis_i:
200 public virtual Engines_Component_i,
201 public virtual POA_SMESHHOMARD::HOMARD_Hypothesis,
202 public virtual PortableServer::ServantBase
205 HOMARD_Hypothesis_i( CORBA::ORB_ptr orb, SMESHHOMARD::HOMARD_Gen_var gen_i );
206 HOMARD_Hypothesis_i();
208 virtual ~HOMARD_Hypothesis_i();
211 void SetName( const char* Name );
214 CORBA::Long Delete();
216 char* GetDumpPython();
218 std::string Dump() const;
219 bool Restore( const std::string& stream );
222 void SetUnifRefinUnRef( CORBA::Long TypeRaffDera );
223 SMESHHOMARD::listeTypes* GetAdapRefinUnRef();
224 CORBA::Long GetAdapType();
225 CORBA::Long GetRefinType();
226 CORBA::Long GetUnRefType();
228 void SetField( const char* FieldName );
229 char* GetFieldName();
230 void SetUseField(CORBA::Long UsField);
231 SMESHHOMARD::InfosHypo* GetField();
233 void SetUseComp(CORBA::Long UsCmpI);
234 void AddComp( const char* NomComp );
235 void SupprComp( const char* NomComp );
237 SMESHHOMARD::listeComposantsHypo* GetComps();
239 void SetRefinThr(CORBA::Long TypeThR, CORBA::Double ThreshR);
240 CORBA::Long GetRefinThrType();
241 void SetUnRefThr(CORBA::Long TypeThC, CORBA::Double ThreshC);
242 CORBA::Long GetUnRefThrType();
244 void SetNivMax( CORBA::Long NivMax );
245 CORBA::Long GetNivMax();
247 void SetDiamMin( CORBA::Double DiamMin );
248 CORBA::Double GetDiamMin();
250 void SetAdapInit( CORBA::Long AdapInit );
251 CORBA::Long GetAdapInit();
253 void SetExtraOutput( CORBA::Long ExtraOutput );
254 CORBA::Long GetExtraOutput();
256 void AddGroup( const char* Group);
257 void SupprGroup( const char* Group );
259 void SetGroups(const SMESHHOMARD::ListGroupType& ListGroup);
260 SMESHHOMARD::ListGroupType* GetGroups();
262 void SetTypeFieldInterp( CORBA::Long TypeFieldInterp );
263 CORBA::Long GetTypeFieldInterp();
264 void AddFieldInterp( const char* FieldInterp );
265 void AddFieldInterpType( const char* FieldInterp, CORBA::Long TypeInterp );
266 void SupprFieldInterp( const char* FieldInterp );
267 void SupprFieldInterps();
268 SMESHHOMARD::listeFieldInterpsHypo* GetFieldInterps();
270 // Liens avec les autres structures
271 void SetCaseCreation( const char* NomCaseCreation );
272 char* GetCaseCreation();
274 void LinkIteration( const char* NomIteration );
275 void UnLinkIteration( const char* NomIteration );
276 SMESHHOMARD::listeIters* GetIterations();
279 SMESHHOMARDImpl::HOMARD_Hypothesis* myHomardHypothesis;
282 SMESHHOMARD::HOMARD_Gen_var _gen_i;
285 class SMESH_I_EXPORT HOMARD_Iteration_i:
286 public virtual Engines_Component_i,
287 public virtual POA_SMESHHOMARD::HOMARD_Iteration,
288 public virtual PortableServer::ServantBase
291 HOMARD_Iteration_i( CORBA::ORB_ptr orb,
292 SMESHHOMARD::HOMARD_Gen_var gen_i );
293 HOMARD_Iteration_i();
295 virtual ~HOMARD_Iteration_i();
298 void SetName( const char* Name );
301 CORBA::Long Delete( CORBA::Long Option, bool doRemoveWorkingFiles );
303 char* GetDumpPython();
305 std::string Dump() const;
306 bool Restore( const std::string& stream );
309 void SetDirNameLoc( const char* NomDir );
310 char* GetDirNameLoc();
314 void SetNumber( CORBA::Long NumIter );
315 CORBA::Long GetNumber();
317 void SetState( CORBA::Long etat );
318 CORBA::Long GetState();
320 void SetMeshName( const char* NomMesh );
323 void SetMeshFile( const char* MeshFile );
326 void SetFieldFile( const char* FieldFile );
327 char* GetFieldFile();
328 // Instants pour le champ de pilotage
329 void SetTimeStep( CORBA::Long TimeStep );
330 void SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank );
331 void SetTimeStepRankLast();
332 CORBA::Long GetTimeStep();
333 CORBA::Long GetRank();
334 // Instants pour un champ a interpoler
335 void SetFieldInterpTimeStep( const char* FieldInterp, CORBA::Long TimeStep );
336 void SetFieldInterpTimeStepRank( const char* FieldInterp, CORBA::Long TimeStep, CORBA::Long Rank );
337 SMESHHOMARD::listeFieldInterpTSRsIter* GetFieldInterpsTimeStepRank();
338 void SetFieldInterp( const char* FieldInterp );
339 SMESHHOMARD::listeFieldInterpsIter* GetFieldInterps();
340 void SupprFieldInterps();
342 void SetLogFile( const char* LogFile );
345 CORBA::Long Compute(CORBA::Long etatMenage, CORBA::Long Option);
347 void MeshInfo(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte);
349 void MeshInfoOption(CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte, CORBA::Long Option);
351 void SetFileInfo( const char* FileInfo );
354 // Liens avec les autres iterations
355 SMESHHOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name);
357 void LinkNextIteration( const char* NomIteration );
358 void UnLinkNextIteration( const char* NomIteration );
359 SMESHHOMARD::listeIterFilles* GetIterations();
361 void SetIterParentName( const char* NomIterParent );
362 char* GetIterParentName();
363 SMESHHOMARD::HOMARD_Iteration_ptr GetIterParent();
365 // Liens avec les autres structures
366 void SetCaseName( const char* NomCas );
369 void AssociateHypo( const char* NomHypo);
370 void SetHypoName( const char* NomHypo );
374 void SetInfoCompute( CORBA::Long MessInfo );
375 CORBA::Long GetInfoCompute();
378 SMESHHOMARDImpl::HOMARD_Iteration* myHomardIteration;
381 SMESHHOMARD::HOMARD_Gen_var _gen_i;
384 class SMESH_I_EXPORT HOMARD_Gen_i : public virtual SALOME::GenericObj_i,
385 public virtual POA_SMESHHOMARD::HOMARD_Gen
389 virtual ~HOMARD_Gen_i();
395 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary);
396 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryCAO(const char* nomBoundary,
397 const char* DataFile);
398 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary,
399 const char* MeshName, const char* DataFile);
400 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryCylinder (const char* nomBoundary,
401 CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre,
402 CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis,
403 CORBA::Double Rayon);
404 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundarySphere (const char* nomBoundary,
405 CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre,
406 CORBA::Double Rayon);
407 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryConeR (const char* nomBoundary,
408 CORBA::Double Xcentre1, CORBA::Double Ycentre1, CORBA::Double Zcentre1, CORBA::Double Rayon1,
409 CORBA::Double Xcentre2, CORBA::Double Ycentre2, CORBA::Double Zcentre2, CORBA::Double Rayon2);
410 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryConeA (const char* nomBoundary,
411 CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, CORBA::Double Angle,
412 CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre);
413 SMESHHOMARD::HOMARD_Boundary_ptr CreateBoundaryTorus (const char* nomBoundary,
414 CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre,
415 CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis,
416 CORBA::Double RayonRev, CORBA::Double RayonPri);
418 SMESHHOMARD::HOMARD_Cas_ptr CreateCase (const char* nomCas, const char* MeshName,
419 const char* FileName);
420 SMESHHOMARD::HOMARD_Cas_ptr CreateCase0 (const char* nomCas, const char* MeshName,
421 const char* FileName, CORBA::Long MeshOption,
422 CORBA::Long NumeIter, CORBA::Long Option);
423 std::string CreateCase1 (const char* DirNameStart, CORBA::Long Number);
425 SMESHHOMARD::HOMARD_Hypothesis_ptr CreateHypothesis(const char* nomHypothesis);
427 SMESHHOMARD::HOMARD_Iteration_ptr CreateIteration (const char* nomIter, const char* nomIterParent);
430 SMESHHOMARD::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary);
431 SMESHHOMARD::HOMARD_Cas_ptr GetCase (const char* nomCas);
432 SMESHHOMARD::HOMARD_Hypothesis_ptr GetHypothesis (const char* nomHypothesis);
433 SMESHHOMARD::HOMARD_Iteration_ptr GetIteration (const char* nomIteration);
435 SMESHHOMARD::listeBoundarys* GetAllBoundarysName();
436 SMESHHOMARD::listeCases* GetAllCasesName();
437 SMESHHOMARD::listeHypotheses* GetAllHypothesesName();
438 SMESHHOMARD::listeIterations* GetAllIterationsName();
440 void MeshInfo (const char* nomCas,
441 const char* MeshName, const char* FileName, const char* DirName,
442 CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte);
444 SMESHHOMARD::HOMARD_Iteration_ptr LastIteration (const char* nomCas);
446 // Liens entre structures
447 void InvalideBoundary(const char* nomBoundary);
448 void InvalideHypo(const char* nomHypo);
449 void InvalideIter(const char* nomIter);
450 void InvalideIterOption(const char* nomIter, CORBA::Long Option,
451 bool doRemoveWorkingFiles);
452 void InvalideIterInfo(const char* nomIter);
454 CORBA::Long DeleteBoundary(const char* nomBoundary);
455 CORBA::Long DeleteCase(const char* nomCas, CORBA::Long Option);
456 CORBA::Long DeleteHypo(const char* nomHypothesis);
457 CORBA::Long DeleteIteration(const char* nomIter,
459 bool doRemoveWorkingFiles);
460 CORBA::Long DeleteIterationOption(const char* nomIter,
463 bool doRemoveWorkingFiles);
465 void AssociateIterHypo(const char* nomIter, const char* nomHypothesis);
467 void AssociateCaseIter(const char* nomCas, const char* nomIter,
468 const char* labelIter);
471 void SetEtatIter(const char* nomIter,const CORBA::Long Etat);
472 char* CreateDirNameIter(const char* nomrep, CORBA::Long num );
474 CORBA::Long Compute(const char* nomIteration, CORBA::Long etatMenage,
475 CORBA::Long modeHOMARD,
476 CORBA::Long Option1, CORBA::Long Option2);
477 CORBA::Long ComputeAdap(SMESHHOMARD::HOMARD_Cas_var myCase,
478 SMESHHOMARD::HOMARD_Iteration_var myIteration,
479 CORBA::Long etatMenage, SMESHHOMARDImpl::HomardDriver* myDriver,
480 CORBA::Long Option1, CORBA::Long Option2);
481 CORBA::Long ComputeCAO(SMESHHOMARD::HOMARD_Cas_var myCase,
482 SMESHHOMARD::HOMARD_Iteration_var myIteration,
483 CORBA::Long Option1, CORBA::Long Option2);
484 CORBA::Long ComputeCAObis(SMESHHOMARD::HOMARD_Iteration_var myIteration,
485 CORBA::Long Option1, CORBA::Long Option2);
486 char* ComputeDirManagement(SMESHHOMARD::HOMARD_Cas_var myCase,
487 SMESHHOMARD::HOMARD_Iteration_var myIteration,
488 CORBA::Long etatMenage);
489 char* ComputeDirPaManagement(SMESHHOMARD::HOMARD_Cas_var myCase,
490 SMESHHOMARD::HOMARD_Iteration_var myIteration);
491 void DriverTexteField(SMESHHOMARD::HOMARD_Iteration_var myIteration,
492 SMESHHOMARD::HOMARD_Hypothesis_var myHypo,
493 SMESHHOMARDImpl::HomardDriver* myDriver);
494 int DriverTexteBoundary(SMESHHOMARD::HOMARD_Cas_var myCase,
495 SMESHHOMARDImpl::HomardDriver* myDriver);
496 void DriverTexteFieldInterp(SMESHHOMARD::HOMARD_Iteration_var myIteration,
497 SMESHHOMARD::HOMARD_Hypothesis_var myHypo,
498 SMESHHOMARDImpl::HomardDriver* myDriver);
500 char* VerifieDir(const char* nomDir);
502 void PublishResultInSmesh(const char* NomFich, CORBA::Long Option);
503 void DeleteResultInSmesh(std::string NomFich, std::string MeshName);
504 void PublishMeshIterInSmesh(const char* NomIter);
507 void SetPreferences();
508 void SetLanguageShort(const char* LanguageShort);
509 char* GetLanguageShort();
510 void SetPublisMesh(CORBA::Long PublisMeshIN, CORBA::Long PublisMeshOUT);
511 CORBA::Long GetPublisMeshIN();
512 CORBA::Long GetPublisMeshOUT();
515 SMESHHOMARD::HOMARD_Boundary_ptr newBoundary();
516 SMESHHOMARD::HOMARD_Cas_ptr newCase();
517 SMESHHOMARD::HOMARD_Hypothesis_ptr newHypothesis();
518 SMESHHOMARD::HOMARD_Iteration_ptr newIteration();
520 std::string GetStringInTexte( const std::string Texte, const std::string String, int option );
525 std::map<std::string, SMESHHOMARD::HOMARD_Boundary_var> _mesBoundarys;
526 std::map<std::string, SMESHHOMARD::HOMARD_Cas_var> _mesCas;
527 std::map<std::string, SMESHHOMARD::HOMARD_Hypothesis_var> _mesHypotheses;
528 std::map<std::string, SMESHHOMARD::HOMARD_Iteration_var> _mesIterations;
531 SMESHHOMARDImpl::HOMARD_Gen* myHomard;
532 StudyContext myStudyContext;
536 std::string _LangueShort;
541 SMESH_I_EXPORT int MEDFileExist( const char * aFile );
542 SMESH_I_EXPORT std::vector<double> GetBoundingBoxInMedFile( const char * aFile);
543 SMESH_I_EXPORT std::set<std::string> GetListeGroupesInMedFile(const char * aFile);
545 }; // namespace SMESHHOMARD_I