X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHOMARD_I%2FHOMARD_Gen_i.hxx;h=0b6ed28899291c24e09ce61e476d121cbdf33106;hb=1f3c08317130e4d167096c23d01c5be221b720ac;hp=4f646768939bfbbb73b3b35d49e8f0d2288e3746;hpb=a9189d870ff98f06dc5577c5fc37102ee5337aea;p=modules%2Fhomard.git diff --git a/src/HOMARD_I/HOMARD_Gen_i.hxx b/src/HOMARD_I/HOMARD_Gen_i.hxx index 4f646768..0b6ed288 100644 --- a/src/HOMARD_I/HOMARD_Gen_i.hxx +++ b/src/HOMARD_I/HOMARD_Gen_i.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2011-2012 CEA/DEN, EDF R&D +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,21 +27,23 @@ #include CORBA_SERVER_HEADER(HOMARD_Iteration) #include CORBA_SERVER_HEADER(HOMARD_Zone) #include CORBA_SERVER_HEADER(HOMARD_Boundary) +#include CORBA_SERVER_HEADER(HOMARD_YACS) #include CORBA_CLIENT_HEADER(SALOMEDS) #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) +#include "HOMARD_i.hxx" #include "HOMARD_Gen.hxx" +#include "HomardDriver.hxx" +#include "YACSDriver.hxx" +#include "FrontTrack.hxx" #include "SALOME_Component_i.hxx" #include "SALOME_NamingService.hxx" #include "Utils_CorbaException.hxx" - #include #include -class HOMARD_Gen_i: - public virtual Engines_Component_i, - public virtual POA_HOMARD::HOMARD_Gen +class HOMARDENGINE_EXPORT HOMARD_Gen_i : public Engines_Component_i, public POA_HOMARD::HOMARD_Gen { public: HOMARD_Gen_i( CORBA::ORB_ptr orb, @@ -52,13 +54,41 @@ public: virtual ~HOMARD_Gen_i(); - SALOMEDS::Study_ptr GetCurrentStudy(); - void SetCurrentStudy(SALOMEDS::Study_ptr theStudy); - CORBA::Long GetCurrentStudyID(); +// Generalites + +// Les creations + HOMARD::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryCAO(const char* nomBoundary, + const char* DataFile); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary, + const char* MeshName, const char* DataFile); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryCylinder (const char* nomBoundary, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, + CORBA::Double Rayon); + HOMARD::HOMARD_Boundary_ptr CreateBoundarySphere (const char* nomBoundary, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Rayon); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryConeR (const char* nomBoundary, + CORBA::Double Xcentre1, CORBA::Double Ycentre1, CORBA::Double Zcentre1, CORBA::Double Rayon1, + CORBA::Double Xcentre2, CORBA::Double Ycentre2, CORBA::Double Zcentre2, CORBA::Double Rayon2); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryConeA (const char* nomBoundary, + CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, CORBA::Double Angle, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre); + HOMARD::HOMARD_Boundary_ptr CreateBoundaryTorus (const char* nomBoundary, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, + CORBA::Double RayonRev, CORBA::Double RayonPri); + + HOMARD::HOMARD_Cas_ptr CreateCase (const char* nomCas, const char* MeshName, const char* FileName); + HOMARD::HOMARD_Cas_ptr CreateCaseFromIteration (const char* nomCas, const char* DirNameStart); + HOMARD::HOMARD_Cas_ptr CreateCaseFromCaseLastIteration (const char* nomCas, const char* DirNameStart); + HOMARD::HOMARD_Cas_ptr CreateCaseFromCaseIteration (const char* nomCas, const char* DirNameStart, CORBA::Long Number); + HOMARD::HOMARD_Cas_ptr CreateCase0 (const char* nomCas, const char* MeshName, const char* FileName, CORBA::Long MeshOption, CORBA::Long NumeIter, CORBA::Long Option); + std::string CreateCase1 (const char* DirNameStart, CORBA::Long Number); - HOMARD::HOMARD_Cas_ptr CreateCase (const char* nomCas, - const char* MeshName, const char* FileName); HOMARD::HOMARD_Hypothesis_ptr CreateHypothesis(const char* nomHypothesis); + HOMARD::HOMARD_Iteration_ptr CreateIteration (const char* nomIter, const char* nomIterParent); HOMARD::HOMARD_Zone_ptr CreateZone (const char* nomZone, CORBA::Long typeZone); @@ -66,20 +96,14 @@ public: CORBA::Double Xmini, CORBA::Double Xmaxi, CORBA::Double Ymini, CORBA::Double Ymaxi, CORBA::Double Zmini, CORBA::Double Zmaxi); - HOMARD::HOMARD_Zone_ptr CreateZoneSphere (const char* nomZone, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon); - HOMARD::HOMARD_Zone_ptr CreateZoneCylinder (const char* nomZone, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double Rayon, CORBA::Double Haut); - HOMARD::HOMARD_Zone_ptr CreateZonePipe (const char* nomZone, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, - CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint); HOMARD::HOMARD_Zone_ptr CreateZoneBox2D (const char* nomZone, CORBA::Double Umini, CORBA::Double Umaxi, CORBA::Double Vmini, CORBA::Double Vmaxi, CORBA::Long Orient); + HOMARD::HOMARD_Zone_ptr CreateZoneCylinder (const char* nomZone, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double Rayon, CORBA::Double Haut); HOMARD::HOMARD_Zone_ptr CreateZoneDisk (const char* nomZone, CORBA::Double Ucentre, CORBA::Double Vcentre, CORBA::Double Rayon, @@ -88,55 +112,109 @@ public: CORBA::Double Ucentre, CORBA::Double Vcentre, CORBA::Double Rayon, CORBA::Double Rayonint, CORBA::Long Orient); - - HOMARD::HOMARD_Boundary_ptr CreateBoundary (const char* nomBoundary, CORBA::Long typeBoundary); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryDi (const char* nomBoundary, - const char* MeshName, const char* FileName); - HOMARD::HOMARD_Boundary_ptr CreateBoundaryCylinder (const char* nomBoundary, - CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Xaxis, CORBA::Double Yaxis, CORBA::Double Zaxis, - CORBA::Double Rayon); - HOMARD::HOMARD_Boundary_ptr CreateBoundarySphere (const char* nomBoundary, + HOMARD::HOMARD_Zone_ptr CreateZonePipe (const char* nomZone, CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, - CORBA::Double Rayon); + CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe, + CORBA::Double Rayon, CORBA::Double Haut, CORBA::Double Rayonint); + HOMARD::HOMARD_Zone_ptr CreateZoneSphere (const char* nomZone, + CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre, CORBA::Double Rayon); - HOMARD::HOMARD_Cas_ptr GetCas (const char* nomCas); - HOMARD::HOMARD_Zone_ptr GetZone (const char* nomZone); +// Les informations + HOMARD::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary); + HOMARD::HOMARD_Cas_ptr GetCase (const char* nomCas); HOMARD::HOMARD_Hypothesis_ptr GetHypothesis (const char* nomHypothesis); HOMARD::HOMARD_Iteration_ptr GetIteration (const char* nomIteration); - HOMARD::HOMARD_Boundary_ptr GetBoundary (const char* nomBoundary); + HOMARD::HOMARD_YACS_ptr GetYACS (const char* nomYACS); + HOMARD::HOMARD_Zone_ptr GetZone (const char* nomZone); - void AssociateCaseIter(const char* nomCas, const char* nomIter, - const char* labelIter); - void AssociateIterIter(const char* nomIterParent, const char* nomIter); - void AssociateIterHypo(const char* nomIter, const char* nomHypothesis); - void AssociateHypoZone(const char* nomHypothesis, const char* nomZone, CORBA::Long TypeUse); - void DissociateHypoZone(const char* nomZone, const char* nomHypothesis); + HOMARD::listeBoundarys* GetAllBoundarysName(); + HOMARD::listeCases* GetAllCasesName(); + HOMARD::listeHypotheses* GetAllHypothesesName(); + HOMARD::listeIterations* GetAllIterationsName(); + HOMARD::listeYACSs* GetAllYACSsName(); + HOMARD::listeZones* GetAllZonesName(); + + void MeshInfo (const char* nomCas, + const char* MeshName, const char* FileName, const char* DirName, + CORBA::Long Qual, CORBA::Long Diam, CORBA::Long Conn, CORBA::Long Tail, CORBA::Long Inte); + HOMARD::HOMARD_Iteration_ptr LastIteration (const char* nomCas); + +// L'etude + void UpdateStudy(); + void IsValidStudy(); + +// Liens entre structures void InvalideBoundary(const char* nomBoundary); - void InvalideZone(const char* nomZone); void InvalideHypo(const char* nomHypo); void InvalideIter(const char* nomIter); + void InvalideIterOption(const char* nomIter, CORBA::Long Option); + void InvalideIterInfo(const char* nomIter); + void InvalideYACS(const char* nomYACS); + void InvalideZone(const char* nomZone); - void SetEtatIter(const char* nomIter,const CORBA::Boolean EtatCalcul); + CORBA::Long DeleteBoundary(const char* nomBoundary); + CORBA::Long DeleteCase(const char* nomCas, CORBA::Long Option); + CORBA::Long DeleteHypo(const char* nomHypothesis); + CORBA::Long DeleteIteration(const char* nomIter, CORBA::Long Option); + CORBA::Long DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long DeleteYACS(const char* nomYACS, CORBA::Long Option); + CORBA::Long DeleteZone(const char* nomZone); - HOMARD::listeCases* GetAllCases(); - HOMARD::listeHypotheses* GetAllHypotheses(); - HOMARD::listeZones* GetAllZones(); - HOMARD::listeIterations* GetAllIterations(); - HOMARD::listeBoundarys* GetAllBoundarys(); + void AssociateIterHypo(const char* nomIter, const char* nomHypothesis); - char* GetCaseName(const char* nomIteration); + void AssociateHypoZone(const char* nomHypothesis, const char* nomZone, CORBA::Long TypeUse); + void DissociateHypoZone(const char* nomHypothesis, const char* nomZone); - CORBA::Long Compute(const char* nomIteration, CORBA::Long etatMenage); - CORBA::Boolean VerifieDir(const char* nomDir); + void AssociateCaseIter(const char* nomCas, const char* nomIter, + const char* labelIter); - void PublishResultInSmesh(const char* NomFich, CORBA::Long IconeType); - void DeleteResultInSmesh(const char* NomFich, const char* MeshName); - void PublishFileUnderIteration(const char* NomIter, const char* NomFich, - const char* Commentaire); +// Actions + void SetEtatIter(const char* nomIter,const CORBA::Long Etat); + char* CreateDirNameIter(const char* nomrep, CORBA::Long num ); + + CORBA::Long Compute(const char* nomIteration, CORBA::Long etatMenage, CORBA::Long modeHOMARD, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage, HomardDriver* myDriver, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long ComputeCAO(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); + CORBA::Long ComputeCAObis(HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long Option1, CORBA::Long Option2); + char* ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration, CORBA::Long etatMenage); + char* ComputeDirPaManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOMARD_Iteration_var myIteration); + void DriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); + void DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); + int DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriver* myDriver); + void DriverTexteFieldInterp(HOMARD::HOMARD_Iteration_var myIteration, HOMARD::HOMARD_Hypothesis_var myHypo, HomardDriver* myDriver); + + char* VerifieDir(const char* nomDir); + + void PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire); + void PublishFileUnderYACS(const char* NomYACS, const char* NomFich, const char* Commentaire); + void PublishBoundaryUnderCase(const char* CaseName, const char* BoundaryName); + void PublishCaseUnderYACS(const char* YACSName, const char* CaseName); + void PublishResultInSmesh(const char* NomFich, CORBA::Long Option); + void DeleteResultInSmesh(std::string NomFich, std::string MeshName); + void PublishMeshIterInSmesh(const char* NomIter); + +// YACS + HOMARD::HOMARD_YACS_ptr CreateYACSSchema (const char* YACSName, const char* nomCas, const char* ScriptFile, const char* DirName, const char* MeshFile); + CORBA::Long YACSWrite(const char* nomYACS); + CORBA::Long YACSWriteOnFile(const char* nomYACS, const char* XMLFile); + std::string YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHypo, YACSDriver* myDriver); + std::string YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, YACSDriver* myDriver); + +// Preferences + void SetPreferences() ; + void SetLanguageShort(const char* LanguageShort); + char* GetLanguageShort(); + void SetPublisMesh(CORBA::Long PublisMeshIN, CORBA::Long PublisMeshOUT); + CORBA::Long GetPublisMeshIN(); + CORBA::Long GetPublisMeshOUT(); + void SetYACSMaximum(CORBA::Long YACSMaxIter, CORBA::Long YACSMaxNode, CORBA::Long YACSMaxElem); + CORBA::Long GetYACSMaxIter(); + CORBA::Long GetYACSMaxNode(); + CORBA::Long GetYACSMaxElem(); + void SetYACSConvergenceType(CORBA::Long YACSTypeTest); + CORBA::Long GetYACSConvergenceType(); - void IsValidStudy(); // --------------------------------------------------------------- // next functions are inherited from SALOMEDS::Driver interface @@ -178,8 +256,7 @@ public: // --> Data publishing virtual CORBA::Boolean CanPublishInStudy(CORBA::Object_ptr theIOR); - virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, + virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject, const char* theName); @@ -195,54 +272,73 @@ public: CORBA::Long theObjectID, SALOMEDS::SObject_ptr theObject); +// virtual void SALOMEException( std::string message ); private: - void addInStudy(SALOMEDS::Study_ptr theStudy); - SALOMEDS::SObject_ptr PublishCaseInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder, + SALOMEDS::SObject_ptr PublishBoundaryInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_Boundary_ptr theObject, const char* theName); + SALOMEDS::SObject_ptr PublishCaseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, HOMARD::HOMARD_Cas_ptr theObject, const char* theName); - - SALOMEDS::SObject_ptr PublishHypotheseInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder, + SALOMEDS::SObject_ptr PublishHypotheseInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, HOMARD::HOMARD_Hypothesis_ptr theObject, const char* theName); - - SALOMEDS::SObject_ptr PublishZoneInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder, + SALOMEDS::SObject_ptr PublishYACSInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, + HOMARD::HOMARD_YACS_ptr theObject, const char* theName); + SALOMEDS::SObject_ptr PublishZoneInStudy(SALOMEDS::StudyBuilder_var aStudyBuilder, HOMARD::HOMARD_Zone_ptr theObject, const char* theName); - SALOMEDS::SObject_ptr PublishBoundaryInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::StudyBuilder_var aStudyBuilder, - HOMARD::HOMARD_Boundary_ptr theObject, const char* theName); virtual void PublishInStudyAttr(SALOMEDS::StudyBuilder_var aStudyBuilder, SALOMEDS::SObject_var aResultSO, - const char* theName, const char* value, const char* icone, const char* ior); + const char* theName, const char* comment, const char* icone, const char* ior); + PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject); + HOMARD::HOMARD_Boundary_ptr newBoundary(); HOMARD::HOMARD_Cas_ptr newCase(); HOMARD::HOMARD_Hypothesis_ptr newHypothesis(); HOMARD::HOMARD_Iteration_ptr newIteration(); + HOMARD::HOMARD_YACS_ptr newYACS(); HOMARD::HOMARD_Zone_ptr newZone(); - HOMARD::HOMARD_Boundary_ptr newBoundary(); - virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, - CORBA::Boolean isMultiFile, - CORBA::Boolean& isValidScript); + virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished, + CORBA::Boolean isMultiFile, + CORBA::Boolean& isValidScript); + virtual char* getVersion(); + std::string GetStringInTexte( const std::string Texte, const std::string String, int option ) ; private: struct StudyContext { + std::map _mesBoundarys; std::map _mesCas; std::map _mesHypotheses; std::map _mesIterations; + std::map _mesYACSs; std::map _mesZones; - std::map _mesBoundarys; std::map _idmap; }; - typedef std::map ContextMap; ::HOMARD_Gen* myHomard; - SALOMEDS::Study_var myCurrentStudy; - ContextMap myContextMap; + StudyContext myStudyContext; SALOME_NamingService* _NS; + int _tag_gene ; + int _tag_boun ; + int _tag_hypo ; + int _tag_yacs ; + int _tag_zone ; + +// Preferences + std::string _Langue ; + std::string _LangueShort ; + int _PublisMeshIN ; + int _PublisMeshOUT ; + int _YACSMaxIter ; + int _YACSMaxNode ; + int _YACSMaxElem ; + int _YACSTypeTest ; +protected: + SALOMEDS::Study_var myStudy; }; #endif