Fade2D Documentation pages v2.16.7
Delaunay Features
MeshGenParams.h
Go to the documentation of this file.
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
19 #pragma once
20 #include "common.h"
21 #include "Vector2.h"
22 #include "Point2.h"
23 
24 
25 #if GEOM_PSEUDO3D==GEOM_TRUE
26  namespace GEOM_FADE25D {
27 #elif GEOM_PSEUDO3D==GEOM_FALSE
28  namespace GEOM_FADE2D {
29 #else
30  #error GEOM_PSEUDO3D is not defined
31 #endif
32 
33 
34 class Triangle2; // Forward
35 class Zone2; // Forward
36 class Fade_2D; // Forward
37 class ConstraintSegment2; // Forward
39 template <typename T> inline void unusedParameter(const T&){}
40 
58 class CLASS_DECLSPEC MeshGenParams
59 {
60 public:
68  explicit MeshGenParams(Zone2* pZone_):
69 #if GEOM_PSEUDO3D==GEOM_TRUE
70  // *** These two parameters exist only in Fade2.5D ***
71  pHeightGuideTriangulation(NULL),
72  maxHeightError(DBL_MAX),
73 #endif
74  pZone(pZone_),
75  minAngleDegree(20.0),
76  minEdgeLength(1e-3),
77  maxEdgeLength(DBL_MAX),
78  maxTriangleArea(DBL_MAX),
79  bAllowConstraintSplitting(true),
80  growFactor(DBL_MAX),
81  growFactorMinArea(1e-3),
82  capAspectLimit(10.0),
83  gridLength(0.0),
84  bKeepExistingSteinerPoints(true),
85  command(0), // command is for development purposes
86  bReproducibleResults(true), // use false for better performance
87  bGridMeshingLQ(false), // use true (only together with grid-meshing) for better performance
88  psLockedConstraintSegments(NULL)
89  {
90  verify();
91 #if GEOM_PSEUDO3D==GEOM_TRUE
92  gridVector=Vector2(1.0,0.0,0.0);
93  gridPoint=Point2(DBL_MAX,DBL_MAX,DBL_MAX);
94 #else
95  gridVector=Vector2(1.0,0.0);
96  gridPoint=Point2(DBL_MAX,DBL_MAX);
97 #endif
98  }
99 
100  virtual ~MeshGenParams();
101 
102 
103 
104 
121  virtual double getMaxTriangleArea(Triangle2* pT)
122  {
123  unusedParameter(pT); // avoids useless compiler warnings
124  return maxTriangleArea;
125  }
126 
143  virtual double getMaxEdgeLength(Triangle2* pT)
144  {
145  unusedParameter(pT); // avoids useless compiler warnings
146  return maxEdgeLength;
147  }
148 
149 
150  // *** The following two parameters exist only in Fade2.5D ***
151 #if GEOM_PSEUDO3D==GEOM_TRUE
158  Fade_2D* pHeightGuideTriangulation;
164  double maxHeightError;
165 #endif
171 
186 
194 
202 
203 
217  double growFactor;
218 
254  double gridLength;
265 
267  int command;
275  void addLockedConstraint(ConstraintSegment2* pConstraintSegment);
288 
296 
298  std::set<ConstraintSegment2*>* psLockedConstraintSegments;
308 
310  void verify();
311 };
312 
313 
314 } // NAMESPACE
A ConstraintSegment2 represents a constraint edge between two vertices of a Delaunay triangulation.
Definition: ConstraintSegment2.h:71
Fade_2D is a class that contains a Delaunay triangulation.
Definition: Fade_2D.h:122
Parameters for the mesh generator.
Definition: MeshGenParams.h:59
double capAspectLimit
Aspect ratio limit for triangle refinement.
Definition: MeshGenParams.h:232
Zone2 * pZone
The Zone2 to be meshed.
Definition: MeshGenParams.h:170
double growFactor
Grow factor for adjacent triangles.
Definition: MeshGenParams.h:217
double gridLength
Grid length for meshing.
Definition: MeshGenParams.h:254
bool bAllowConstraintSplitting
Allow constraint segment splitting.
Definition: MeshGenParams.h:210
void addLockedConstraint(ConstraintSegment2 *pConstraintSegment)
Locked constraint segments that should not be split.
Vector2 gridVector
gridVector
Definition: MeshGenParams.h:241
virtual double getMaxTriangleArea(Triangle2 *pT)
Get the maximum allowed triangle area for mesh refinement.
Definition: MeshGenParams.h:121
bool bKeepExistingSteinerPoints
Steiner points from previous refinements.
Definition: MeshGenParams.h:264
bool bGridMeshingLQ
Low-quality grid meshing for high performance.
Definition: MeshGenParams.h:295
double growFactorMinArea
growFactorMinArea
Definition: MeshGenParams.h:225
bool bReproducibleResults
Flag for reproducible results.
Definition: MeshGenParams.h:287
double maxTriangleArea
maxTriangleArea
Definition: MeshGenParams.h:201
double maxEdgeLength
Maximum edge length.
Definition: MeshGenParams.h:193
MeshGenParams(Zone2 *pZone_)
Constructor for mesh generator parameters.
Definition: MeshGenParams.h:68
double minEdgeLength
Minimum edge length for triangle refinement.
Definition: MeshGenParams.h:185
Point2 gridPoint
Grid point through which the grid mesh must pass.
Definition: MeshGenParams.h:307
virtual double getMaxEdgeLength(Triangle2 *pT)
Get the maximum allowed edge length for a Triangle2.
Definition: MeshGenParams.h:143
double minAngleDegree
Minimum interior angle for triangles.
Definition: MeshGenParams.h:178
Represents a 2D point.
Definition: Point2.h:61
Represents a triangle in a triangulation.
Definition: Triangle2.h:59
Vector.
Definition: Vector2.h:47
Represents a defined area within a triangulation.
Definition: Zone2.h:82