Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.52
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 
48 class CLASS_DECLSPEC MeshGenParams
49 {
50 public:
51  explicit MeshGenParams(Zone2* pZone_):
52 #if GEOM_PSEUDO3D==GEOM_TRUE
53  // *** The following two parameters exist only in Fade2.5D ***
54  pHeightGuideTriangulation(NULL),
55  maxHeightError(DBL_MAX),
56 #endif
57  pZone(pZone_),
58  minAngleDegree(20.0),
59  minEdgeLength(1e-3),
60  maxEdgeLength(DBL_MAX),
61  maxTriangleArea(DBL_MAX),
62  bAllowConstraintSplitting(true),
63  growFactor(DBL_MAX),
64  growFactorMinArea(1e-3),
65  capAspectLimit(10.0),
66  gridLength(0.0),
67  command(0) // command is for development purposes and will vanish soon.
68  {
69  if( pZone->getZoneLocation()!=ZL_INSIDE &&
70  pZone->getZoneLocation()!=ZL_BOUNDED )
71  {
72  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;
73  assert(false);
74  return;
75  }
76  }
77 
78  virtual ~MeshGenParams()
79  {
80 #if GEOM_PSEUDO3D==GEOM_TRUE
81  gridVector=Vector2(1.0,0.0,0.0);
82 #else
83  gridVector=Vector2(1.0,0.0);
84 #endif
85  }
86 
87 
88 
101  virtual double getMaxTriangleArea(Triangle2* pT)
102  {
103  unusedParameter(pT); // avoids useless compiler warnings
104  return maxTriangleArea;
105  }
106 
107 
120  virtual double getMaxEdgeLength(Triangle2* pT)
121  {
122  unusedParameter(pT); // avoids useless compiler warnings
123  return maxEdgeLength;
124  }
125 
126 
127  // *** The following two parameters exist only in Fade2.5D ***
128 #if GEOM_PSEUDO3D==GEOM_TRUE
129 
138  Fade_2D* pHeightGuideTriangulation;
139 
145  double maxHeightError;
146 #endif
147 
148 
149 
150 
154 
160 
167 
177 
178 
187 
188 
194 
201  double growFactor;
202 
210 
216 
217 
232 
246  double gridLength;
247 
252  int command;
253 };
254 
255 
256 } // NAMESPACE
Delaunay triangulation - the main class.
Definition: Fade_2D.h:63
virtual double getMaxTriangleArea(Triangle2 *pT)
getMaxTriangleArea(Triangle2* pT)
Definition: MeshGenParams.h:101
double growFactor
growFactor
Definition: MeshGenParams.h:201
double maxTriangleArea
maxTriangleArea
Definition: MeshGenParams.h:186
bool bAllowConstraintSplitting
bAllowConstraintSplitting
Definition: MeshGenParams.h:193
Area in a triangulation.
Definition: Zone2.h:47
double growFactorMinArea
growFactorMinArea
Definition: MeshGenParams.h:209
Vector.
Definition: Vector2.h:37
double capAspectLimit
capAspectLimit
Definition: MeshGenParams.h:215
int command
Command.
Definition: MeshGenParams.h:252
Parameters for the mesh generator.
Definition: MeshGenParams.h:48
virtual double getMaxEdgeLength(Triangle2 *pT)
getMaxEdgeLength(Triangle2* pT)
Definition: MeshGenParams.h:120
Vector2 gridVector
gridVector
Definition: MeshGenParams.h:231
Zone2 * pZone
Zone to be meshed.
Definition: MeshGenParams.h:153
double gridLength
gridLength
Definition: MeshGenParams.h:246
double maxEdgeLength
Maximum edge length.
Definition: MeshGenParams.h:176
Triangle.
Definition: Triangle2.h:48
double minEdgeLength
Minimum edge length.
Definition: MeshGenParams.h:166
double minAngleDegree
Minimum interior triangle angle.
Definition: MeshGenParams.h:159
Definition: Bbox2.h:25