OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Mesher.h
Go to the documentation of this file.
1 #ifndef MESHER_H
2 #define MESHER_H
3 
4 #include "Algorithms/Vektor.h"
6 
7 class Mesher {
8 public:
9  Mesher(std::vector<Vector_t> &vertices);
10 
11  std::vector<mslang::Triangle> getTriangles() const;
12 
13 private:
14  void orientVerticesCCW();
15  bool isConvex(unsigned int i) const;
16  double crossProduct(const Vector_t &a,
17  const Vector_t &b) const;
18  bool isPointOnLine(unsigned int i,
19  unsigned int j,
20  const Vector_t &pt) const;
21  bool isPointRightOfLine(unsigned int i,
22  unsigned int j,
23  const Vector_t &pt) const;
24  bool lineSegmentTouchesOrCrossesLine(unsigned int i,
25  unsigned int j,
26  unsigned int k,
27  unsigned int l) const;
28  bool isPotentialEdgeIntersected(unsigned int i) const;
29  double dotProduct(unsigned int i,
30  unsigned int j,
31  const Vector_t &pt) const;
32  bool isPointInsideCone(unsigned int i,
33  unsigned int j,
34  unsigned int jPlusOne,
35  unsigned int jMinusOne) const;
36  bool isEar(unsigned int i) const;
37  std::vector<unsigned int> findAllEars() const;
38  double computeMinimumAngle(unsigned int i) const;
39  unsigned int selectBestEar(std::vector<unsigned int> &ears) const;
40  void apply();
41 
42  std::vector<mslang::Triangle> triangles_m;
43  std::vector<Vector_t> vertices_m;
44 };
45 
46 #endif
std::complex< double > a
Definition: Mesher.h:7
bool isPointOnLine(unsigned int i, unsigned int j, const Vector_t &pt) const
Definition: Mesher.cpp:49
double dotProduct(unsigned int i, unsigned int j, const Vector_t &pt) const
Definition: Mesher.cpp:124
bool isPointRightOfLine(unsigned int i, unsigned int j, const Vector_t &pt) const
Definition: Mesher.cpp:60
std::vector< mslang::Triangle > getTriangles() const
Definition: Mesher.cpp:9
bool isPointInsideCone(unsigned int i, unsigned int j, unsigned int jPlusOne, unsigned int jMinusOne) const
Definition: Mesher.cpp:138
void orientVerticesCCW()
Definition: Mesher.cpp:13
bool isConvex(unsigned int i) const
Definition: Mesher.cpp:30
unsigned int selectBestEar(std::vector< unsigned int > &ears) const
Definition: Mesher.cpp:201
bool lineSegmentTouchesOrCrossesLine(unsigned int i, unsigned int j, unsigned int k, unsigned int l) const
Definition: Mesher.cpp:69
std::vector< unsigned int > findAllEars() const
Definition: Mesher.cpp:169
std::vector< Vector_t > vertices_m
Definition: Mesher.h:43
double computeMinimumAngle(unsigned int i) const
Definition: Mesher.cpp:182
void apply()
Definition: Mesher.cpp:219
double crossProduct(const Vector_t &a, const Vector_t &b) const
Definition: Mesher.cpp:44
Mesher(std::vector< Vector_t > &vertices)
Definition: Mesher.cpp:3
bool isPotentialEdgeIntersected(unsigned int i) const
Definition: Mesher.cpp:79
std::vector< mslang::Triangle > triangles_m
Definition: Mesher.h:42
bool isEar(unsigned int i) const
Definition: Mesher.cpp:150