Fade2.5D Documentation pages v2.16.8
Delaunay Features
GEOM_FADE25D::ConstraintSegment2 Class Reference

A ConstraintSegment2 represents a constraint edge between two vertices of a Delaunay triangulation. More...

#include <ConstraintSegment2.h>

Public Member Functions

CLASS_DECLSPEC void getChildrenAndSplitPoint (ConstraintSegment2 *&pCSeg0, ConstraintSegment2 *&pCSeg1, Point2 *&pSplitPoint)
 Retrieves the two direct children and the split point. More...
 
CLASS_DECLSPEC void getChildrenRec (std::vector< ConstraintSegment2 * > &vChildConstraintSegments)
 Retrieves all children of this constraint segment recursively. More...
 
ConstraintInsertionStrategy getCIS () const
 Retrieves the constraint insertion strategy (CIS) of this segment. More...
 
CLASS_DECLSPEC Point2getSrc () const
 Get the first endpoint of the constraint segment. More...
 
CLASS_DECLSPEC Point2getTrg () const
 Get the second endpoint of the constraint segment. More...
 
CLASS_DECLSPEC Point2insertAndSplit (const Point2 &splitPoint)
 Splits a constraint segment at a specified point. More...
 
CLASS_DECLSPEC bool isAlive () const
 Checks if the segment is alive. More...
 
bool operator< (const ConstraintSegment2 &pOther) const
 Comparison operator for sorting segments. More...
 

Public Attributes

int label
 

Static Public Attributes

static int runningLabel
 

Protected Attributes

bool bAlive
 
ConstraintInsertionStrategy cis
 
Point2p0
 
Point2p1
 
std::vector< ConstraintSegment2 * > vChildren
 
std::vector< ConstraintSegment2 * > vParents
 

Friends

class ConstraintGraph2
 
class ConstraintMgr
 
CLASS_DECLSPEC friend std::ostream & operator<< (std::ostream &stream, const ConstraintSegment2 &cSeg)
 

Detailed Description

A Constraint Edge in a Constrained Delaunay triangulation
  • A ConstraintSegment2 represents a constraint edge between two vertices (Point2 objects) of a Fade_2D instance.
  • It can belong to multiple ConstraintGraph2 objects, and thus it does not carry any orientation information. Instead, the ConstraintGraph2 objects it belongs to can provide its orientation.
  • A ConstraintSegment2 can be split. In this case it is dead and has two children (which can be the case recursively).

Member Function Documentation

◆ getChildrenAndSplitPoint()

CLASS_DECLSPEC void GEOM_FADE25D::ConstraintSegment2::getChildrenAndSplitPoint ( ConstraintSegment2 *&  pCSeg0,
ConstraintSegment2 *&  pCSeg1,
Point2 *&  pSplitPoint 
)

This method retrieves the two child segments that result from splitting this ConstraintSegment2 as well as the point where the split occurred.

Parameters
pCSeg0A pointer to the first child ConstraintSegment2.
pCSeg1A pointer to the second child ConstraintSegment2.
pSplitPointA pointer to the vertex at which the split occurred.

◆ getChildrenRec()

CLASS_DECLSPEC void GEOM_FADE25D::ConstraintSegment2::getChildrenRec ( std::vector< ConstraintSegment2 * > &  vChildConstraintSegments)

This method recursively collects all child ConstraintSegment2s of the current one that are still alive, meaning they have not been marked as "dead" due to being split.

Parameters
vChildConstraintSegmentsA vector that will be populated with the child segments.

◆ getCIS()

ConstraintInsertionStrategy GEOM_FADE25D::ConstraintSegment2::getCIS ( ) const

This function returns the constraint insertion strategy of the present ConstraintSegment2. CIS_CONSTRAINED_DELAUNAY is the only supported strategy. Other possible values are deprecated in favor of newer techniques.

Returns
The ConstraintInsertionStrategy of this segment.

◆ getSrc()

CLASS_DECLSPEC Point2* GEOM_FADE25D::ConstraintSegment2::getSrc ( ) const
Returns
A pointer to the first endpoint (Point2 object).

◆ getTrg()

CLASS_DECLSPEC Point2* GEOM_FADE25D::ConstraintSegment2::getTrg ( ) const
Returns
A pointer to the second endpoint (Point2 object).

◆ insertAndSplit()

CLASS_DECLSPEC Point2* GEOM_FADE25D::ConstraintSegment2::insertAndSplit ( const Point2 splitPoint)

This method splits the ConstraintSegment2 at the given splitPoint. After the operation, the current ConstraintSegment2 is marked as "dead" and has two child segments.

Parameters
[in]splitPointThe point at which to split the segment.
Returns
A pointer to the inserted Point2 (the splitPoint), or NULL if the operation fails.
Note
Always use this method to split a ConstraintSegment2. Attempting to split the segment by simply inserting the splitPoint (e.g., using Fade_2D::insert(splitPoint)) will fail if the splitPoint and the two endpoints of the ConstraintSegment2 are not exactly collinear e.g., due to floating-point precision limitations. In contrast, this method accepts a non-collinear splitPoint as long as it has an orthogonal projection onto the segment.

◆ isAlive()

CLASS_DECLSPEC bool GEOM_FADE25D::ConstraintSegment2::isAlive ( ) const

This function checks whether the current ConstraintSegment2 object is "alive" or "dead."

Returns
Returns true if the segment is alive, false otherwise.

◆ operator<()

bool GEOM_FADE25D::ConstraintSegment2::operator< ( const ConstraintSegment2 pOther) const
inline

This operator compares two ConstraintSegment2 objects for sorting segments. The comparison is based on the pointers to their endpoints (p0 and p1), not the length of the ConstraintSegment2.

Parameters
pOtherAnother ConstraintSegment2 to compare.
Returns
true if the current segment is less than the other segment, false otherwise.

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