Salome HOME
b9df09b72bbc44574a32db0579d077d863721ab8
[plugins/ghs3dplugin.git] / src / GHS3DPlugin / GHS3DPlugin_Hypothesis_i.hxx
1 // Copyright (C) 2004-2022  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  GHS3DPlugin : C++ implementation
21 // File      : GHS3DPlugin_Hypothesis_i.hxx
22 // Date      : 03/04/2006
23 // Project   : SALOME
24 //
25 #ifndef _GHS3DPlugin_Hypothesis_i_HXX_
26 #define _GHS3DPlugin_Hypothesis_i_HXX_
27
28 #include "GHS3DPlugin_Defs.hxx"
29
30 #include <SALOMEconfig.h>
31 #include CORBA_SERVER_HEADER(GHS3DPlugin_Algorithm)
32
33 #include "SMESH_Hypothesis_i.hxx"
34 #include "SMESH_Mesh_i.hxx"
35 #include "GHS3DPlugin_Hypothesis.hxx"
36
37 class SMESH_Gen;
38
39 // GHS3DPlugin parameters hypothesis
40
41 class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i:
42   public virtual POA_GHS3DPlugin::GHS3DPlugin_Hypothesis,
43   public virtual SMESH_Hypothesis_i
44 {
45  public:
46   // Constructor
47   GHS3DPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
48                             ::SMESH_Gen*            theGenImpl);
49   // Destructor
50   virtual ~GHS3DPlugin_Hypothesis_i();
51
52   /*!
53    * To mesh "holes" in a solid or not. Default is to mesh.
54    */
55   void SetToMeshHoles(CORBA::Boolean toMesh);
56   CORBA::Boolean GetToMeshHoles();
57   /*!
58    *  Activate/deactivate volume proximity computation
59    */
60   void SetVolumeProximity( CORBA::Boolean toUse );
61   CORBA::Boolean GetVolumeProximity();
62   /*!
63    * Set number of surface element layers to be generated due to volume proximity
64    */
65   void SetNbVolumeProximityLayers( CORBA::Short nbLayers );
66   CORBA::Short GetNbVolumeProximityLayers();
67
68   void SetMaxSize(CORBA::Double theMaxSize);
69   CORBA::Double GetMaxSize();
70
71   void SetMinSize(CORBA::Double theMinSize);
72   CORBA::Double GetMinSize();
73   /*!
74    * To make groups of volumes of different domains when mesh is generated from skin.
75    * Default is to make groups.
76    * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
77    */
78   void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
79   CORBA::Boolean GetToMakeGroupsOfDomains();
80   /*!
81    * Maximal size of memory to be used by the algorithm (in Megabytes)
82    */
83   void SetMaximumMemory(CORBA::Float MB);
84   CORBA::Float GetMaximumMemory();
85   /*!
86    * Initial size of memory to be used by the algorithm (in Megabytes) in
87    * automatic memory adjustment mode. Default is zero
88    */
89   void SetInitialMemory(CORBA::Float MB);
90   CORBA::Float GetInitialMemory();
91   /*!
92    * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
93    */
94   void SetOptimizationLevel(CORBA::Short level);
95   CORBA::Short GetOptimizationLevel();
96   /*!
97    * Algorithm Id: 0-MGTetra HPC, 1-MGTetra
98    */
99   void SetAlgorithm(CORBA::Short algoId);
100   CORBA::Short GetAlgorithm();
101    /*!
102    * Flag for set get optional use parallelism in MGTetra
103    */
104   void SetUseNumOfThreads(CORBA::Boolean useThreads);
105   CORBA::Boolean GetUseNumOfThreads();
106    /*!
107    * Get set number of threads to use on the parallel MGTetra algorithm
108    */
109   void SetNumOfThreads(CORBA::Short numThreads);
110   CORBA::Short GetNumOfThreads();
111   /*!
112    * For MGTetra
113    * PthreadMode: 0-PThreadNone, 1-PThreadAggressive, 2-Safe
114    */
115   void SetPthreadMode(CORBA::Short pThreadMode);
116   CORBA::Short GetPthreadMode();
117   /*!
118    * For MGTetra HPC 
119    * SetParallelMode level: 0-ParallelNone, 1-ReproducibleGivenMaxNumThreads, 2-Reproducible, 3-ParallelAggressive   
120    */
121   void SetParallelMode(CORBA::Short parallelMode);
122   CORBA::Short GetParallelMode();
123   /*!
124    * Path to working directory
125    */
126   void SetWorkingDirectory(const char* path);
127   char* GetWorkingDirectory();
128   /*!
129    * To keep working files or remove them. Log file remains in case of errors anyway.
130    */
131   void SetKeepFiles(CORBA::Boolean toKeep);
132   CORBA::Boolean GetKeepFiles();
133   /*!
134    * Verbose level [0-10]
135    *  0 - no standard output,
136    *  2 - prints the data, quality statistics of the skin and final meshes and
137    *     indicates when the final mesh is being saved. In addition the software
138    *     gives indication regarding the CPU time.
139    * 10 - same as 2 plus the main steps in the computation, quality statistics
140    *     histogram of the skin mesh, quality statistics histogram together with
141    *     the characteristics of the final mesh.
142    */
143   void SetVerboseLevel(CORBA::Short level);
144   CORBA::Short GetVerboseLevel();
145   /*!
146    * To create new nodes
147    */
148   void SetToCreateNewNodes(CORBA::Boolean toCreate);
149   CORBA::Boolean GetToCreateNewNodes();
150   /*!
151    * To use boundary recovery version which tries to create mesh on a very poor
152    * quality surface mesh
153    */
154   void SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse);
155   CORBA::Boolean GetToUseBoundaryRecoveryVersion();
156   /*!
157    * Applies finite-element correction by replacing overconstrained elements where
158    * it is possible. The process is cutting first the overconstrained edges and
159    * second the overconstrained facets. This insure that no edges have two boundary
160    * vertices and that no facets have three boundary vertices.
161    */
162   void SetFEMCorrection(CORBA::Boolean toUseFem);
163   CORBA::Boolean GetFEMCorrection();
164   /*!
165    * To removes initial central point.
166    */
167   void SetToRemoveCentralPoint(CORBA::Boolean toRemove);
168   CORBA::Boolean GetToRemoveCentralPoint();
169   /*!
170    * To set hiden/undocumented/advanced options
171    */
172   void SetAdvancedOption(const char* option);
173   char* GetAdvancedOption();
174   void SetTextOption(const char* option); // obsolete
175   char* GetTextOption();
176
177   void SetOptionValue(const char* optionName, const char* optionValue);
178   char* GetOptionValue(const char* optionName);
179   void UnsetOption(const char* optionName);
180
181   GHS3DPlugin::string_array* GetOptionValues();
182   GHS3DPlugin::string_array* GetAdvancedOptionValues();
183
184   void SetOptionValues(const GHS3DPlugin::string_array& options);
185   void SetAdvancedOptionValues(const GHS3DPlugin::string_array& options);
186
187   void AddOption(const char* optionName, const char* optionValue);
188   char* GetOption(const char* optionName);
189   /*!
190   * To define the volumic gradation
191   */
192   void SetGradation(CORBA::Double gradation);
193   CORBA::Double GetGradation();
194   /*!
195   * Print log in standard output
196   */
197   void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
198   CORBA::Boolean GetStandardOutputLog();
199   /*!
200   * Remove log file on success
201   */
202   void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
203   CORBA::Boolean GetRemoveLogOnSuccess();
204   /*!
205    * To set an enforced vertex
206    */
207   bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
208                            const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
209                            CORBA::Boolean isCompound = false);
210   bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size);
211   bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName);
212   bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName);
213   bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName);
214   bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size);
215   bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName);
216   CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z);
217   CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex);
218   bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z);
219   bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex);
220   GHS3DPlugin::GHS3DEnforcedVertexList* GetEnforcedVertices();
221   void ClearEnforcedVertices();
222   /*!
223    * To set an enforced mesh
224    */  
225   bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName="");
226   bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType);
227   bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName);
228
229   /* OBSOLETE FUNCTIONS */
230   bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double /*size*/);
231   bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double /*size*/, const char* theGroupName);
232   /* OBSOLETE FUNCTIONS */
233
234   GHS3DPlugin::GHS3DEnforcedMeshList* GetEnforcedMeshes();
235   void ClearEnforcedMeshes();
236
237   // 3 GUI methods
238   CORBA::Double GetMaxSizeDefault();
239   CORBA::Double GetMinSizeDefault();
240   void SetMinMaxSizeDefault( CORBA::Double theMinSize, CORBA::Double theMaxSize );
241
242   // Get implementation
243   ::GHS3DPlugin_Hypothesis* GetImpl();
244   
245   // Verify whether hypothesis supports given entity type 
246   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
247   
248
249   // Methods for copying mesh definition to other geometry
250
251   // Return geometry this hypothesis depends on. Return false if there is no geometry parameter
252   virtual bool getObjectsDependOn( std::vector< std::string > & entryArray,
253                                    std::vector< int >         & subIDArray ) const;
254
255   // Set new geometry instead of that returned by getObjectsDependOn()
256   virtual bool setObjectsDependOn( std::vector< std::string > & entryArray,
257                                    std::vector< int >         & subIDArray );
258 };
259
260 #endif