Overture  Version 25
TriangleWrapper.h
Go to the documentation of this file.
1 #ifndef __OV_TRIANGLEWRAPPER_H__
2 #define __OV_TRIANGLEWRAPPER_H__
3 
4 #include "aString.H"
5 // AP #include "Overture.h"
6 #include "OvertureTypes.h"
7 #include "wdhdefs.h" // for sPrintF, etc.
8 #include "mathutil.h" // for min, max, etc.
9 
11 {
12 
13 public:
14  TriangleWrapperParameters( real minAng=-1, bool freeze=false, real maxA=-1, bool vor=true,
15  bool neighbours=false, bool quiet=true, int verbose=0 ) :
16  minAngle(minAng), freezeSegments(freeze), maxArea(maxA), voronoi(vor), saveNeighbours(neighbours),
17  quietMode(quiet), verboseMode(verbose) { }
18 
20  minAngle(triw.minAngle), freezeSegments(triw.freezeSegments), maxArea(triw.maxArea) { }
21 
23 
24  void setMinimumAngle(real angle) { minAngle = angle; }
25  void toggleFreezeSegments() { freezeSegments = !freezeSegments; }
26  void setMaximumArea(real area) { maxArea = area; }
27  void toggleVoronoi() { voronoi = !voronoi; }
28  void saveVoronoi(bool trueOrFalse=true){ voronoi=trueOrFalse; }
29  void saveNeighbourList(bool trueOrFalse=true){ saveNeighbours=trueOrFalse; }
30  void setQuietMode(bool trueOrFalse=true){ quietMode=trueOrFalse; }
31  // turn on verbose mode, level=1 is "V", level=2 is "VV" level=3 is "VVV"
32  void setVerboseMode(int level){ verboseMode=level; }
33 
34  real getMinimumAngle() const { return minAngle; }
35  bool getFreezeSegments() const { return freezeSegments; }
36  real getMaximumArea() const { return maxArea; }
37  bool getVoronoi() const { return voronoi; }
38  bool getSaveNeighbours() { return saveNeighbours; }
39 
41 
42 private:
43 
44  real minAngle;
45  bool freezeSegments;
46  real maxArea;
47  bool voronoi;
48  bool saveNeighbours;
49  bool quietMode;
50  int verboseMode;
51 
52 };
53 
54 
56 {
57 
58 public:
59 
61 
62  TriangleWrapper( intArray & faces, realArray & xyz )
63  { initialize( faces, xyz ) ; }
64 
66 
67  void initialize( const intArray & faces, const realArray & xyz );
68  void setHoles( const realArray &holes );
69  void generate();
70 
72 
73  int getNumberOfEdges() const { return numberOfEdges; } //
74  int getNumberOfBoundaryEdges() const { return numberOfBoundaryEdges; } //
75 
76  const intArray & generateElementList() const { return triangles; }
77  const realArray & getPoints() const { return points; }
78  const intArray & getInitialFaces2TriangleMapping() const { return initialFaces2TriangleMapping; }
79  const intArray & getNeighbours() const { return neighbours; }
80 
81 protected:
83 
84 private:
85  intArray initialFaces;
86  realArray initialPoints;
87  realArray holes;
88 
89  intArray triangles;
90  realArray points;
91  intArray initialFaces2TriangleMapping;
92  intArray neighbours;
93 
94  int numberOfEdges, numberOfBoundaryEdges;
95 
96 };
97 
98 #endif