OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mesher Class Reference

#include <Mesher.h>

Public Member Functions

 Mesher (std::vector< Vector_t > &vertices)
 
std::vector< mslang::TrianglegetTriangles () const
 

Private Member Functions

void orientVerticesCCW ()
 
bool isConvex (unsigned int i) const
 
double crossProduct (const Vector_t &a, const Vector_t &b) const
 
bool isPointOnLine (unsigned int i, unsigned int j, const Vector_t &pt) const
 
bool isPointRightOfLine (unsigned int i, unsigned int j, const Vector_t &pt) const
 
bool lineSegmentTouchesOrCrossesLine (unsigned int i, unsigned int j, unsigned int k, unsigned int l) const
 
bool isPotentialEdgeIntersected (unsigned int i) const
 
double dotProduct (unsigned int i, unsigned int j, const Vector_t &pt) const
 
bool isPointInsideCone (unsigned int i, unsigned int j, unsigned int jPlusOne, unsigned int jMinusOne) const
 
bool isEar (unsigned int i) const
 
std::vector< unsigned int > findAllEars () const
 
double computeMinimumAngle (unsigned int i) const
 
unsigned int selectBestEar (std::vector< unsigned int > &ears) const
 
void apply ()
 

Private Attributes

std::vector< mslang::Triangletriangles_m
 
std::vector< Vector_tvertices_m
 

Detailed Description

Definition at line 7 of file Mesher.h.

Constructor & Destructor Documentation

◆ Mesher()

Mesher::Mesher ( std::vector< Vector_t > &  vertices)

Definition at line 3 of file Mesher.cpp.

References apply().

Here is the call graph for this function:

Member Function Documentation

◆ apply()

void Mesher::apply ( )
private

Definition at line 219 of file Mesher.cpp.

References findAllEars(), mslang::Triangle::nodes_m, orientVerticesCCW(), selectBestEar(), triangles_m, and vertices_m.

Referenced by Mesher().

Here is the call graph for this function:

◆ computeMinimumAngle()

double Mesher::computeMinimumAngle ( unsigned int  i) const
private

Definition at line 182 of file Mesher.cpp.

References acos(), mslang::euclidean_norm2D(), min(), and vertices_m.

Referenced by selectBestEar().

Here is the call graph for this function:

◆ crossProduct()

double Mesher::crossProduct ( const Vector_t a,
const Vector_t b 
) const
private

Definition at line 44 of file Mesher.cpp.

References a.

Referenced by isPointOnLine(), and isPointRightOfLine().

◆ dotProduct()

double Mesher::dotProduct ( unsigned int  i,
unsigned int  j,
const Vector_t pt 
) const
private

Definition at line 124 of file Mesher.cpp.

References vertices_m.

Referenced by isPointInsideCone().

◆ findAllEars()

std::vector< unsigned int > Mesher::findAllEars ( ) const
private

Definition at line 169 of file Mesher.cpp.

References isEar(), and vertices_m.

Referenced by apply().

Here is the call graph for this function:

◆ getTriangles()

std::vector< mslang::Triangle > Mesher::getTriangles ( ) const

Definition at line 9 of file Mesher.cpp.

References triangles_m.

Referenced by mslang::Polygon::triangulize().

◆ isConvex()

bool Mesher::isConvex ( unsigned int  i) const
private

Definition at line 30 of file Mesher.cpp.

References vertices_m.

Referenced by isEar().

◆ isEar()

bool Mesher::isEar ( unsigned int  i) const
private

Definition at line 150 of file Mesher.cpp.

References isConvex(), isPointInsideCone(), isPotentialEdgeIntersected(), and vertices_m.

Referenced by findAllEars().

Here is the call graph for this function:

◆ isPointInsideCone()

bool Mesher::isPointInsideCone ( unsigned int  i,
unsigned int  j,
unsigned int  jPlusOne,
unsigned int  jMinusOne 
) const
private

Definition at line 138 of file Mesher.cpp.

References dotProduct(), isPointRightOfLine(), and vertices_m.

Referenced by isEar().

Here is the call graph for this function:

◆ isPointOnLine()

bool Mesher::isPointOnLine ( unsigned int  i,
unsigned int  j,
const Vector_t pt 
) const
private

Definition at line 49 of file Mesher.cpp.

References abs(), crossProduct(), Physics::e, and vertices_m.

Referenced by lineSegmentTouchesOrCrossesLine().

Here is the call graph for this function:

◆ isPointRightOfLine()

bool Mesher::isPointRightOfLine ( unsigned int  i,
unsigned int  j,
const Vector_t pt 
) const
private

Definition at line 60 of file Mesher.cpp.

References crossProduct(), and vertices_m.

Referenced by isPointInsideCone(), and lineSegmentTouchesOrCrossesLine().

Here is the call graph for this function:

◆ isPotentialEdgeIntersected()

bool Mesher::isPotentialEdgeIntersected ( unsigned int  i) const
private

◆ lineSegmentTouchesOrCrossesLine()

bool Mesher::lineSegmentTouchesOrCrossesLine ( unsigned int  i,
unsigned int  j,
unsigned int  k,
unsigned int  l 
) const
private

Definition at line 69 of file Mesher.cpp.

References isPointOnLine(), isPointRightOfLine(), and vertices_m.

Referenced by isPotentialEdgeIntersected().

Here is the call graph for this function:

◆ orientVerticesCCW()

void Mesher::orientVerticesCCW ( )
private

Definition at line 13 of file Mesher.cpp.

References sum(), and vertices_m.

Referenced by apply().

Here is the call graph for this function:

◆ selectBestEar()

unsigned int Mesher::selectBestEar ( std::vector< unsigned int > &  ears) const
private

Definition at line 201 of file Mesher.cpp.

References computeMinimumAngle().

Referenced by apply().

Here is the call graph for this function:

Member Data Documentation

◆ triangles_m

std::vector<mslang::Triangle> Mesher::triangles_m
private

Definition at line 42 of file Mesher.h.

Referenced by apply(), and getTriangles().

◆ vertices_m

std::vector<Vector_t> Mesher::vertices_m
private

The documentation for this class was generated from the following files: