Salome HOME
with hybrid parameters
[plugins/hybridplugin.git] / src / HYBRIDPlugin / HYBRIDPlugin_Hypothesis_i.hxx
1 // Copyright (C) 2004-2013  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.
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 //  HYBRIDPlugin : C++ implementation
21 // File      : HYBRIDPlugin_Hypothesis_i.hxx
22 // Date      : 03/04/2006
23 // Project   : SALOME
24 //
25 #ifndef _HYBRIDPlugin_Hypothesis_i_HXX_
26 #define _HYBRIDPlugin_Hypothesis_i_HXX_
27
28 #include "HYBRIDPlugin_Defs.hxx"
29
30 #include <SALOMEconfig.h>
31 #include CORBA_SERVER_HEADER(HYBRIDPlugin_Algorithm)
32
33 #include "SMESH_Hypothesis_i.hxx"
34 #include "SMESH_Mesh_i.hxx"
35 #include "HYBRIDPlugin_Hypothesis.hxx"
36
37 class SMESH_Gen;
38
39 // HYBRIDPlugin parameters hypothesis
40
41 class HYBRIDPLUGIN_EXPORT HYBRIDPlugin_Hypothesis_i:
42   public virtual POA_HYBRIDPlugin::HYBRIDPlugin_Hypothesis,
43   public virtual SMESH_Hypothesis_i
44 {
45  public:
46   // Constructor
47   HYBRIDPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
48                             int                     theStudyId,
49                             ::SMESH_Gen*            theGenImpl);
50   // Destructor
51   virtual ~HYBRIDPlugin_Hypothesis_i();
52
53   /*!
54    * To mesh "holes" in a solid or not. Default is to mesh.
55    */
56   void SetToMeshHoles(CORBA::Boolean toMesh);
57   CORBA::Boolean GetToMeshHoles();
58   /*!
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
62    */
63   void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
64   CORBA::Boolean GetToMakeGroupsOfDomains();
65   /*!
66    * Maximal size of memory to be used by the algorithm (in Megabytes)
67    */
68   void SetMaximumMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
69   CORBA::Double GetMaximumMemory();
70   /*!
71    * Initial size of memory to be used by the algorithm (in Megabytes) in
72    * automatic memory adjustment mode. Default is zero
73    */
74   void SetInitialMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
75   CORBA::Double GetInitialMemory();
76   /*!
77    * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
78    */
79   void SetOptimizationLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
80   CORBA::Short GetOptimizationLevel();
81   /*!
82    * Path to working directory
83    */
84   void SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception );
85   char* GetWorkingDirectory();
86   /*!
87    * To keep working files or remove them. Log file remains in case of errors anyway.
88    */
89   void SetKeepFiles(CORBA::Boolean toKeep);
90   CORBA::Boolean GetKeepFiles();
91   /*!
92    * Verbose level [0-10]
93    *  0 - no standard output,
94    *  2 - prints the data, quality statistics of the skin and final meshes and
95    *     indicates when the final mesh is being saved. In addition the software
96    *     gives indication regarding the CPU time.
97    * 10 - same as 2 plus the main steps in the computation, quality statistics
98    *     histogram of the skin mesh, quality statistics histogram together with
99    *     the characteristics of the final mesh.
100    */
101   void SetVerboseLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
102   CORBA::Short GetVerboseLevel();
103   /*!
104    * To create new nodes
105    */
106   void SetToCreateNewNodes(CORBA::Boolean toCreate);
107   CORBA::Boolean GetToCreateNewNodes();
108   /*!
109    * To use boundary recovery version which tries to create mesh on a very poor
110    * quality surface mesh
111    */
112   void SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse);
113   CORBA::Boolean GetToUseBoundaryRecoveryVersion();
114   /*!
115    * Applies finite-element correction by replacing overconstrained elements where
116    * it is possible. The process is cutting first the overconstrained edges and
117    * second the overconstrained facets. This insure that no edges have two boundary
118    * vertices and that no facets have three boundary vertices.
119    */
120   void SetFEMCorrection(CORBA::Boolean toUseFem);
121   CORBA::Boolean GetFEMCorrection();
122   /*!
123    * To removes initial central point.
124    */
125   void SetToRemoveCentralPoint(CORBA::Boolean toRemove);
126   CORBA::Boolean GetToRemoveCentralPoint();
127   /*!
128    * To set hiden/undocumented/advanced options
129    */
130   void SetTextOption(const char* option);
131   char* GetTextOption();
132   /*!
133   * To define the volumic gradation
134   */
135   void SetGradation(CORBA::Double gradation);
136   CORBA::Double GetGradation();
137   /*!
138   * Print log in standard output
139   */
140   void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
141   CORBA::Boolean GetStandardOutputLog();
142   /*!
143   * Remove log file on success
144   */
145   void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
146   CORBA::Boolean GetRemoveLogOnSuccess();
147   
148   void SetBoundaryLayersInward(CORBA::Boolean toBoundaryLayersInward);
149   CORBA::Boolean GetBoundaryLayersInward();
150
151   void SetElemGenTetraDominant(CORBA::Boolean toElemGenTetraDominant);
152   CORBA::Boolean GetElemGenTetraDominant();
153
154   void SetAddMultinormals(CORBA::Boolean toAddMultinormals);
155   CORBA::Boolean GetAddMultinormals();
156
157   void SetSmoothNormals(CORBA::Boolean toSmoothNormals);
158   CORBA::Boolean GetSmoothNormals();
159
160   void SetHeightFirstLayer(CORBA::Double toHeightFirstLayer);
161   CORBA::Double GetHeightFirstLayer();
162
163   void SetBoundaryLayersProgression(CORBA::Double toBoundaryLayersProgression);
164   CORBA::Double GetBoundaryLayersProgression();
165   
166   void SetMultinormalsAngle(CORBA::Double toMultinormalsAngle);
167   CORBA::Double GetMultinormalsAngle();
168   
169   void SetNbOfBoundaryLayers(CORBA::Short toNbOfBoundaryLayers);
170   CORBA::Short GetNbOfBoundaryLayers();
171
172   /*!
173    * To set an enforced vertex
174    */
175   bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
176                            const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
177                            CORBA::Boolean isCompound = false) 
178     throw (SALOME::SALOME_Exception);
179   bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size) throw (SALOME::SALOME_Exception);
180   bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName) throw (SALOME::SALOME_Exception);
181   bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
182   bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName) throw (SALOME::SALOME_Exception);
183   bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size) throw (SALOME::SALOME_Exception);
184   bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
185   CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
186   CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
187   bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
188   bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
189   HYBRIDPlugin::HYBRIDEnforcedVertexList* GetEnforcedVertices();
190   void ClearEnforcedVertices();
191   /*!
192    * To set an enforced mesh
193    */  
194   bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName="") throw (SALOME::SALOME_Exception);
195   bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType) throw (SALOME::SALOME_Exception);
196   bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName) throw (SALOME::SALOME_Exception);
197
198   /* OBSOLETE FUNCTIONS */
199   bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size) throw (SALOME::SALOME_Exception);
200   bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
201   /* OBSOLETE FUNCTIONS */
202
203   HYBRIDPlugin::HYBRIDEnforcedMeshList* GetEnforcedMeshes();
204   void ClearEnforcedMeshes();
205
206   // Get implementation
207   ::HYBRIDPlugin_Hypothesis* GetImpl();
208   
209   // Verify whether hypothesis supports given entity type 
210   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
211   
212 };
213
214 #endif