Fade2D Documentation pages v2.16.7
Delaunay Features
GEOM_FADE2D::VertexPair2 Struct Reference

An edge consisting of two vertex pointers. More...

#include <VertexPair2.h>

Public Member Functions

 VertexPair2 ()
 Default constructor.
 
 VertexPair2 (Point2 *pSource, Point2 *pTarget)
 Constructor that initializes the vertex pair with two different vertex pointers. More...
 
double getSqLen2D () const
 Get the squared 2D length of the edge. More...
 
Point2getSrc () const
 Get the oriented source vertex pointer. More...
 
Point2getTrg () const
 Get the oriented target vertex pointer. More...
 
bool operator< (const VertexPair2 &other) const
 Less-than operator. More...
 
bool operator== (const VertexPair2 &other) const
 Equality operator. More...
 

Public Attributes

bool bReverse
 Flag indicating if the pointers were reversed.
 
Point2p0
 The smaller vertex pointer.
 
Point2p1
 The larger vertex pointer.
 

Friends

CLASS_DECLSPEC friend std::ostream & operator<< (std::ostream &stream, const VertexPair2 &pr)
 Stream output operator for VertexPair2. More...
 

Detailed Description

The VertexPair2 struct can be thought of as an oriented edge, where the operator<() compares it like an unordered edge, based on the pointer values. It consists of two different Point2 pointers, p0 and p1, ensuring p0 < p1. Despite this reordering, the original edge orientation is preserved internally by the bReverse flag.

Constructor & Destructor Documentation

◆ VertexPair2()

GEOM_FADE2D::VertexPair2::VertexPair2 ( Point2 pSource,
Point2 pTarget 
)
inline

This constructor takes two different Point2 pointers, pSource and pTarget, to initialize the members p0 and p1. If p0 > p1, the pointers are swapped, and bReverse is set to true to indicate that the orientation is reversed compared to the original order.

Parameters
[in]pSourcePointer to the source vertex.
[in]pTargetPointer to the target vertex.

Member Function Documentation

◆ getSqLen2D()

double GEOM_FADE2D::VertexPair2::getSqLen2D ( ) const
inline

Computes the squared 2D length of the edge.

Returns
The squared 2D distance between *p0 and *p1.

◆ getSrc()

Point2* GEOM_FADE2D::VertexPair2::getSrc ( ) const
inline

Returns the source vertex pointer, determined by the bReverse flag.

Returns
p0 if bReverse is false; p1 otherwise.

◆ getTrg()

Point2* GEOM_FADE2D::VertexPair2::getTrg ( ) const
inline

Returns the target vertex pointer, determined by the bReverse flag.

Returns
p1 if bReverse is false; p0 otherwise.

◆ operator<()

bool GEOM_FADE2D::VertexPair2::operator< ( const VertexPair2 other) const
inline

Compares two VertexPair2 instances based on their vertex pointers.

Parameters
otherAnother VertexPair2 instance to compare against.
Returns
true if this pair of pointers is lexicographically less than the other pair.

◆ operator==()

bool GEOM_FADE2D::VertexPair2::operator== ( const VertexPair2 other) const
inline

Checks if the vertex pointers of the other vertex pair are identical.

Parameters
otherAnother VertexPair2 instance to compare against.
Returns
true if both pairs are identical, false otherwise.

Friends And Related Function Documentation

◆ operator<<

CLASS_DECLSPEC friend std::ostream& operator<< ( std::ostream &  stream,
const VertexPair2 pr 
)
friend

Prints the VertexPair2.

Parameters
streamOutput stream.
prThe VertexPair2 instance to print.
Returns
The output stream.

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