Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
GEO::MeshHalfedges Class Reference

Exposes a half-edge like API for traversing a Mesh. More...

#include <geogram/mesh/mesh_halfedges.h>

Classes

struct  Halfedge
 Stores a reference to a mesh corner and facet, and provides a halfedge-like API. More...
 

Public Member Functions

 MeshHalfedges (Mesh &mesh)
 Creates a new MeshHalfedges. More...
 
Meshmesh ()
 Gets the mesh. More...
 
const Meshmesh () const
 Gets the mesh. More...
 
void set_use_facet_region (bool x)
 Sets whether facet regions determine borders. More...
 
void set_use_facet_region (const std::string &attribute_name)
 Sets a facet attribute name that determines borders. More...
 
void set_use_facet_region (const char *attribute_name)
 Sets a facet attribute name that determines borders. More...
 
bool halfedge_is_valid (const Halfedge &H) const
 Tests whether a Halfedge is valid. More...
 
bool halfedge_is_border (const Halfedge &H) const
 Tests whether a Halfedge is on the boder. More...
 
void move_to_next_around_facet (Halfedge &H) const
 Replaces a Halfedge with the next one around the facet. More...
 
void move_to_prev_around_facet (Halfedge &H) const
 Replaces a Halfedge with the previous one around the facet. More...
 
bool move_to_next_around_vertex (Halfedge &H) const
 Replaces a Halfedge with the next one around the vertex. More...
 
bool move_to_prev_around_vertex (Halfedge &H) const
 Replaces a Halfedge with the previous one around the vertex. More...
 
void move_to_next_around_border (Halfedge &H) const
 Replaces a Halfedge with the next one around the border. More...
 
void move_to_prev_around_border (Halfedge &H) const
 Replaces a Halfedge with the previous one around the border. More...
 
void move_to_opposite (Halfedge &H) const
 Replaces a Halfedge with the opposite one in the adjacent facet. More...
 

Detailed Description

Exposes a half-edge like API for traversing a Mesh.

Definition at line 59 of file mesh_halfedges.h.

Constructor & Destructor Documentation

◆ MeshHalfedges()

GEO::MeshHalfedges::MeshHalfedges ( Mesh mesh)
inline

Creates a new MeshHalfedges.

Parameters
[in]meshthe Mesh

Definition at line 133 of file mesh_halfedges.h.

Member Function Documentation

◆ halfedge_is_border()

bool GEO::MeshHalfedges::halfedge_is_border ( const Halfedge H) const
inline

Tests whether a Halfedge is on the boder.

If set_use_facet_region() is set, then Halfedges incident to two different facet regions are considered as borders.

Parameters
[in]Hthe Halfedge
Returns
true if H is on the border, false otherwise

Definition at line 220 of file mesh_halfedges.h.

◆ halfedge_is_valid()

bool GEO::MeshHalfedges::halfedge_is_valid ( const Halfedge H) const
inline

Tests whether a Halfedge is valid.

Parameters
[in]Hthe Halfedge to be tested
Returns
true if H refers to a halfedge that exists in the mesh, false otherwise
Note
It only tests whether H.corner and H.facet are valid indices in the mesh, but does not test whether H.corner exists in H.facet.

Definition at line 203 of file mesh_halfedges.h.

◆ mesh() [1/2]

Mesh& GEO::MeshHalfedges::mesh ( )
inline

Gets the mesh.

Returns
a reference to the mesh.

Definition at line 140 of file mesh_halfedges.h.

◆ mesh() [2/2]

const Mesh& GEO::MeshHalfedges::mesh ( ) const
inline

Gets the mesh.

Returns
a const reference to the mesh.

Definition at line 148 of file mesh_halfedges.h.

◆ move_to_next_around_border()

void GEO::MeshHalfedges::move_to_next_around_border ( Halfedge H) const

Replaces a Halfedge with the next one around the border.

If set_use_facet_region() is set, then Halfedges incident to two different facet regions are considered as borders.

Parameters
[in,out]Hthe Halfedge

◆ move_to_next_around_facet()

void GEO::MeshHalfedges::move_to_next_around_facet ( Halfedge H) const
inline

Replaces a Halfedge with the next one around the facet.

Parameters
[in,out]Hthe Halfedge

Definition at line 238 of file mesh_halfedges.h.

◆ move_to_next_around_vertex()

bool GEO::MeshHalfedges::move_to_next_around_vertex ( Halfedge H) const

Replaces a Halfedge with the next one around the vertex.

Parameters
[in,out]Hthe Halfedge
Returns
true if the move was successful, false otherwise. On borders, the next halfedge around a vertex may not exist.

◆ move_to_opposite()

void GEO::MeshHalfedges::move_to_opposite ( Halfedge H) const

Replaces a Halfedge with the opposite one in the adjacent facet.

Parameters
[in,out]Hthe Halfedge
Precondition
!is_on_border(H)

◆ move_to_prev_around_border()

void GEO::MeshHalfedges::move_to_prev_around_border ( Halfedge H) const

Replaces a Halfedge with the previous one around the border.

If set_use_facet_region() is set, then Halfedges incident to two different facet regions are considered as borders.

Parameters
[in,out]Hthe Halfedge

◆ move_to_prev_around_facet()

void GEO::MeshHalfedges::move_to_prev_around_facet ( Halfedge H) const
inline

Replaces a Halfedge with the previous one around the facet.

Parameters
[in,out]Hthe Halfedge

Definition at line 247 of file mesh_halfedges.h.

◆ move_to_prev_around_vertex()

bool GEO::MeshHalfedges::move_to_prev_around_vertex ( Halfedge H) const

Replaces a Halfedge with the previous one around the vertex.

Parameters
[in,out]Hthe Halfedge
Returns
true if the move was successful, false otherwise. On borders, the previous halfedge around a vertex may not exist.

◆ set_use_facet_region() [1/3]

void GEO::MeshHalfedges::set_use_facet_region ( bool  x)
inline

Sets whether facet regions determine borders.

Parameters
[in]xif set, then an halfedge incident to two facets with different facet regions is considered to be a border

Definition at line 158 of file mesh_halfedges.h.

◆ set_use_facet_region() [2/3]

void GEO::MeshHalfedges::set_use_facet_region ( const char *  attribute_name)
inline

Sets a facet attribute name that determines borders.

Parameters
[in]attribute_namethe name of the facet attribute to be used to determine borders.

Needed to have this overload, because const char* is implicitly converted to bool instead of std::string.

Definition at line 189 of file mesh_halfedges.h.

◆ set_use_facet_region() [3/3]

void GEO::MeshHalfedges::set_use_facet_region ( const std::string &  attribute_name)
inline

Sets a facet attribute name that determines borders.

Parameters
[in]attribute_namethe name of the facet attribute to be used to determine borders.

Definition at line 175 of file mesh_halfedges.h.


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