Salome HOME
partial work for netgen2d in run_mesher + corrections for netgen3d nodeVec + restorin...
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_NETGEN_2D_ONLY.hxx
1 // Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
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 // File      : NETGENPlugin_NETGEN_2D_ONLY.hxx
21 // Project   : SALOME
22 // Author    : Edward AGAPOV (OCC)
23 //
24 #ifndef _NETGENPlugin_NETGEN_2D_ONLY_HXX_
25 #define _NETGENPlugin_NETGEN_2D_ONLY_HXX_
26
27 #include <SMESH_Algo.hxx>
28 #include <SMESH_Mesh.hxx>
29
30 class StdMeshers_MaxElementArea;
31 class StdMeshers_LengthFromEdges;
32 class NETGENPlugin_Hypothesis_2D;
33 class NETGENPlugin_Hypothesis;
34 class netgen_params;
35
36 /*!
37  * \brief Mesher generating 2D elements on a geometrical face taking
38  * into account pre-existing nodes on face boundaries
39  *
40  * Historically, NETGENPlugin_NETGEN_2D is actually 1D-2D, that is why
41  * the class is named NETGENPlugin_NETGEN_2D_ONLY. Renaming is useless as
42  * algorithm field "_name" can't be changed
43  */
44 class NETGENPlugin_NETGEN_2D_ONLY: public SMESH_2D_Algo
45 {
46 public:
47   NETGENPlugin_NETGEN_2D_ONLY(int hypId, SMESH_Gen* gen);
48   virtual ~NETGENPlugin_NETGEN_2D_ONLY();
49
50   virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
51                                const TopoDS_Shape& aShape,
52                                Hypothesis_Status&  aStatus);
53
54   void exportElementOrientation(SMESH_Mesh& aMesh,
55                                 const TopoDS_Shape& aShape,
56                                 netgen_params& aParams,
57                                 const std::string output_file);
58
59   void FillParameters(const NETGENPlugin_Hypothesis* hyp,
60                       netgen_params &aParams);
61
62   virtual bool RemoteCompute(SMESH_Mesh&         aMesh,
63                              const TopoDS_Shape& aShape);
64   virtual bool Compute(SMESH_Mesh&         aMesh,
65                        const TopoDS_Shape& aShape);
66
67   virtual void CancelCompute();
68
69   virtual double GetProgress() const;
70
71   virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
72                         MapShapeNbElems& aResMap);
73
74 protected:
75   const StdMeshers_MaxElementArea*       _hypMaxElementArea;
76   const StdMeshers_LengthFromEdges*      _hypLengthFromEdges;
77   const SMESHDS_Hypothesis*              _hypQuadranglePreference;
78   const NETGENPlugin_Hypothesis_2D*      _hypParameters;
79
80   double                                 _progressByTic;
81 };
82
83 #endif