1 // Copyright (C) 2020-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 MG_ADAPT_I_HXX
21 #define MG_ADAPT_I_HXX
25 #include <SALOMEconfig.h>
26 #include CORBA_SERVER_HEADER(MG_ADAPT)
27 #include "SALOME_GenericObj_i.hh"
28 #include <SALOME_GenericObj_wrap.hxx>
34 class MgAdaptHypothesisData;
41 class SMESH_I_EXPORT MG_ADAPT_i :
42 public virtual SALOME::GenericObj_i,
43 public virtual POA_SMESH::MG_ADAPT
47 virtual ~MG_ADAPT_i();
48 void setData( SMESH::MgAdaptHypothesisData& data);
50 void setMedFileIn(const char* str);
53 void setMedFileOut(const char* str);
54 char* getMedFileOut();
56 void setMeshName(const char* str);
59 void setMeshNameOut(const char* str);
60 char* getMeshNameOut();
62 void setMeshOutMed(bool mybool);
65 void setPublish(bool mybool);
68 void setSizeMapFieldName(const char* str);
69 char* getSizeMapFieldName();
71 void setTimeStep(CORBA::Long t);
72 CORBA::Long getTimeStep() ;
74 void setTimeStepRank(CORBA::Long t, CORBA::Long r );
75 CORBA::Long getRank();
77 void setTimeStepRankLast();
80 void setLogFile(const char* str);
83 void setVerbosityLevel(CORBA::Long v);
84 CORBA::Long getVerbosityLevel();
86 void setRemoveOnSuccess(bool mybool);
87 bool getRemoveOnSuccess();
89 SMESH::MgAdaptHypothesisData* getData() ;
90 void setSizeMapType(const char* type);
91 void setUseLocalMap(bool mybool);
92 bool getUseLocalMap();
94 void setUseBackgroundMap(bool mybool);
95 bool getUseBackgroundMap();
97 void setUseConstantValue(bool mybool);
98 bool getUseConstantValue();
100 void setConstantSize(double value);
101 double getConstantSize();
103 void setSizeMapFile(const char* str);
104 char* getSizeMapFile();
106 void setFromMedFile(bool mybool);
107 bool isFromMedFile();
109 void setKeepWorkingFiles(bool mybool);
110 bool getKeepWorkingFiles();
112 //~void setPrCORBA::LongLogInFile(bool);
113 //~bool getPrCORBA::LongLogInFile();
115 void setWorkingDir(const char* str);
116 char* getWorkingDir() ;
118 void setPrintLogInFile(bool mybool);
119 bool getPrintLogInFile();
122 char* getCommandToRun() ;
126 void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) ;
127 //~void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) {
128 //~copyMgAdaptHypothesisData(&data);
131 //~void checkDirPath(char*& str);
133 bool hasOptionDefined( const char* optionName ) ;
134 void setOptionValue(const char* optionName,
135 const char* optionValue);
136 char* getOptionValue(const char* optionName,
138 SMESH::string_array* getCustomOptionValuesStrVec() ;
139 SMESH::string_array* getOptionValuesStrVec() ;
140 void copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData* to) const;
141 void copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const;
142 //~TOptionValues getOptionValues() const;
143 //~const TOptionValues& getCustomOptionValues() const ;
146 ::MG_ADAPT::MgAdapt* myMgAdapt;
151 class SMESH_I_EXPORT MG_ADAPT_OBJECT_i:
152 public virtual SALOME::GenericObj_i,
153 public virtual POA_SMESH::MG_ADAPT_OBJECT {
156 void setMeshIn( SMESH::SMESH_Mesh_ptr theMesh );
157 void setMEDFileIn(const char* f);
158 void setMEDFileOut(const char* f);
159 void setMEDFileBackground(const char* f);
160 void AddHypothesis(SMESH::MG_ADAPT_ptr);
161 CORBA::Long Compute(bool Publish);
163 std::string medFileIn, medFileOut, medFileBackground;
164 bool checkMeshFileIn();
166 SMESH::SMESH_Mesh_var myMesh;
167 SALOME::GenericObj_wrap<SMESH::MG_ADAPT> hypothesis;
172 #endif // MG_ADAPT_I_HXX