G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsHalfEdgeMesh< T >::Halfedge Class Reference

Detailed Description

template<class T>
class gismo::gsHalfEdgeMesh< T >::Halfedge

Class that maintains directed halfedges in any dimension.

Inner classes. Needs to be defined in sequence Halfedge, Chain, Boundary The class Halfedge represents a halfedge in any dimension given by its origin and end point indices and its length. A halfedge can be constructed with desired origin and end point and length. Two halfedges can be compared by == and !=. There are getter function for origin, end and length. There are functions to test wheter a halfedge can be appended to another one before or afterwards and whether a halfedge is a twin of another.

Halfedges can be outputted like (origin–end: length).

Public Member Functions

size_t getEnd () const
 Get end vertex index. More...
 
getLength () const
 Get length of halfedge. More...
 
size_t getOrigin () const
 Get origin vertex index. More...
 
 Halfedge (const size_t origin=0, const size_t end=0, const T length=0)
 This constructor sets the origin- and * end-point indices as well as length to preferred values. More...
 
bool isNext (const Halfedge &previousHalfedge) const
 Tells if halfedge can be added at beginning. More...
 
bool isPrev (const Halfedge &nextHalfedge) const
 Tells if halfedge can be added at end. More...
 
bool isTwin (const Halfedge &halfedge) const
 Tells if halfedge is twin. More...
 

Private Attributes

size_t m_end
 index of end vertex
 
m_length
 length of halfedge
 
size_t m_origin
 index of origin vertex
 

Constructor & Destructor Documentation

Halfedge ( const size_t  origin = 0,
const size_t  end = 0,
const T  length = 0 
)
inlineexplicit

This constructor sets the origin- and * end-point indices as well as length to preferred values.

Parameters
[in]originindex of origin vertex
[in]endindex of end vertex
[in]lengthlength of the halfedge

Member Function Documentation

size_t getEnd ( ) const
inline

Get end vertex index.

Returns
index of end vertex
T getLength ( ) const
inline

Get length of halfedge.

Returns
length of halfedge
size_t getOrigin ( ) const
inline

Get origin vertex index.

Returns
index of origin vertex
bool isNext ( const Halfedge previousHalfedge) const
inline

Tells if halfedge can be added at beginning.

Parameters
[in]previousHalfedgehalfedge which we want to know about if can be added at beginning
Returns
TRUE if halfedge can be added at beginning and FALSE otherwise.
bool isPrev ( const Halfedge nextHalfedge) const
inline

Tells if halfedge can be added at end.

Parameters
[in]nextHalfedgehalfedge which we want to know about if can be added at end
Returns
TRUE if halfedge can be added at end and FALSE otherwise.
bool isTwin ( const Halfedge halfedge) const
inline

Tells if halfedge is twin.

Parameters
[in]halfedgehalfedge which we want to know about if it is a twin
Returns
TRUE if halfedge is a twin and FALSE otherwise.