1 // Copyright (C) 2004-2019 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 // GHS3DPlugin : C++ implementation
21 // File : GHS3DPlugin_Hypothesis_i.hxx
25 #ifndef _GHS3DPlugin_Hypothesis_i_HXX_
26 #define _GHS3DPlugin_Hypothesis_i_HXX_
28 #include "GHS3DPlugin_Defs.hxx"
30 #include <SALOMEconfig.h>
31 #include CORBA_SERVER_HEADER(GHS3DPlugin_Algorithm)
33 #include "SMESH_Hypothesis_i.hxx"
34 #include "SMESH_Mesh_i.hxx"
35 #include "GHS3DPlugin_Hypothesis.hxx"
39 // GHS3DPlugin parameters hypothesis
41 class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i:
42 public virtual POA_GHS3DPlugin::GHS3DPlugin_Hypothesis,
43 public virtual SMESH_Hypothesis_i
47 GHS3DPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
48 ::SMESH_Gen* theGenImpl);
50 virtual ~GHS3DPlugin_Hypothesis_i();
53 * To mesh "holes" in a solid or not. Default is to mesh.
55 void SetToMeshHoles(CORBA::Boolean toMesh);
56 CORBA::Boolean GetToMeshHoles();
58 * Activate/deactivate volume proximity computation
60 void SetVolumeProximity( CORBA::Boolean toUse );
61 CORBA::Boolean GetVolumeProximity();
63 * Set number of surface element layers to be generated due to volume proximity
65 void SetNbVolumeProximityLayers( CORBA::Short nbLayers );
66 CORBA::Short GetNbVolumeProximityLayers();
68 void SetMaxSize(CORBA::Double theMaxSize);
69 CORBA::Double GetMaxSize();
71 void SetMinSize(CORBA::Double theMinSize);
72 CORBA::Double GetMinSize();
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
78 void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
79 CORBA::Boolean GetToMakeGroupsOfDomains();
81 * Maximal size of memory to be used by the algorithm (in Megabytes)
83 void SetMaximumMemory(CORBA::Float MB) throw ( SALOME::SALOME_Exception );
84 CORBA::Float GetMaximumMemory();
86 * Initial size of memory to be used by the algorithm (in Megabytes) in
87 * automatic memory adjustment mode. Default is zero
89 void SetInitialMemory(CORBA::Float MB) throw ( SALOME::SALOME_Exception );
90 CORBA::Float GetInitialMemory();
92 * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
94 void SetOptimizationLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
95 CORBA::Short GetOptimizationLevel();
97 * Path to working directory
99 void SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception );
100 char* GetWorkingDirectory();
102 * To keep working files or remove them. Log file remains in case of errors anyway.
104 void SetKeepFiles(CORBA::Boolean toKeep);
105 CORBA::Boolean GetKeepFiles();
107 * Verbose level [0-10]
108 * 0 - no standard output,
109 * 2 - prints the data, quality statistics of the skin and final meshes and
110 * indicates when the final mesh is being saved. In addition the software
111 * gives indication regarding the CPU time.
112 * 10 - same as 2 plus the main steps in the computation, quality statistics
113 * histogram of the skin mesh, quality statistics histogram together with
114 * the characteristics of the final mesh.
116 void SetVerboseLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
117 CORBA::Short GetVerboseLevel();
119 * To create new nodes
121 void SetToCreateNewNodes(CORBA::Boolean toCreate);
122 CORBA::Boolean GetToCreateNewNodes();
124 * To use boundary recovery version which tries to create mesh on a very poor
125 * quality surface mesh
127 void SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse);
128 CORBA::Boolean GetToUseBoundaryRecoveryVersion();
130 * Applies finite-element correction by replacing overconstrained elements where
131 * it is possible. The process is cutting first the overconstrained edges and
132 * second the overconstrained facets. This insure that no edges have two boundary
133 * vertices and that no facets have three boundary vertices.
135 void SetFEMCorrection(CORBA::Boolean toUseFem);
136 CORBA::Boolean GetFEMCorrection();
138 * To removes initial central point.
140 void SetToRemoveCentralPoint(CORBA::Boolean toRemove);
141 CORBA::Boolean GetToRemoveCentralPoint();
143 * To set hiden/undocumented/advanced options
145 void SetAdvancedOption(const char* option) throw (SALOME::SALOME_Exception);
146 char* GetAdvancedOption();
147 void SetTextOption(const char* option); // obsolete
148 char* GetTextOption();
150 void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
151 char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
152 void UnsetOption(const char* optionName);
154 GHS3DPlugin::string_array* GetOptionValues();
155 GHS3DPlugin::string_array* GetAdvancedOptionValues();
157 void SetOptionValues(const GHS3DPlugin::string_array& options) throw (SALOME::SALOME_Exception);
158 void SetAdvancedOptionValues(const GHS3DPlugin::string_array& options);
160 void AddOption(const char* optionName, const char* optionValue);
161 char* GetOption(const char* optionName);
163 * To define the volumic gradation
165 void SetGradation(CORBA::Double gradation);
166 CORBA::Double GetGradation();
168 * Print log in standard output
170 void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
171 CORBA::Boolean GetStandardOutputLog();
173 * Remove log file on success
175 void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
176 CORBA::Boolean GetRemoveLogOnSuccess();
178 * To set an enforced vertex
180 bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
181 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
182 CORBA::Boolean isCompound = false)
183 throw (SALOME::SALOME_Exception);
184 bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size) throw (SALOME::SALOME_Exception);
185 bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName) throw (SALOME::SALOME_Exception);
186 bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
187 bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName) throw (SALOME::SALOME_Exception);
188 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size) throw (SALOME::SALOME_Exception);
189 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
190 CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
191 CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
192 bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
193 bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
194 GHS3DPlugin::GHS3DEnforcedVertexList* GetEnforcedVertices();
195 void ClearEnforcedVertices();
197 * To set an enforced mesh
199 bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName="") throw (SALOME::SALOME_Exception);
200 bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType) throw (SALOME::SALOME_Exception);
201 bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName) throw (SALOME::SALOME_Exception);
203 /* OBSOLETE FUNCTIONS */
204 bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size) throw (SALOME::SALOME_Exception);
205 bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
206 /* OBSOLETE FUNCTIONS */
208 GHS3DPlugin::GHS3DEnforcedMeshList* GetEnforcedMeshes();
209 void ClearEnforcedMeshes();
212 CORBA::Double GetMaxSizeDefault();
213 CORBA::Double GetMinSizeDefault();
214 void SetMinMaxSizeDefault( CORBA::Double theMinSize, CORBA::Double theMaxSize );
216 // Get implementation
217 ::GHS3DPlugin_Hypothesis* GetImpl();
219 // Verify whether hypothesis supports given entity type
220 CORBA::Boolean IsDimSupported( SMESH::Dimension type );
223 // Methods for copying mesh definition to other geometry
225 // Return geometry this hypothesis depends on. Return false if there is no geometry parameter
226 virtual bool getObjectsDependOn( std::vector< std::string > & entryArray,
227 std::vector< int > & subIDArray ) const;
229 // Set new geometry instead of that returned by getObjectsDependOn()
230 virtual bool setObjectsDependOn( std::vector< std::string > & entryArray,
231 std::vector< int > & subIDArray );