Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.74
MeshGenParams.h
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 
18 
19 #pragma once
20 #include "common.h"
21 #include "Zone2.h"
22 
23 #if GEOM_PSEUDO3D==GEOM_TRUE
24  namespace GEOM_FADE25D {
25 #elif GEOM_PSEUDO3D==GEOM_FALSE
26  namespace GEOM_FADE2D {
27 #else
28  #error GEOM_PSEUDO3D is not defined
29 #endif
30 
31 
32 
33 class Fade_2D; // Forward
34 class ConstraintSegment2; // Forward
35 template <typename T> inline void unusedParameter(const T&){} // Avoids compiler warnings
36 
37 
38 
51 class CLASS_DECLSPEC MeshGenParams
52 {
53 public:
54  explicit MeshGenParams(Zone2* pZone_):
55 #if GEOM_PSEUDO3D==GEOM_TRUE
56  // *** These two parameters exist only in Fade2.5D ***
57  pHeightGuideTriangulation(NULL),
58  maxHeightError(DBL_MAX),
59 #endif
60  pZone(pZone_),
61  minAngleDegree(20.0),
62  minEdgeLength(1e-3),
63  maxEdgeLength(DBL_MAX),
64  maxTriangleArea(DBL_MAX),
65  bAllowConstraintSplitting(true),
66  growFactor(DBL_MAX),
67  growFactorMinArea(1e-3),
68  capAspectLimit(10.0),
69  gridLength(0.0),
70  bKeepExistingSteinerPoints(true),
71  command(0), // command is for development purposes
72  psLockedConstraintSegments(NULL)
73  {
74  if( pZone->getZoneLocation()!=ZL_INSIDE &&
75  pZone->getZoneLocation()!=ZL_BOUNDED )
76  {
77  std::cerr<<"\n\n\nMeshGenParams::MeshGenParams(..), ERROR: \n\tbehavior since Fade 1.39: The zoneLocation must be ZL_INSIDE or ZL_BOUNDED. Please convert the zone using pZone->convertToBoundedZone(..)\n\n"<<std::endl;
78  assert(false);
79  return;
80  }
81 #if GEOM_PSEUDO3D==GEOM_TRUE
82  gridVector=Vector2(1.0,0.0,0.0);
83 #else
84  gridVector=Vector2(1.0,0.0);
85 #endif
86  }
87 
88  virtual ~MeshGenParams();
89 
90 
91 
104  virtual double getMaxTriangleArea(Triangle2* pT)
105  {
106  unusedParameter(pT); // avoids useless compiler warnings
107  return maxTriangleArea;
108  }
109 
110 
123  virtual double getMaxEdgeLength(Triangle2* pT)
124  {
125  unusedParameter(pT); // avoids useless compiler warnings
126  return maxEdgeLength;
127  }
128 
129 
130  // *** The following two parameters exist only in Fade2.5D ***
131 #if GEOM_PSEUDO3D==GEOM_TRUE
132 
141  Fade_2D* pHeightGuideTriangulation;
142 
148  double maxHeightError;
149 #endif
150 
151 
152 
153 
157 
163 
170 
180 
181 
190 
191 
197 
204  double growFactor;
205 
213 
219 
220 
235 
249  double gridLength;
250 
261 
266  int command;
267 
274  void addLockedConstraint(ConstraintSegment2* pConstraintSegment);
275 
276 
277 
279  std::set<ConstraintSegment2*>* psLockedConstraintSegments;
280 };
281 
282 
283 } // NAMESPACE
Delaunay triangulation - the main class.
Definition: Fade_2D.h:63
virtual double getMaxTriangleArea(Triangle2 *pT)
getMaxTriangleArea(Triangle2* pT)
Definition: MeshGenParams.h:104
double growFactor
growFactor
Definition: MeshGenParams.h:204
double maxTriangleArea
maxTriangleArea
Definition: MeshGenParams.h:189
bool bAllowConstraintSplitting
bAllowConstraintSplitting
Definition: MeshGenParams.h:196
Zone2 is an exactly defined area of a triangulation.
Definition: Zone2.h:49
bool bKeepExistingSteinerPoints
Steiner points from previous refinements.
Definition: MeshGenParams.h:260
double growFactorMinArea
growFactorMinArea
Definition: MeshGenParams.h:212
Vector.
Definition: Vector2.h:34
double capAspectLimit
capAspectLimit
Definition: MeshGenParams.h:218
int command
Command.
Definition: MeshGenParams.h:266
Parameters for the mesh generator.
Definition: MeshGenParams.h:51
virtual double getMaxEdgeLength(Triangle2 *pT)
getMaxEdgeLength(Triangle2* pT)
Definition: MeshGenParams.h:123
Vector2 gridVector
gridVector
Definition: MeshGenParams.h:234
Zone2 * pZone
Zone to be meshed.
Definition: MeshGenParams.h:156
A ConstraintSegment2 represents a Constraint Edge.
Definition: ConstraintSegment2.h:74
double gridLength
gridLength
Definition: MeshGenParams.h:249
double maxEdgeLength
Maximum edge length.
Definition: MeshGenParams.h:179
Triangle.
Definition: Triangle2.h:48
double minEdgeLength
Minimum edge length.
Definition: MeshGenParams.h:169
double minAngleDegree
Minimum interior triangle angle.
Definition: MeshGenParams.h:162
Definition: Bbox2.h:25