Fade2D Documentation pages v2.16.8
Delaunay Features
GEOM_FADE2D::Edge2 Class Reference

Represents a directed edge in a triangulation. More...

#include <Edge2.h>

Public Member Functions

 Edge2 ()
 Default constructor.
 
 Edge2 (const Edge2 &e)
 Copy constructor. More...
 
 Edge2 (Triangle2 *pT, int oppIdx_)
 Constructs an Edge2 from a Triangle2 and an intra-triangle-index. More...
 
 ~Edge2 ()
 Destructor.
 
int getIndex () const
 Get the intra-triangle-index of the edge. More...
 
double getLength2D () const
 Get the 2D length of the edge. More...
 
void getPoints (Point2 *&p1, Point2 *&p2) const
 Get both endpoints of the edge. More...
 
Point2getSrc () const
 Get the source point of the edge. More...
 
Point2getTrg () const
 Get the target point of the edge. More...
 
Triangle2getTriangle () const
 Get the Triangle2 associated with the edge. More...
 
void getTriangles (Triangle2 *&pT0, Triangle2 *&pT1, int &idx0, int &idx1) const
 Get the two adjacent triangles of the edge. More...
 
bool operator!= (const Edge2 &e) const
 Inequality operator for edges. More...
 
bool operator< (const Edge2 &e) const
 Comparison operator for ordering edges (does not compare the lengths) More...
 
Edge2operator= (const Edge2 &other)
 Assignment operator. More...
 
bool operator== (const Edge2 &e) const
 Equality operator for edges. More...
 

Protected Attributes

int oppIdx
 
Triangle2pT
 

Friends

std::ostream & operator<< (std::ostream &stream, const Edge2 &e)
 Stream output for Edge2. More...
 

Detailed Description

An Edge2 defines a directed edge, represented by a

  • Triangle2 object and
  • an intra-triangle index specifying the edge within pT.

The orientation of the Edge2 is always counterclockwise (CCW) with respect to the Triangle2.

An Edge2, defined by a Triangle2 and an opposite index 0; the orientation is counterclockwise with respect to the the Triangle2.

Constructor & Destructor Documentation

◆ Edge2() [1/2]

GEOM_FADE2D::Edge2::Edge2 ( const Edge2 e)
Parameters
eThe edge to copy.

◆ Edge2() [2/2]

GEOM_FADE2D::Edge2::Edge2 ( Triangle2 pT,
int  oppIdx_ 
)
Parameters
pTThe Triangle2 from which the edge is constructed.
oppIdx_The index of the opposite vertex in the triangle.

The edge is oriented counterclockwise (CCW) with respect to pT. For example, Edge2(pT, 0) constructs an edge from pT->getCorner(1) to pT->getCorner(2).

Member Function Documentation

◆ getIndex()

int GEOM_FADE2D::Edge2::getIndex ( ) const
Returns
The intra-triangle index of the opposite vertex in the triangle.

◆ getLength2D()

double GEOM_FADE2D::Edge2::getLength2D ( ) const
Returns
The 2D length of the edge.

◆ getPoints()

void GEOM_FADE2D::Edge2::getPoints ( Point2 *&  p1,
Point2 *&  p2 
) const
Parameters
p1The source point of the edge.
p2The target point of the edge.

◆ getSrc()

Point2* GEOM_FADE2D::Edge2::getSrc ( ) const
Returns
The source point of the edge, which is pT->getCorner((oppIdx + 1) % 3).

◆ getTrg()

Point2* GEOM_FADE2D::Edge2::getTrg ( ) const
Returns
The target point of the edge, which is pT->getCorner((oppIdx + 2) % 3).

◆ getTriangle()

Triangle2* GEOM_FADE2D::Edge2::getTriangle ( ) const
Returns
Get the Triangle2 associated with the edge.

◆ getTriangles()

void GEOM_FADE2D::Edge2::getTriangles ( Triangle2 *&  pT0,
Triangle2 *&  pT1,
int &  idx0,
int &  idx1 
) const
Parameters
pT0The first adjacent triangle.
idx0The intra-triangle index in the first adjacent triangle.
pT1The second adjacent triangle (or NULL if not present).
idx1The intra-triangle index in the second adjacent triangle (or -1 if not present).

◆ operator!=()

bool GEOM_FADE2D::Edge2::operator!= ( const Edge2 e) const
inline

The Edge2 class represents a directed edge. This operator returns true if two Edge2 objects are unequal, meaning they have different Triangle2 objects or different intra-triangle indices.

Parameters
eThe edge to compare to.
Returns
true if the edges are different, false otherwise.

◆ operator<()

bool GEOM_FADE2D::Edge2::operator< ( const Edge2 e) const
inline

The comparison not based on the lengths but on the associated Triangle2 pointers and intra-triangle indices.

Parameters
eThe Edge2 to compare to.
Returns
true if this Edge2 is considered "less" than the other edge.

◆ operator=()

Edge2& GEOM_FADE2D::Edge2::operator= ( const Edge2 other)

Assignment operator.

Parameters
otherThe edge to assign from.
Returns
A reference to this edge.

◆ operator==()

bool GEOM_FADE2D::Edge2::operator== ( const Edge2 e) const
inline

The edges are considered equal if they have the same Triangle2 and intra-triangle index, i.e., they are compared as directed edges.

Parameters
eThe edge to compare to.
Returns
true if the edges are equal.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const Edge2 e 
)
friend
Parameters
streamThe output stream to write to.
eThe edge to output.
Returns
The output stream.

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