Salome HOME
e88579572e7eeae9f146812457e72b68d1ff30f4
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Hypothesis_2D.hxx
1 // Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  NETGENPlugin : C++ implementation
24 // File      : NETGENPlugin_Hypothesis_2D.hxx
25 // Author    : Michael Sazonov (OCN)
26 // Date      : 27/03/2006
27 // Project   : SALOME
28 //=============================================================================
29 //
30 #ifndef _NETGENPlugin_Hypothesis_2D_HXX_
31 #define _NETGENPlugin_Hypothesis_2D_HXX_
32
33 #include "NETGENPlugin_Defs.hxx"
34
35 #include "NETGENPlugin_Hypothesis.hxx"
36 #include "Utils_SALOME_Exception.hxx"
37
38 class SMESH_Group;
39
40 //  Parameters of NETGEN.
41 // This class is just to give 2D dimension, actually
42 // it inherits all behaviour of the parent 
43
44 class NETGENPLUGIN_EXPORT  NETGENPlugin_Hypothesis_2D: public NETGENPlugin_Hypothesis
45 {
46 public:
47
48   NETGENPlugin_Hypothesis_2D(int hypId, SMESH_Gen * gen);
49
50 // private:
51 //   bool _quadAllowed;
52 };
53
54
55 //  Parameters of NETGEN remesher
56 //
57
58 class NETGENPLUGIN_EXPORT NETGENPlugin_RemesherHypothesis_2D: public NETGENPlugin_Hypothesis
59 {
60  public:
61
62   NETGENPlugin_RemesherHypothesis_2D(int hypId, SMESH_Gen * gen);
63
64   void   SetRidgeAngle( double angle );
65   double GetRidgeAngle() const{ return _ridgeAngle; }
66
67   void   SetEdgeCornerAngle( double angle );
68   double GetEdgeCornerAngle() const { return _edgeCornerAngle; }
69
70   void   SetChartAngle( double angle );
71   double GetChartAngle() const { return _chartAngle; }
72
73   void   SetOuterChartAngle( double angle );
74   double GetOuterChartAngle() const { return _outerChartAngle; }
75
76   void   SetRestHChartDistFactor( double f );
77   double GetRestHChartDistFactor() const { return _restHChartDistFactor; }
78
79   void   SetRestHChartDistEnable( bool enable );
80   bool   GetRestHChartDistEnable() const { return _restHChartDistEnable; }
81
82   void   SetRestHLineLengthFactor( double f );
83   double GetRestHLineLengthFactor() const { return _restHLineLengthFactor; }
84
85   void   SetRestHLineLengthEnable( bool enable );
86   bool   GetRestHLineLengthEnable() const { return _restHLineLengthEnable; }
87
88   void   SetRestHCloseEdgeFactor( double f );
89   double GetRestHCloseEdgeFactor() const { return _restHCloseEdgeFactor; }
90
91   void   SetRestHCloseEdgeEnable( bool enable );
92   bool   GetRestHCloseEdgeEnable() const { return _restHCloseEdgeEnable; }
93
94   void   SetRestHSurfCurvFactor( double f );
95   double GetRestHSurfCurvFactor() const { return _restHSurfCurvFactor; }
96
97   void   SetRestHSurfCurvEnable( bool enable );
98   bool   GetRestHSurfCurvEnable() const { return _restHSurfCurvEnable; }
99
100   void   SetRestHEdgeAngleFactor( double f );
101   double GetRestHEdgeAngleFactor() const { return _restHEdgeAngleFactor; }
102
103   void   SetRestHEdgeAngleEnable( bool enable );
104   bool   GetRestHEdgeAngleEnable() const { return _restHEdgeAngleEnable; }
105
106   void   SetRestHSurfMeshCurvFactor( double f );
107   double GetRestHSurfMeshCurvFactor() const { return _restHSurfMeshCurvFactor; }
108
109   void   SetRestHSurfMeshCurvEnable( bool enable );
110   bool   GetRestHSurfMeshCurvEnable() const { return _restHSurfMeshCurvEnable; }
111
112   void   SetKeepExistingEdges( bool toKeep );
113   bool   GetKeepExistingEdges() const { return _keepExistingEdges; }
114
115   void   SetMakeGroupsOfSurfaces( bool toMake );
116   bool   GetMakeGroupsOfSurfaces() const { return _makeGroupsOfSurfaces; }
117
118   void   SetFixedEdgeGroup( const SMESH_Group* edgeGroup );
119   int    GetFixedEdgeGroupID() const { return _fixedEdgeGroupID; }
120   SMESH_Group* GetFixedEdgeGroup( const SMESH_Mesh& mesh ) const;
121
122   void   SetLoadMeshOnCancel( bool toLoad );
123   bool   GetLoadMeshOnCancel() const { return _loadOnCancel; }
124
125   static double DefaultRidgeAngle()              { return 30.; }
126   static double DefaultEdgeCornerAngle()         { return 60.; }
127   static double DefaultChartAngle()              { return 15.; }
128   static double DefaultOuterChartAngle()         { return 70.; }
129   static double DefaultRestHChartDistFactor()    { return 1.2; }
130   static bool   DefaultRestHChartDistEnable()    { return true; }
131   static double DefaultRestHLineLengthFactor()   { return 0.5; }
132   static bool   DefaultRestHLineLengthEnable()   { return true; }
133   static double DefaultRestHCloseEdgeFactor()    { return 1.; }
134   static bool   DefaultRestHCloseEdgeEnable()    { return true; }
135   static double DefaultRestHSurfCurvFactor()     { return 1.; }
136   static bool   DefaultRestHSurfCurvEnable()     { return false; }
137   static double DefaultRestHEdgeAngleFactor()    { return 1.; }
138   static bool   DefaultRestHEdgeAngleEnable()    { return false; }
139   static double DefaultRestHSurfMeshCurvFactor() { return 1.; }
140   static bool   DefaultRestHSurfMeshCurvEnable() { return false; }
141   static bool   DefaultKeepExistingEdges()       { return false; }
142   static bool   DefaultMakeGroupsOfSurfaces()    { return false; }
143
144   virtual std::ostream & SaveTo(std::ostream & save);
145   virtual std::istream & LoadFrom(std::istream & load);
146
147  private:
148
149   // STL charts
150   double _ridgeAngle; // yellow edges angle (in degrees)
151   double _edgeCornerAngle;
152   double _chartAngle;
153   double _outerChartAngle;
154
155   // Mesh size: restrict h due to ...
156   double _restHChartDistFactor;    // chart distance
157   bool   _restHChartDistEnable;
158   double _restHLineLengthFactor;   // line length
159   bool   _restHLineLengthEnable;
160   double _restHCloseEdgeFactor;    // close edges
161   bool   _restHCloseEdgeEnable;
162   double _restHSurfCurvFactor;     // surface curvature
163   bool   _restHSurfCurvEnable;
164   double _restHEdgeAngleFactor;    // edge angle
165   bool   _restHEdgeAngleEnable;
166   double _restHSurfMeshCurvFactor; // surface mesh curv
167   bool   _restHSurfMeshCurvEnable;
168
169   // SALOME features
170   bool   _keepExistingEdges;
171   bool   _makeGroupsOfSurfaces;
172   int    _fixedEdgeGroupID;
173   bool   _loadOnCancel;
174
175 };
176
177 #endif