1 // Copyright (C) 2004-2013 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.
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 // HYBRIDPlugin : C++ implementation
21 // File : HYBRIDPlugin_Hypothesis_i.hxx
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 * To make groups of volumes of different domains when mesh is generated from skin.
60 * Default is to make groups.
61 * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
63 void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
64 CORBA::Boolean GetToMakeGroupsOfDomains();
66 * Maximal size of memory to be used by the algorithm (in Megabytes)
68 void SetMaximumMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
69 CORBA::Double GetMaximumMemory();
71 * Initial size of memory to be used by the algorithm (in Megabytes) in
72 * automatic memory adjustment mode. Default is zero
74 void SetInitialMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
75 CORBA::Double GetInitialMemory();
77 * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
79 void SetOptimizationLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
80 CORBA::Short GetOptimizationLevel();
82 * Collision Mode: 0-decrease, 1-stop. Default is decrease
84 void SetCollisionMode(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
85 CORBA::Short GetCollisionMode();
87 * Path to working directory
89 void SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception );
90 char* GetWorkingDirectory();
92 * To keep working files or remove them. Log file remains in case of errors anyway.
94 void SetKeepFiles(CORBA::Boolean toKeep);
95 CORBA::Boolean GetKeepFiles();
97 * Verbose level [0-10]
98 * 0 - no standard output,
99 * 2 - prints the data, quality statistics of the skin and final meshes and
100 * indicates when the final mesh is being saved. In addition the software
101 * gives indication regarding the CPU time.
102 * 10 - same as 2 plus the main steps in the computation, quality statistics
103 * histogram of the skin mesh, quality statistics histogram together with
104 * the characteristics of the final mesh.
106 void SetVerboseLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
107 CORBA::Short GetVerboseLevel();
109 * To create new nodes
111 void SetToCreateNewNodes(CORBA::Boolean toCreate);
112 CORBA::Boolean GetToCreateNewNodes();
114 * To use boundary recovery version which tries to create mesh on a very poor
115 * quality surface mesh
117 void SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse);
118 CORBA::Boolean GetToUseBoundaryRecoveryVersion();
120 * Applies finite-element correction by replacing overconstrained elements where
121 * it is possible. The process is cutting first the overconstrained edges and
122 * second the overconstrained facets. This insure that no edges have two boundary
123 * vertices and that no facets have three boundary vertices.
125 void SetFEMCorrection(CORBA::Boolean toUseFem);
126 CORBA::Boolean GetFEMCorrection();
128 * To removes initial central point.
130 void SetToRemoveCentralPoint(CORBA::Boolean toRemove);
131 CORBA::Boolean GetToRemoveCentralPoint();
133 * To set hiden/undocumented/advanced options
135 void SetTextOption(const char* option);
136 char* GetTextOption();
138 * To define the volumic gradation
140 void SetGradation(CORBA::Double gradation);
141 CORBA::Double GetGradation();
143 * Print log in standard output
145 void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
146 CORBA::Boolean GetStandardOutputLog();
148 * Remove log file on success
150 void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
151 CORBA::Boolean GetRemoveLogOnSuccess();
153 void SetBoundaryLayersGrowth(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
154 CORBA::Short GetBoundaryLayersGrowth();
156 void SetElementGeneration(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
157 CORBA::Short GetElementGeneration();
159 void SetAddMultinormals(CORBA::Boolean toAddMultinormals);
160 CORBA::Boolean GetAddMultinormals();
162 void SetSmoothNormals(CORBA::Boolean toSmoothNormals);
163 CORBA::Boolean GetSmoothNormals();
165 void SetHeightFirstLayer(CORBA::Double toHeightFirstLayer);
166 CORBA::Double GetHeightFirstLayer();
168 void SetBoundaryLayersProgression(CORBA::Double toBoundaryLayersProgression);
169 CORBA::Double GetBoundaryLayersProgression();
171 void SetMultinormalsAngle(CORBA::Double toMultinormalsAngle);
172 CORBA::Double GetMultinormalsAngle();
174 void SetNbOfBoundaryLayers(CORBA::Short toNbOfBoundaryLayers);
175 CORBA::Short GetNbOfBoundaryLayers();
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 HYBRIDPlugin::HYBRIDEnforcedVertexList* 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 HYBRIDPlugin::HYBRIDEnforcedMeshList* GetEnforcedMeshes();
209 void ClearEnforcedMeshes();
211 // Get implementation
212 ::HYBRIDPlugin_Hypothesis* GetImpl();
214 // Verify whether hypothesis supports given entity type
215 CORBA::Boolean IsDimSupported( SMESH::Dimension type );