Salome HOME
Update copyrights
[plugins/ghs3dplugin.git] / src / GHS3DPlugin / GHS3DPlugin_Hypothesis_i.hxx
1 // Copyright (C) 2004-2019  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    * To make groups of volumes of different domains when mesh is generated from skin.
59    * Default is to make groups.
60    * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
61    */
62   void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
63   CORBA::Boolean GetToMakeGroupsOfDomains();
64   /*!
65    * Maximal size of memory to be used by the algorithm (in Megabytes)
66    */
67   void SetMaximumMemory(CORBA::Float MB) throw ( SALOME::SALOME_Exception );
68   CORBA::Float GetMaximumMemory();
69   /*!
70    * Initial size of memory to be used by the algorithm (in Megabytes) in
71    * automatic memory adjustment mode. Default is zero
72    */
73   void SetInitialMemory(CORBA::Float MB) throw ( SALOME::SALOME_Exception );
74   CORBA::Float GetInitialMemory();
75   /*!
76    * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
77    */
78   void SetOptimizationLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
79   CORBA::Short GetOptimizationLevel();
80   /*!
81    * Path to working directory
82    */
83   void SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception );
84   char* GetWorkingDirectory();
85   /*!
86    * To keep working files or remove them. Log file remains in case of errors anyway.
87    */
88   void SetKeepFiles(CORBA::Boolean toKeep);
89   CORBA::Boolean GetKeepFiles();
90   /*!
91    * Verbose level [0-10]
92    *  0 - no standard output,
93    *  2 - prints the data, quality statistics of the skin and final meshes and
94    *     indicates when the final mesh is being saved. In addition the software
95    *     gives indication regarding the CPU time.
96    * 10 - same as 2 plus the main steps in the computation, quality statistics
97    *     histogram of the skin mesh, quality statistics histogram together with
98    *     the characteristics of the final mesh.
99    */
100   void SetVerboseLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
101   CORBA::Short GetVerboseLevel();
102   /*!
103    * To create new nodes
104    */
105   void SetToCreateNewNodes(CORBA::Boolean toCreate);
106   CORBA::Boolean GetToCreateNewNodes();
107   /*!
108    * To use boundary recovery version which tries to create mesh on a very poor
109    * quality surface mesh
110    */
111   void SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse);
112   CORBA::Boolean GetToUseBoundaryRecoveryVersion();
113   /*!
114    * Applies finite-element correction by replacing overconstrained elements where
115    * it is possible. The process is cutting first the overconstrained edges and
116    * second the overconstrained facets. This insure that no edges have two boundary
117    * vertices and that no facets have three boundary vertices.
118    */
119   void SetFEMCorrection(CORBA::Boolean toUseFem);
120   CORBA::Boolean GetFEMCorrection();
121   /*!
122    * To removes initial central point.
123    */
124   void SetToRemoveCentralPoint(CORBA::Boolean toRemove);
125   CORBA::Boolean GetToRemoveCentralPoint();
126   /*!
127    * To set hiden/undocumented/advanced options
128    */
129   void SetAdvancedOption(const char* option);
130   char* GetAdvancedOption();
131   void SetTextOption(const char* option); // obsolete
132   char* GetTextOption();
133   /*!
134   * To define the volumic gradation
135   */
136   void SetGradation(CORBA::Double gradation);
137   CORBA::Double GetGradation();
138   /*!
139   * Print log in standard output
140   */
141   void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
142   CORBA::Boolean GetStandardOutputLog();
143   /*!
144   * Remove log file on success
145   */
146   void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
147   CORBA::Boolean GetRemoveLogOnSuccess();
148   /*!
149    * To set an enforced vertex
150    */
151   bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
152                            const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
153                            CORBA::Boolean isCompound = false) 
154     throw (SALOME::SALOME_Exception);
155   bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size) throw (SALOME::SALOME_Exception);
156   bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName) throw (SALOME::SALOME_Exception);
157   bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
158   bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName) throw (SALOME::SALOME_Exception);
159   bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size) throw (SALOME::SALOME_Exception);
160   bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
161   CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
162   CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
163   bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
164   bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
165   GHS3DPlugin::GHS3DEnforcedVertexList* GetEnforcedVertices();
166   void ClearEnforcedVertices();
167   /*!
168    * To set an enforced mesh
169    */  
170   bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName="") throw (SALOME::SALOME_Exception);
171   bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType) throw (SALOME::SALOME_Exception);
172   bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName) throw (SALOME::SALOME_Exception);
173
174   /* OBSOLETE FUNCTIONS */
175   bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size) throw (SALOME::SALOME_Exception);
176   bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
177   /* OBSOLETE FUNCTIONS */
178
179   GHS3DPlugin::GHS3DEnforcedMeshList* GetEnforcedMeshes();
180   void ClearEnforcedMeshes();
181
182   // Get implementation
183   ::GHS3DPlugin_Hypothesis* GetImpl();
184   
185   // Verify whether hypothesis supports given entity type 
186   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
187   
188
189   // Methods for copying mesh definition to other geometry
190
191   // Return geometry this hypothesis depends on. Return false if there is no geometry parameter
192   virtual bool getObjectsDependOn( std::vector< std::string > & entryArray,
193                                    std::vector< int >         & subIDArray ) const;
194
195   // Set new geometry instead of that returned by getObjectsDependOn()
196   virtual bool setObjectsDependOn( std::vector< std::string > & entryArray,
197                                    std::vector< int >         & subIDArray );
198 };
199
200 #endif