1 // Copyright (C) 2012-2015 ALNEOS
2 // Copyright (C) 2016-2021 EDF R&D
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
22 #ifndef _GMSHPlugin_Mesher_HXX_
23 #define _GMSHPlugin_Mesher_HXX_
26 #include "GmshVersion.h"
27 #if GMSH_MAJOR_VERSION >=4
32 #include "GmshConfig.h"
33 #include "GModelIO_OCC.h"
34 #include "GModelIO_GEO.h"
36 #if GMSH_MAJOR_VERSION >=4
40 #include "GEdgeCompound.h"
41 #include "GFaceCompound.h"
45 #include "GMSHPlugin_Defs.hxx"
46 #include "StdMeshers_FaceSide.hxx"
47 #include "SMDS_MeshElement.hxx"
48 #include "SMESH_Algo.hxx"
58 //class TopTools_DataMapOfShapeShape;
59 //class TopTools_IndexedMapOfShape;
60 class GMSHPlugin_Hypothesis;
63 //=============================================================================
65 * \brief This class calls the GMSH mesher of OCC geometry
67 //=============================================================================
69 class GMSHPLUGIN_EXPORT GMSHPlugin_Mesher
72 // ---------- PUBLIC METHODS ----------
74 GMSHPlugin_Mesher (SMESH_Mesh* mesh, const TopoDS_Shape& aShape);
76 void SetParameters(const GMSHPlugin_Hypothesis* hyp);
80 bool Evaluate(MapShapeNbElems& aResMap);
82 static float DistBoundingBox(const SBoundingBox3d& bounds, const SPoint3& point);
86 const TopoDS_Shape& _shape;
96 double _minSize, _maxSize;
97 bool _secondOrder, _useIncomplElem;
101 std::set<std::string> _compounds;
103 void SetGmshOptions();
104 void CreateGmshCompounds();
107 class mymsg : public GmshMessage
112 mymsg(GModel* _gModel) : GmshMessage(), _gModel(_gModel) {}
113 void operator()(std::string level, std::string msg);