MeshKernel
Public Types | Public Member Functions | List of all members
meshkernel::TriangulationWrapper Struct Reference

Wrapper around the Triangle library. More...

#include <TriangulationWrapper.hpp>

Public Types

enum  TriangulationOptions { TriangulationOptions::TriangulatePoints = 1, TriangulationOptions::GeneratePoints = 2, TriangulationOptions::TriangulatePointsAndGenerateFaces = 3 }
 Enumerator describing all triangulation options. More...
 

Public Member Functions

template<std::derived_from< Point > T>
void Compute (const std::vector< T > &inputNodes, TriangulationOptions triangulationOption, double averageTriangleArea, UInt estimatedNumberOfTriangles)
 Compute the triangulation. More...
 
std::vector< PointSelectNodes (const PolygonalEnclosure &enclosure) const
 From the set of computed points, select those that are contained within the enclosure.
 
void BuildTriangulation ()
 Build the internal triangulation from the flat triangulation.
 
int GetNumEdges () const
 Gets the number of triangulated edges. More...
 
int GetNumNodes () const
 Gets the number of triangulated nodes. More...
 
int GetNumFaces () const
 Gets the number of triangulated faces. More...
 
const std::vector< Point > & GetNodes () const
 Gets the triangulated nodes. More...
 
const std::vector< UInt > & GetFaceNodes (const UInt faceIndex) const
 Gets the nodes of a triangulated face. More...
 
UInt GetFaceNode (const UInt faceIndex, const UInt nodeIndex) const
 Retrieves the face node. More...
 
UInt GetFaceEdge (const UInt faceIndex, const UInt edgeIndex) const
 Retrieves the face edge. More...
 
UInt GetEdgeNode (const UInt edgeIndex, const UInt nodeIndex) const
 Retrieves the edge node. More...
 
UInt GetEdgeFace (const UInt edgeIndex, const UInt faceIndex) const
 Retrieves the edge face. More...
 
double GetXCoord (const UInt nodeIndex) const
 Retrieves the x coordinate of a triangulated node. More...
 
double GetYCoord (const UInt nodeIndex) const
 Retrieves the y coordinate of a triangulated node. More...
 
Point GetCoord (const UInt nodeIndex) const
 Retrieves the (x,y) coordinate of a triangulated node. More...
 

Detailed Description

Wrapper around the Triangle library.

See also
https://www.cs.cmu.edu/~quake/triangle.html

Member Enumeration Documentation

◆ TriangulationOptions

Enumerator describing all triangulation options.

Enumerator
TriangulatePoints 

generate Delaunay triangulation from input nodes

GeneratePoints 

generate internal nodes in polygon that produce a Delaunay triangulation

TriangulatePointsAndGenerateFaces 

generate Delaunay triangulation from input nodes with m_faceEdges and m_edgeNodes

Member Function Documentation

◆ Compute()

template<std::derived_from< Point > T>
void meshkernel::TriangulationWrapper::Compute ( const std::vector< T > &  inputNodes,
TriangulationOptions  triangulationOption,
double  averageTriangleArea,
UInt  estimatedNumberOfTriangles 
)
inline

Compute the triangulation.

Template Parameters
TA type that contains x and y fields
Parameters
inputNodesThe number of input points
triangulationOptionTriangulation option, see TriangulationOptions
averageTriangleAreaAn estimation of the average area of triangles (required for option 2)
estimatedNumberOfTrianglesAn estimation of the average number of triangles (required for option 2)

◆ GetCoord()

Point meshkernel::TriangulationWrapper::GetCoord ( const UInt  nodeIndex) const
inline

Retrieves the (x,y) coordinate of a triangulated node.

Parameters
nodeIndexThe index of the node to retrieve
Returns
Point

◆ GetEdgeFace()

UInt meshkernel::TriangulationWrapper::GetEdgeFace ( const UInt  edgeIndex,
const UInt  faceIndex 
) const
inline

Retrieves the edge face.

Parameters
edgeIndexThe index of the edge to retrieve the node from
faceIndexThe index of the face to retrieve
Returns
const reference to the edge with the specified index for the specified face

◆ GetEdgeNode()

UInt meshkernel::TriangulationWrapper::GetEdgeNode ( const UInt  edgeIndex,
const UInt  nodeIndex 
) const
inline

Retrieves the edge node.

Parameters
edgeIndexThe index of the edge to retrieve the node from
nodeIndexThe index of the node to retrieve
Returns
const reference to the node with the specified index for the specified face

◆ GetFaceEdge()

UInt meshkernel::TriangulationWrapper::GetFaceEdge ( const UInt  faceIndex,
const UInt  edgeIndex 
) const
inline

Retrieves the face edge.

Parameters
faceIndexThe index of the face to retrieve the edge from
edgeIndexThe index of the edge to retrieve
Returns
const reference to the edge with the specified index for the specified face

◆ GetFaceNode()

UInt meshkernel::TriangulationWrapper::GetFaceNode ( const UInt  faceIndex,
const UInt  nodeIndex 
) const
inline

Retrieves the face node.

Parameters
faceIndexThe index of the face to retrieve the node from
nodeIndexThe index of the node to retrieve
Returns
const reference to the node with the specified index for the specified face

◆ GetFaceNodes()

const std::vector<UInt>& meshkernel::TriangulationWrapper::GetFaceNodes ( const UInt  faceIndex) const
inline

Gets the nodes of a triangulated face.

Parameters
faceIndexThe face index
Returns
The triangulated nodes

◆ GetNodes()

const std::vector<Point>& meshkernel::TriangulationWrapper::GetNodes ( ) const
inline

Gets the triangulated nodes.

Returns
The triangulated nodes

◆ GetNumEdges()

int meshkernel::TriangulationWrapper::GetNumEdges ( ) const
inline

Gets the number of triangulated edges.

Returns
The number of triangulated edges

◆ GetNumFaces()

int meshkernel::TriangulationWrapper::GetNumFaces ( ) const
inline

Gets the number of triangulated faces.

Returns
The number of triangulated faces

◆ GetNumNodes()

int meshkernel::TriangulationWrapper::GetNumNodes ( ) const
inline

Gets the number of triangulated nodes.

Returns
The number of triangulated nodes

◆ GetXCoord()

double meshkernel::TriangulationWrapper::GetXCoord ( const UInt  nodeIndex) const
inline

Retrieves the x coordinate of a triangulated node.

Parameters
nodeIndexThe index of the node to retrieve
Returns
const reference to the x coordinate

◆ GetYCoord()

double meshkernel::TriangulationWrapper::GetYCoord ( const UInt  nodeIndex) const
inline

Retrieves the y coordinate of a triangulated node.

Parameters
nodeIndexThe index of the node to retrieve
Returns
const reference to the y coordinate

The documentation for this struct was generated from the following file: