Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.55
GEOM_FADE2D::TriangleAroundVertexIterator Class Reference

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

#include <TriangleAroundVertexIterator.h>

Public Member Functions

 TriangleAroundVertexIterator (Point2 *pPnt_)
 Constructor. More...
 
 TriangleAroundVertexIterator (Point2 *pPnt_, Triangle2 *pTr_)
 Constructor. More...
 
 TriangleAroundVertexIterator (const TriangleAroundVertexIterator &it)
 Copy constructor. 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...
 
bool operator== (const TriangleAroundVertexIterator &rhs)
 Check if the center points and the current triangles of the iterators are the same. More...
 
bool operator!= (const TriangleAroundVertexIterator &rhs)
 Check if the center points or the current triangles of the iterators are different. More...
 
Triangle2operator* ()
 Returns a pointer to the current triangle (or NULL) More...
 
Triangle2previewNextTriangle ()
 Preview next triangle (CCW direction) More...
 
Triangle2previewPrevTriangle ()
 Preview previous triangle (CW direction) More...
 

Protected Member Functions

void loop ()
 

Protected Attributes

Point2pPnt
 
Triangle2pTr
 
Triangle2pSavedTr
 

Detailed Description

Iterates over all triangles incident to a given vertex in a circular manner. Thereby, counterclockwise is the positive direction.

umbrella.jpg
Left: the iterator visits the triangles around a vertex. Right: The iterator 'jumps' over the border edges of the triangulation

Constructor & Destructor Documentation

◆ TriangleAroundVertexIterator() [1/3]

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

The iterator will start at an arbitrary triangle

◆ TriangleAroundVertexIterator() [2/3]

GEOM_FADE2D::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 where the iterator will start

◆ TriangleAroundVertexIterator() [3/3]

GEOM_FADE2D::TriangleAroundVertexIterator::TriangleAroundVertexIterator ( const TriangleAroundVertexIterator it)
inline

Member Function Documentation

◆ operator!=()

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

◆ operator*()

Triangle2* GEOM_FADE2D::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_FADE2D::TriangleAroundVertexIterator::operator++ ( )
inline
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_FADE2D::TriangleAroundVertexIterator::operator-- ( )
inline
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_FADE2D::TriangleAroundVertexIterator::operator== ( const TriangleAroundVertexIterator rhs)
inline

◆ previewNextTriangle()

Triangle2* GEOM_FADE2D::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_FADE2D::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: