Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.56
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 template <typename T> inline void unusedParameter(const T&){} // Avoids compiler warnings
35 
36 
37 
50 class CLASS_DECLSPEC MeshGenParams
51 {
52 public:
53  explicit MeshGenParams(Zone2* pZone_):
54 #if GEOM_PSEUDO3D==GEOM_TRUE
55  // *** The following two parameters exist only in Fade2.5D ***
56  pHeightGuideTriangulation(NULL),
57  maxHeightError(DBL_MAX),
58 #endif
59  pZone(pZone_),
60  minAngleDegree(20.0),
61  minEdgeLength(1e-3),
62  maxEdgeLength(DBL_MAX),
63  maxTriangleArea(DBL_MAX),
64  bAllowConstraintSplitting(true),
65  growFactor(DBL_MAX),
66  growFactorMinArea(1e-3),
67  capAspectLimit(10.0),
68  gridLength(0.0),
69  command(0) // command is for development purposes and will vanish soon.
70  {
71  if( pZone->getZoneLocation()!=ZL_INSIDE &&
72  pZone->getZoneLocation()!=ZL_BOUNDED )
73  {
74  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;
75  assert(false);
76  return;
77  }
78  }
79 
80  virtual ~MeshGenParams()
81  {
82 #if GEOM_PSEUDO3D==GEOM_TRUE
83  gridVector=Vector2(1.0,0.0,0.0);
84 #else
85  gridVector=Vector2(1.0,0.0);
86 #endif
87  }
88 
89 
90 
103  virtual double getMaxTriangleArea(Triangle2* pT)
104  {
105  unusedParameter(pT); // avoids useless compiler warnings
106  return maxTriangleArea;
107  }
108 
109 
122  virtual double getMaxEdgeLength(Triangle2* pT)
123  {
124  unusedParameter(pT); // avoids useless compiler warnings
125  return maxEdgeLength;
126  }
127 
128 
129  // *** The following two parameters exist only in Fade2.5D ***
130 #if GEOM_PSEUDO3D==GEOM_TRUE
131 
140  Fade_2D* pHeightGuideTriangulation;
141 
147  double maxHeightError;
148 #endif
149 
150 
151 
152 
156 
162 
169 
179 
180 
189 
190 
196 
203  double growFactor;
204 
212 
218 
219 
234 
248  double gridLength;
249 
254  int command;
255 };
256 
257 
258 } // NAMESPACE
Delaunay triangulation - the main class.
Definition: Fade_2D.h:63
virtual double getMaxTriangleArea(Triangle2 *pT)
getMaxTriangleArea(Triangle2* pT)
Definition: MeshGenParams.h:103
double growFactor
growFactor
Definition: MeshGenParams.h:203
double maxTriangleArea
maxTriangleArea
Definition: MeshGenParams.h:188
bool bAllowConstraintSplitting
bAllowConstraintSplitting
Definition: MeshGenParams.h:195
Zone2 is an exactly defined area of a triangulation.
Definition: Zone2.h:48
double growFactorMinArea
growFactorMinArea
Definition: MeshGenParams.h:211
Vector.
Definition: Vector2.h:37
double capAspectLimit
capAspectLimit
Definition: MeshGenParams.h:217
int command
Command.
Definition: MeshGenParams.h:254
Parameters for the mesh generator.
Definition: MeshGenParams.h:50
virtual double getMaxEdgeLength(Triangle2 *pT)
getMaxEdgeLength(Triangle2* pT)
Definition: MeshGenParams.h:122
Vector2 gridVector
gridVector
Definition: MeshGenParams.h:233
Zone2 * pZone
Zone to be meshed.
Definition: MeshGenParams.h:155
double gridLength
gridLength
Definition: MeshGenParams.h:248
double maxEdgeLength
Maximum edge length.
Definition: MeshGenParams.h:178
Triangle.
Definition: Triangle2.h:48
double minEdgeLength
Minimum edge length.
Definition: MeshGenParams.h:168
double minAngleDegree
Minimum interior triangle angle.
Definition: MeshGenParams.h:161
Definition: Bbox2.h:25