Fade2.5D Documentation pages v2.12
Delaunay Features
GEOM_FADE25D::TriangleAroundVertexIterator Class Reference

Iterator for all triangles around a given vertex. More...

#include <TriangleAroundVertexIterator.h>

Public Member Functions

 TriangleAroundVertexIterator (const Point2 *pPnt_)
 Constructor. More...
 
 TriangleAroundVertexIterator (const TriangleAroundVertexIterator &it)
 Copy constructor. More...
 
 TriangleAroundVertexIterator (Point2 *pPnt_, Triangle2 *pTr_)
 Constructor. More...
 
bool operator!= (const TriangleAroundVertexIterator &rhs)
 operator!=() More...
 
Triangle2operator* ()
 Returns a pointer to the current triangle (or NULL) More...
 
TriangleAroundVertexIteratoroperator++ ()
 Proceed to the next triangle (the one in counterclockwise order) More...
 
TriangleAroundVertexIteratoroperator-- ()
 Proceed to the previous triangle (the one in clockwise order) More...
 
TriangleAroundVertexIteratoroperator= (const TriangleAroundVertexIterator &other)
 
bool operator== (const TriangleAroundVertexIterator &rhs)
 operator==() More...
 
Triangle2previewNextTriangle ()
 Preview next triangle (CCW direction) More...
 
Triangle2previewPrevTriangle ()
 Preview previous triangle (CW direction) More...
 

Protected Member Functions

void loop ()
 

Protected Attributes

const Point2pPnt
 
Triangle2pSavedTr
 
Triangle2pTr
 

Detailed Description

The TriangleAroundVertexIterator iterates over all triangles incident to a given vertex of a Fade_2D instance. The advantage is that the incident triangles can be visited in a certain order, namely counterclockwise with operator++() or clockwise using operator--(). If the order is not important you can use Fade_2D::getIncidentTriangles() instead.

Left: the iterator visits the triangles around a vertex in a circular manner. Right: Incrementing/decrementing the iterator at a border triangle makes it point to NULL and another increment/decrement sets it to the next border triangle

Constructor & Destructor Documentation

◆ TriangleAroundVertexIterator() [1/3]

GEOM_FADE25D::TriangleAroundVertexIterator::TriangleAroundVertexIterator ( const Point2 pPnt_)
inlineexplicit
Parameters
pPnt_is the vertex whose incident triangles can be visited with the iterator

Initially the iterator points to an arbitrary triangle (not NULL)

◆ TriangleAroundVertexIterator() [2/3]

GEOM_FADE25D::TriangleAroundVertexIterator::TriangleAroundVertexIterator ( Point2 pPnt_,
Triangle2 pTr_ 
)
inline
Parameters
pPnt_is the vertex whose incident triangles can be visited with the iterator
pTr_is the triangle the iterator initially points to

◆ TriangleAroundVertexIterator() [3/3]

GEOM_FADE25D::TriangleAroundVertexIterator::TriangleAroundVertexIterator ( const TriangleAroundVertexIterator it)
inline

Copies the iterator it

Member Function Documentation

◆ operator!=()

bool GEOM_FADE25D::TriangleAroundVertexIterator::operator!= ( const TriangleAroundVertexIterator rhs)
inline

Compares the center and the current triangle of *this and rhs

Returns
true when they are different, false otherwise

◆ operator*()

Triangle2* GEOM_FADE25D::TriangleAroundVertexIterator::operator* ( )
inline

Dereferencing the iterator yields a pointer to the triangle to which the iterator points.

Warning
This method might yield NULL at the border of a triangulation.

◆ operator++()

TriangleAroundVertexIterator& GEOM_FADE25D::TriangleAroundVertexIterator::operator++ ( )
inline

Moves the iterator to the next triangle in counterclockwise order.

Warning
At the border of a triangulation, two border edges exist which are incident to the center vertex. Consequently, the neighbor triangles are NULL there. If operator++() leads the iterator off the triangulation then the iterator will point to NULL. Another call to operator++() will set the iterator to the next triangle in counterclockwise order.

◆ operator--()

TriangleAroundVertexIterator& GEOM_FADE25D::TriangleAroundVertexIterator::operator-- ( )
inline

Moves the iterator to the next triangle in clockwise order.

Warning
At the border of a triangulation, two border edges are incident to the center vertex. Consequently, the neighbor triangles are NULL there. If operator--() leads the iterator off the triangulation then the iterator will point to NULL. Another call to operator--() will set the iterator to the next triangle in clockwise order.

◆ operator==()

bool GEOM_FADE25D::TriangleAroundVertexIterator::operator== ( const TriangleAroundVertexIterator rhs)
inline

Compares the center and the current triangle of *this and rhs

Returns
true when they are identically or false otherwise

◆ previewNextTriangle()

Triangle2* GEOM_FADE25D::TriangleAroundVertexIterator::previewNextTriangle ( )
inline
Returns
the next triangle (the one in CCW direction) without changing the current position.
Warning
This method might yield NULL at the border of a triangulation.

◆ previewPrevTriangle()

Triangle2* GEOM_FADE25D::TriangleAroundVertexIterator::previewPrevTriangle ( )
inline
Returns
the previous triangle (the one in CW direction) without changing the current position.
Warning
This method might yield NULL at the border of a triangulation.

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