EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
EBGeometry::DCEL::EdgeIteratorT< T, Meta > Class Template Reference

Half-edge iterator class for navigating the half edge mesh. More...

#include <EBGeometry_DCEL_Iterator.hpp>

Collaboration diagram for EBGeometry::DCEL::EdgeIteratorT< T, Meta >:
Collaboration graph
[legend]

Public Types

using Vertex = VertexT< T, Meta >
 Alias for DCEL vertex type.
 
using Edge = EdgeT< T, Meta >
 Alias for DCEL edge type.
 
using Face = FaceT< T, Meta >
 Alias for DCEL face type.
 
using VertexPtr = std::shared_ptr< Vertex >
 Alias for vertex pointer.
 
using EdgePtr = std::shared_ptr< Edge >
 Alias for edge pointer.
 
using FacePtr = std::shared_ptr< Face >
 Alias for face pointer.
 

Public Member Functions

 EdgeIteratorT ()=delete
 Default construction is not allowed. Use one of the full constructors.
 
 EdgeIteratorT (Face &a_face) noexcept
 Constructor, taking a face as argument. The iterator begins at the half-edge pointer contained in the face.
 
 EdgeIteratorT (const Face &a_face) noexcept
 Constructor, taking a face as argument. The iterator begins at the half-edge pointer contained in the face.
 
 EdgeIteratorT (const EdgePtr &a_startEdge) noexcept
 Constructor, taking an arbitrary starting half-edge directly (rather than a face's own half-edge). Useful for iterating a half-edge loop when only an edge – not its face – is available.
 
 EdgeIteratorT (const EdgeIteratorT &a_other) noexcept=default
 Copy constructor.
 
 EdgeIteratorT (EdgeIteratorT &&a_other) noexcept=default
 Move constructor.
 
 ~EdgeIteratorT () noexcept=default
 Destructor.
 
EdgeIteratorToperator= (const EdgeIteratorT &a_other) noexcept=default
 Copy assignment operator.
 
EdgeIteratorToperator= (EdgeIteratorT &&a_other) noexcept=default
 Move assignment operator.
 
EdgePtroperator() () noexcept
 Operator returning a pointer to the current half-edge.
 
const EdgePtroperator() () const noexcept
 Operator returning a pointer to the current half-edge (const overload)
 
void reset () noexcept
 Reset function for the iterator. This resets the iterator so that it begins from the starting half-edge.
 
void operator++ () noexcept
 Incrementation operator, bringing the iterator to the next half-edge.
 
bool ok () const noexcept
 Function which checks if the iteration can be continued.
 

Protected Attributes

bool m_fullLoop = false
 If true, a full loop has been made around the polygon face.
 
std::shared_ptr< Edgem_startEdge = nullptr
 Starting half-edge.
 
std::shared_ptr< Edgem_curEdge = nullptr
 Current half-edge.
 

Detailed Description

template<class T, class Meta>
class EBGeometry::DCEL::EdgeIteratorT< T, Meta >

Half-edge iterator class for navigating the half edge mesh.

Class which makes it easier to iterate through DCEL edges.

Template Parameters
TFloating-point precision type.
MetaUser-defined metadata type.

Iterates the half-edge loop bounding a polygon face (or starting from an arbitrary half-edge), following EdgeT::getNextEdge() until either the loop returns to its starting edge (a well-formed, closed face) or a null next-edge is reached (an incomplete/open half-edge chain). Typical usage:

for (EdgeIterator it(someFace); it.ok(); ++it) {
const EdgePtr& edge = it();
// ... use edge ...
}
std::shared_ptr< Edge > EdgePtr
Alias for edge pointer.
Definition EBGeometry_DCEL_Iterator.hpp:69
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:225
Template Parameters
TFloating-point precision type.
MetaUser-defined metadata type.

Constructor & Destructor Documentation

◆ EdgeIteratorT() [1/5]

template<class T , class Meta >
EBGeometry::DCEL::EdgeIteratorT< T, Meta >::EdgeIteratorT ( Face a_face)
noexcept

Constructor, taking a face as argument. The iterator begins at the half-edge pointer contained in the face.

Parameters
[in]a_faceDCEL polygon face
Note
This constructor will will iterate through the half-edges in the polygon face.

◆ EdgeIteratorT() [2/5]

template<class T , class Meta >
EBGeometry::DCEL::EdgeIteratorT< T, Meta >::EdgeIteratorT ( const Face a_face)
noexcept

Constructor, taking a face as argument. The iterator begins at the half-edge pointer contained in the face.

Parameters
[in]a_faceDCEL polygon face
Note
This constructor will will iterate through the half-edges in the polygon face.

◆ EdgeIteratorT() [3/5]

template<class T , class Meta >
EBGeometry::DCEL::EdgeIteratorT< T, Meta >::EdgeIteratorT ( const EdgePtr a_startEdge)
noexcept

Constructor, taking an arbitrary starting half-edge directly (rather than a face's own half-edge). Useful for iterating a half-edge loop when only an edge – not its face – is available.

Parameters
[in]a_startEdgeStarting half-edge. May be nullptr (ok() will then immediately return false).

◆ EdgeIteratorT() [4/5]

template<class T , class Meta >
EBGeometry::DCEL::EdgeIteratorT< T, Meta >::EdgeIteratorT ( const EdgeIteratorT< T, Meta > &  a_other)
defaultnoexcept

Copy constructor.

Parameters
[in]a_otherOther iterator.

◆ EdgeIteratorT() [5/5]

template<class T , class Meta >
EBGeometry::DCEL::EdgeIteratorT< T, Meta >::EdgeIteratorT ( EdgeIteratorT< T, Meta > &&  a_other)
defaultnoexcept

Move constructor.

Parameters
[in,out]a_otherOther iterator.

Member Function Documentation

◆ ok()

template<class T , class Meta >
bool EBGeometry::DCEL::EdgeIteratorT< T, Meta >::ok ( ) const
inlinenoexcept

Function which checks if the iteration can be continued.

Returns
True if the iterator has not completed a full loop and the current edge is not null.

◆ operator()() [1/2]

template<class T , class Meta >
const EdgePtr & EBGeometry::DCEL::EdgeIteratorT< T, Meta >::operator() ( ) const
inlinenoexcept

Operator returning a pointer to the current half-edge (const overload)

Returns
Const reference to the shared pointer to the current half-edge.

◆ operator()() [2/2]

template<class T , class Meta >
EdgePtr & EBGeometry::DCEL::EdgeIteratorT< T, Meta >::operator() ( )
inlinenoexcept

Operator returning a pointer to the current half-edge.

Returns
Reference to the shared pointer to the current half-edge.

◆ operator=() [1/2]

template<class T , class Meta >
EdgeIteratorT & EBGeometry::DCEL::EdgeIteratorT< T, Meta >::operator= ( const EdgeIteratorT< T, Meta > &  a_other)
defaultnoexcept

Copy assignment operator.

Parameters
[in]a_otherOther iterator.
Returns
Reference to (*this).

◆ operator=() [2/2]

template<class T , class Meta >
EdgeIteratorT & EBGeometry::DCEL::EdgeIteratorT< T, Meta >::operator= ( EdgeIteratorT< T, Meta > &&  a_other)
defaultnoexcept

Move assignment operator.

Parameters
[in,out]a_otherOther iterator.
Returns
Reference to (*this).

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