1 // Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // NETGENPlugin : C++ implementation
24 // File : NETGENPlugin_Hypothesis_2D.hxx
25 // Author : Michael Sazonov (OCN)
28 //=============================================================================
30 #ifndef _NETGENPlugin_Hypothesis_2D_HXX_
31 #define _NETGENPlugin_Hypothesis_2D_HXX_
33 #include "NETGENPlugin_Defs.hxx"
35 #include "NETGENPlugin_Hypothesis.hxx"
36 #include "Utils_SALOME_Exception.hxx"
40 // Parameters of NETGEN.
41 // This class is just to give 2D dimension, actually
42 // it inherits all behaviour of the parent
44 class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D: public NETGENPlugin_Hypothesis
48 NETGENPlugin_Hypothesis_2D(int hypId, SMESH_Gen * gen);
55 // Parameters of NETGEN remesher
58 class NETGENPLUGIN_EXPORT NETGENPlugin_RemesherHypothesis_2D: public NETGENPlugin_Hypothesis
62 NETGENPlugin_RemesherHypothesis_2D(int hypId, SMESH_Gen * gen);
64 void SetRidgeAngle( double angle );
65 double GetRidgeAngle() const{ return _ridgeAngle; }
67 void SetEdgeCornerAngle( double angle );
68 double GetEdgeCornerAngle() const { return _edgeCornerAngle; }
70 void SetChartAngle( double angle );
71 double GetChartAngle() const { return _chartAngle; }
73 void SetOuterChartAngle( double angle );
74 double GetOuterChartAngle() const { return _outerChartAngle; }
76 void SetRestHChartDistFactor( double f );
77 double GetRestHChartDistFactor() const { return _restHChartDistFactor; }
79 void SetRestHChartDistEnable( bool enable );
80 bool GetRestHChartDistEnable() const { return _restHChartDistEnable; }
82 void SetRestHLineLengthFactor( double f );
83 double GetRestHLineLengthFactor() const { return _restHLineLengthFactor; }
85 void SetRestHLineLengthEnable( bool enable );
86 bool GetRestHLineLengthEnable() const { return _restHLineLengthEnable; }
88 void SetRestHCloseEdgeFactor( double f );
89 double GetRestHCloseEdgeFactor() const { return _restHCloseEdgeFactor; }
91 void SetRestHCloseEdgeEnable( bool enable );
92 bool GetRestHCloseEdgeEnable() const { return _restHCloseEdgeEnable; }
94 void SetRestHSurfCurvFactor( double f );
95 double GetRestHSurfCurvFactor() const { return _restHSurfCurvFactor; }
97 void SetRestHSurfCurvEnable( bool enable );
98 bool GetRestHSurfCurvEnable() const { return _restHSurfCurvEnable; }
100 void SetRestHEdgeAngleFactor( double f );
101 double GetRestHEdgeAngleFactor() const { return _restHEdgeAngleFactor; }
103 void SetRestHEdgeAngleEnable( bool enable );
104 bool GetRestHEdgeAngleEnable() const { return _restHEdgeAngleEnable; }
106 void SetRestHSurfMeshCurvFactor( double f );
107 double GetRestHSurfMeshCurvFactor() const { return _restHSurfMeshCurvFactor; }
109 void SetRestHSurfMeshCurvEnable( bool enable );
110 bool GetRestHSurfMeshCurvEnable() const { return _restHSurfMeshCurvEnable; }
112 void SetKeepExistingEdges( bool toKeep );
113 bool GetKeepExistingEdges() const { return _keepExistingEdges; }
115 void SetMakeGroupsOfSurfaces( bool toMake );
116 bool GetMakeGroupsOfSurfaces() const { return _makeGroupsOfSurfaces; }
118 void SetFixedEdgeGroup( const SMESH_Group* edgeGroup );
119 int GetFixedEdgeGroupID() const { return _fixedEdgeGroupID; }
120 SMESH_Group* GetFixedEdgeGroup( const SMESH_Mesh& mesh ) const;
122 void SetLoadMeshOnCancel( bool toLoad );
123 bool GetLoadMeshOnCancel() const { return _loadOnCancel; }
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; }
144 virtual std::ostream & SaveTo(std::ostream & save);
145 virtual std::istream & LoadFrom(std::istream & load);
150 double _ridgeAngle; // yellow edges angle (in degrees)
151 double _edgeCornerAngle;
153 double _outerChartAngle;
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;
170 bool _keepExistingEdges;
171 bool _makeGroupsOfSurfaces;
172 int _fixedEdgeGroupID;