1 // Copyright (C) 2007-2016 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
21 // File : HYBRIDPlugin_Hypothesis_i.hxx
22 // Author : Christian VAN WAMBEKE (CEA)
25 #ifndef _HYBRIDPlugin_Hypothesis_i_HXX_
26 #define _HYBRIDPlugin_Hypothesis_i_HXX_
28 #include "HYBRIDPlugin_Defs.hxx"
30 #include <SALOMEconfig.h>
31 #include CORBA_SERVER_HEADER(HYBRIDPlugin_Algorithm)
33 #include "SMESH_Hypothesis_i.hxx"
34 #include "SMESH_Mesh_i.hxx"
35 #include "HYBRIDPlugin_Hypothesis.hxx"
39 // HYBRIDPlugin parameters hypothesis
41 class HYBRIDPLUGIN_EXPORT HYBRIDPlugin_Hypothesis_i:
42 public virtual POA_HYBRIDPlugin::HYBRIDPlugin_Hypothesis,
43 public virtual SMESH_Hypothesis_i
47 HYBRIDPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
49 ::SMESH_Gen* theGenImpl);
51 virtual ~HYBRIDPlugin_Hypothesis_i();
54 * To mesh "holes" in a solid or not. Default is to mesh.
56 void SetToMeshHoles(CORBA::Boolean toMesh);
57 CORBA::Boolean GetToMeshHoles();
59 * IDs of faces to grow the layers on
61 void SetFacesWithLayers(const SMESH::long_array& faceIDs);
62 SMESH::long_array* GetFacesWithLayers();
64 * To mesh "layers on all wrap". Default is to mesh.
66 void SetLayersOnAllWrap(CORBA::Boolean toMesh);
67 CORBA::Boolean GetLayersOnAllWrap();
69 * To make groups of volumes of different domains when mesh is generated from skin.
70 * Default is to make groups.
71 * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
73 void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
74 CORBA::Boolean GetToMakeGroupsOfDomains();
76 * Maximal size of memory to be used by the algorithm (in Megabytes)
78 void SetMaximumMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
79 CORBA::Double GetMaximumMemory();
81 * Initial size of memory to be used by the algorithm (in Megabytes) in
82 * automatic memory adjustment mode. Default is zero
84 void SetInitialMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
85 CORBA::Double GetInitialMemory();
87 * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
89 void SetOptimizationLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
90 CORBA::Short GetOptimizationLevel();
92 * Collision Mode: 0-decrease, 1-stop. Default is decrease
94 void SetCollisionMode(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
95 CORBA::Short GetCollisionMode();
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* theOptAndVals );
146 char* GetAdvancedOption();
147 void SetTextOption(const char* option);
148 char* GetTextOption();
150 * To define the volumic gradation
152 void SetGradation(CORBA::Double gradation);
153 CORBA::Double GetGradation();
155 * Print log in standard output
157 void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
158 CORBA::Boolean GetStandardOutputLog();
160 * Remove log file on success
162 void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
163 CORBA::Boolean GetRemoveLogOnSuccess();
165 void SetBoundaryLayersGrowth(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
166 CORBA::Short GetBoundaryLayersGrowth();
168 void SetElementGeneration(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
169 CORBA::Short GetElementGeneration();
171 void SetAddMultinormals(CORBA::Boolean toAddMultinormals);
172 CORBA::Boolean GetAddMultinormals();
174 void SetSmoothNormals(CORBA::Boolean toSmoothNormals);
175 CORBA::Boolean GetSmoothNormals();
177 void SetHeightFirstLayer(CORBA::Double toHeightFirstLayer);
178 CORBA::Double GetHeightFirstLayer();
180 void SetBoundaryLayersProgression(CORBA::Double toBoundaryLayersProgression);
181 CORBA::Double GetBoundaryLayersProgression();
183 void SetCoreSize(CORBA::Double toCoreSize);
184 CORBA::Double GetCoreSize();
186 void SetMultinormalsAngle(CORBA::Double toMultinormalsAngle);
187 CORBA::Double GetMultinormalsAngle();
189 void SetNbOfBoundaryLayers(CORBA::Short toNbOfBoundaryLayers);
190 CORBA::Short GetNbOfBoundaryLayers();
193 * To set an enforced vertex
195 bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
196 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
197 CORBA::Boolean isCompound = false)
198 throw (SALOME::SALOME_Exception);
199 bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size) throw (SALOME::SALOME_Exception);
200 bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName) throw (SALOME::SALOME_Exception);
201 bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
202 bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName) throw (SALOME::SALOME_Exception);
203 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size) throw (SALOME::SALOME_Exception);
204 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
205 CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
206 CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
207 bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
208 bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
209 HYBRIDPlugin::HYBRIDEnforcedVertexList* GetEnforcedVertices();
210 void ClearEnforcedVertices();
212 * To set an enforced mesh
214 bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName="") throw (SALOME::SALOME_Exception);
215 bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType) throw (SALOME::SALOME_Exception);
216 bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName) throw (SALOME::SALOME_Exception);
218 /* OBSOLETE FUNCTIONS */
219 bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size) throw (SALOME::SALOME_Exception);
220 bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
221 /* OBSOLETE FUNCTIONS */
223 HYBRIDPlugin::HYBRIDEnforcedMeshList* GetEnforcedMeshes();
224 void ClearEnforcedMeshes();
226 // Get implementation
227 ::HYBRIDPlugin_Hypothesis* GetImpl();
229 // Verify whether hypothesis supports given entity type
230 CORBA::Boolean IsDimSupported( SMESH::Dimension type );