Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
wmtk::TriMesh::Tuple Class Reference

Public Member Functions

void print_info ()
 
 Tuple ()
 
 Tuple (size_t vid, size_t eid, size_t fid, const TriMesh &m)
 
size_t vid (const TriMesh &) const
 
size_t fid (const TriMesh &) const
 
size_t eid (const TriMesh &m) const
 
size_t local_eid (const TriMesh &m) const
 
Tuple switch_vertex (const TriMesh &m) const
 
Tuple switch_edge (const TriMesh &m) const
 
std::optional< Tupleswitch_face (const TriMesh &m) const
 
std::vector< Tupleswitch_faces (const TriMesh &m) const
 
bool is_valid (const TriMesh &m) const
 check if a Tuple is valid
 
std::array< Tuple, 3 > oriented_tri_vertices (const TriMesh &m) const
 

Private Member Functions

void update_hash (const TriMesh &m)
 

Private Attributes

size_t m_vid = -1
 
size_t m_eid = -1
 
size_t m_fid = -1
 
size_t m_hash = -1
 

Friends

bool operator< (const Tuple &a, const Tuple &t)
 

Constructor & Destructor Documentation

◆ Tuple()

wmtk::TriMesh::Tuple::Tuple ( )
inline

Construct a new Tuple object with global vertex/triangle index and local edge index

Parameters
vidvertex id
eidedge id (local)
fidface id
Note
edge ordering

Member Function Documentation

◆ eid()

size_t TriMesh::Tuple::eid ( const TriMesh m) const

returns a global unique edge id

Parameters
mTriMesh where the tuple belongs.
Returns
size_t
Note
The global id may not be consecutive. The edges are undirected and different tetra share the same edge.

◆ fid()

size_t wmtk::TriMesh::Tuple::fid ( const TriMesh ) const
inline

returns a global unique face id

Parameters
mTriMesh where the tuple belongs.
Returns
size_t

◆ is_valid()

bool TriMesh::Tuple::is_valid ( const TriMesh m) const

check if a Tuple is valid

Parameters
mthe Mesh
Returns
false if 1. the fid of the Tuple is -1, 2. either the vertex or the face refered to by the Tuple is removed, 3. the hash of the Tuple is not the same as the hash of the triangle it refers to in the mesh

◆ local_eid()

size_t wmtk::TriMesh::Tuple::local_eid ( const TriMesh m) const
inline

returns the local eid of the tuple

Parameters
mTriMesh where the tuple belongs.
Returns
size_t
Note
use mostly for constructing consistent tuples in operations

◆ oriented_tri_vertices()

std::array< Tuple, 3 > wmtk::TriMesh::Tuple::oriented_tri_vertices ( const TriMesh m) const

Positively oriented 3 vertices (represented by Tuples) in a tri.

Returns
std::array<Tuple, 3> each tuple owns a different vertex.

◆ switch_edge()

TriMesh::Tuple TriMesh::Tuple::switch_edge ( const TriMesh m) const
Parameters
m
Returns
another Tuple that share the same face, vertex, but different edge.

◆ switch_face()

std::optional< TriMesh::Tuple > TriMesh::Tuple::switch_face ( const TriMesh m) const

Switch operation for the adjacent triangle.

This operation only works for manifold meshes!!!

Parameters
mMesh
Returns
Tuple for the edge-adjacent triangle, sharing same edge, and vertex.
Note
nullopt if the Tuple of the switch goes off the boundary.

◆ switch_vertex()

TriMesh::Tuple TriMesh::Tuple::switch_vertex ( const TriMesh m) const

Switch operation.

Parameters
mMesh
Returns
another Tuple that share the same face, edge, but different vertex.

◆ vid()

size_t wmtk::TriMesh::Tuple::vid ( const TriMesh ) const
inline

returns global vertex id.

Parameters
mTriMesh where the tuple belongs.
Returns
size_t

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