Salome HOME
Merge branch 'master' into gni/adaptation
[modules/smesh.git] / src / SMESH_I / MG_ADAPT_i.hxx
1 #ifndef MG_ADAPT_I_HXX
2 #define MG_ADAPT_I_HXX
3
4 #include "MG_ADAPT.hxx"
5 #include "SMESH.hxx"
6 #include <SALOMEconfig.h>
7 //~#include CORBA_SERVER_HEADER(ADAPT_Gen)
8 #include CORBA_SERVER_HEADER(MG_ADAPT)
9
10 #include "SALOME_GenericObj_i.hh"
11 #include "SALOME_Component_i.hxx"
12 #include "SALOME_NamingService.hxx"
13 #include "Utils_CorbaException.hxx"
14 #include <vector>
15 #include <algorithm>
16 #include <iterator>
17 #include <string>
18
19 //~struct MgAdaptHypothesisData;
20 //~static void copyHypothesisDataToImpl(SMESH::MgAdaptHypothesisData& from, MG_ADAPT::MgAdaptHypothesisData* to);
21 //~static void copyHypothesisDataFromImpl(MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData& to);
22 //~class MgAdapt;
23 namespace SMESH
24 {
25
26 class SMESH_I_EXPORT MG_ADAPT_i :
27     public virtual SALOME::GenericObj_i,
28     public virtual POA_SMESH::MG_ADAPT
29 {
30 public:
31     //~MG_ADAPT_i( CORBA::ORB_ptr orb, ADAPT::ADAPT_Gen_var gen_i );
32     //~static SMESH::MG_ADAPT_ptr CreateMG_ADAPT();
33     //~MG_ADAPT_i(PortableServer::POA_var poa);
34     MG_ADAPT_i();
35     virtual ~MG_ADAPT_i();
36         //~void setData( SMESH::MgAdaptHypothesisData* data);
37         void setData( SMESH::MgAdaptHypothesisData& data);
38
39         void setMedFileIn(const char* str);
40         char* getMedFileIn();
41
42         void setMedFileOut(const char* str);
43         char* getMedFileOut();
44
45         void setMeshName(const char* str);
46         char* getMeshName();
47
48         void setMeshNameOut(const char* str);
49         char* getMeshNameOut();
50
51         void setMeshOutMed(bool mybool);
52         bool getMeshOutMed();
53
54         void setPublish(bool mybool);
55         bool getPublish();
56
57         void setSizeMapFieldName(const char* str);
58         char* getSizeMapFieldName();
59
60         void setTimeStep(CORBA::Long t);
61         CORBA::Long getTimeStep() ;
62
63         void setTimeStepRank(CORBA::Long t, CORBA::Long r );
64         CORBA::Long getRank();
65         
66         void setTimeStepRankLast();
67         void setNoTimeStep();
68
69         void setLogFile(const char* str);
70         char* getLogFile();
71
72         void setVerbosityLevel(CORBA::Long v);
73         CORBA::Long getVerbosityLevel();
74
75         void setRemoveOnSuccess(bool mybool);
76         bool getRemoveOnSuccess();
77
78         SMESH::MgAdaptHypothesisData* getData() ;
79         void setSizeMapType(const char* type);
80         void setUseLocalMap(bool mybool);
81         bool getUseLocalMap();
82
83         void setUseBackgroundMap(bool mybool);
84         bool getUseBackgroundMap();
85
86         void setUseConstantValue(bool mybool);
87         bool getUseConstantValue();
88
89         void setConstantSize(double value);
90         double getConstantSize();
91
92         void setSizeMapFile(const char* str);
93         char* getSizeMapFile();
94
95         void setFromMedFile(bool mybool);
96         bool isFromMedFile();
97
98         void setKeepWorkingFiles(bool mybool);
99         bool getKeepWorkingFiles();
100
101         //~void setPrCORBA::LongLogInFile(bool);
102         //~bool getPrCORBA::LongLogInFile();
103
104         void setWorkingDir(const char* str);
105         char* getWorkingDir() ;
106
107         void setPrintLogInFile(bool mybool);
108     bool getPrintLogInFile();
109     
110         bool setAll();
111         char* getCommandToRun() ;
112         //~CORBA::Long compute(::CORBA::String_out errStr);
113         CORBA::Long compute();
114         char* getFileName();
115         char* getExeName();
116         void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) ;
117         //~void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) {
118                 //~copyMgAdaptHypothesisData(&data);
119         //~}
120
121         //~void checkDirPath(char*& str);
122         
123         bool hasOptionDefined( const char* optionName ) ;
124         void setOptionValue(const char* optionName,
125                                                 const char* optionValue) throw (std::invalid_argument);
126         char* getOptionValue(const char* optionName,
127                                                            bool&              isDefault)  throw (std::invalid_argument);
128         str_array* getCustomOptionValuesStrVec() ;
129         str_array* getOptionValuesStrVec() ;
130         void copyHypothesisDataFromImpl(const ::MG_ADAPT::MgAdaptHypothesisData* from, SMESH::MgAdaptHypothesisData* to) const;
131         void copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const;
132         //~TOptionValues        getOptionValues()       const;
133         //~const TOptionValues& getCustomOptionValues() const ;
134         char* getErrMsg();
135 private:
136   ::MG_ADAPT::MgAdapt*          myMgAdapt;
137   std::string errStr;
138   //~CORBA::ORB_ptr         _orb;
139   //~ADAPT::ADAPT_Gen_var _gen_i;
140         
141 };
142
143 class SMESH_I_EXPORT MG_ADAPT_OBJECT_i:
144     public virtual SALOME::GenericObj_i,
145     public virtual POA_SMESH::MG_ADAPT_OBJECT {
146 public :
147         MG_ADAPT_OBJECT_i();
148         void setMeshIn( SMESH::SMESH_Mesh_ptr theMesh );
149         void setMEDFileIn(const char* f);
150         void setMEDFileOut(const char* f);
151         void setMEDFileBackground(const char* f);
152         void AddHypothesis(SMESH::MG_ADAPT_ptr);
153         CORBA::Long Compute(bool Publish);      
154 private:
155 std::string medFileIn, medFileOut, medFileBackground;
156 bool checkMeshFileIn();
157 bool publish;
158 SMESH::SMESH_Mesh_ptr myMesh;
159 SMESH::MG_ADAPT_ptr hypothesis;
160 };
161
162 }
163 #endif // MG_ADAPT_I_HXX