1 // Copyright (C) 2012-2015 ALNEOS
2 // Copyright (C) 2016-2024 EDF
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.alneos.com/ or email : contact@alneos.fr
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #ifndef _GMSHPlugin_Hypothesis_HXX_
22 #define _GMSHPlugin_Hypothesis_HXX_
24 #include "GmshVersion.h"
25 #include "GMSHPlugin_Defs.hxx"
27 #include "SMESH_Hypothesis.hxx"
28 #include "Utils_SALOME_Exception.hxx"
32 // Parameters for work of GMSH
35 class GMSHPLUGIN_EXPORT GMSHPlugin_Hypothesis: public SMESH_Hypothesis
39 GMSHPlugin_Hypothesis(int hypId, SMESH_Gen * gen);
48 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
49 packingparallelograms,
56 void Set2DAlgo(Algo2D the2DAlgo);
57 Algo2D Get2DAlgo() const { return _algo2d; }
69 void Set3DAlgo(Algo3D the3DAlgo);
70 Algo3D Get3DAlgo() const { return _algo3d; }
72 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
88 void SetRecomb2DAlgo(Recomb2DAlgo theRecomb2DAlgo);
89 Recomb2DAlgo GetRecomb2DAlgo() const { return _recomb2DAlgo; }
91 void SetRecombineAll(bool theRecombineAll);
92 bool GetRecombineAll() const { return _recombineAll; }
101 void SetSubdivAlgo(SubdivAlgo theSubdivAlgo);
102 SubdivAlgo GetSubdivAlgo() const { return _subdivAlgo; }
111 void SetRemeshAlgo(RemeshAlgo theRemeshAlgo);
112 RemeshAlgo GetRemeshAlgo() const { return _remeshAlgo; }
121 void SetRemeshPara(RemeshPara theRemeshPara);
122 RemeshPara GetRemeshPara() const { return _remeshPara; }
124 void SetSmouthSteps(double theSmouthSteps);
125 double GetSmouthSteps() const { return _smouthSteps; }
127 void SetSizeFactor(double theSizeFactor);
128 double GetSizeFactor() const { return _sizeFactor; }
130 void SetUseIncomplElem(bool theUseIncomplElem);
131 bool GetUseIncomplElem() const { return _useIncomplElem; }
133 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
134 void SetMeshCurvatureSize(double theMeshCurvatureSize);
135 double GetMeshCurvatureSize() const { return _meshCurvatureSize; }
138 void SetMaxSize(double theSize);
139 double GetMaxSize() const { return _maxSize; }
141 void SetMinSize(double theSize);
142 double GetMinSize() const { return _minSize; }
144 void SetSecondOrder(bool theVal);
145 bool GetSecondOrder() const { return _secondOrder; }
147 void SetIs2d(bool theIs2d);
148 bool GetIs2d() const { return _is2d; }
151 // 0: silent except for fatal errors
168 void SetVerbosityLevel(Verbosity theLevel);
169 Verbosity GetVerbosityLevel() const { return _verbLvl; }
171 typedef std::set<std::string> TCompound;
172 void SetCompoundOnEntry(const std::string& entry);
173 const TCompound& GetCompoundOnEntries() const { return _compounds; }
174 void UnsetCompoundOnEntry(const std::string& entry);
177 virtual std::ostream & SaveTo(std::ostream & save);
178 virtual std::istream & LoadFrom(std::istream & load);
181 * \brief Does nothing
182 * \param theMesh - the built mesh
183 * \param theShape - the geometry of interest
184 * \retval bool - always false
186 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
189 * \brief Initialize my parameter values by default parameters.
190 * \retval bool - true if parameter values have been successfully defined
192 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
197 Recomb2DAlgo _recomb2DAlgo;
199 SubdivAlgo _subdivAlgo;
200 RemeshAlgo _remeshAlgo;
201 RemeshPara _remeshPara;
204 #if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=10
205 double _meshCurvatureSize;
207 double _minSize, _maxSize;
208 bool _secondOrder, _useIncomplElem;
211 TCompound _compounds;