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

Directed Edge.

#include <Edge2.h>

Public Member Functions

 Edge2 (const Edge2 &e_)
 
 Edge2 (Triangle2 *pT, int oppIdx_)
 Constructor. More...
 
bool operator< (const Edge2 &e) const
 operator<() More...
 
bool operator== (const Edge2 &e) const
 operator==() More...
 
bool operator!= (const Edge2 &e) const
 operator!=() More...
 
Point2getSrc () const
 Get the source point. More...
 
Point2getTrg () const
 Get the target point. More...
 
void getPoints (Point2 *&p1, Point2 *&p2) const
 Get the endpoints. More...
 
double getLength2D () const
 
Triangle2getTriangle () const
 
void getTriangles (Triangle2 *&pT0, Triangle2 *&pT1, int &idx0, int &idx1) const
 

Protected Attributes

Triangle2pT
 
int oppIdx
 

Friends

std::ostream & operator<< (std::ostream &stream, const Edge2 &e)
 

Constructor & Destructor Documentation

◆ Edge2()

GEOM_FADE2D::Edge2::Edge2 ( Triangle2 pT,
int  oppIdx_ 
)
Parameters
pTis the triangle from which the edge is constructed
oppIdx_is intra-triangle index of the opposite vertex of the edge

The orientation of the constructed Edge2 is counterclockwise (CCW) with respect to pT. Example: Edge2(pT,0) creates an edge from pT->getCorner(1) to pT->getCorner(2).

Member Function Documentation

◆ getLength2D()

double GEOM_FADE2D::Edge2::getLength2D ( ) const

Get the length

Returns
the length of the edge

◆ getPoints()

void GEOM_FADE2D::Edge2::getPoints ( Point2 *&  p1,
Point2 *&  p2 
) const

returns the source point of the edge in p1 and the target point in p2

◆ getSrc()

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

◆ getTrg()

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

◆ getTriangle()

Triangle2* GEOM_FADE2D::Edge2::getTriangle ( ) const

Get the triangle

Returns
the triangle whose directed edge the present edge is

◆ getTriangles()

void GEOM_FADE2D::Edge2::getTriangles ( Triangle2 *&  pT0,
Triangle2 *&  pT1,
int &  idx0,
int &  idx1 
) const

Get the triangles

Returns
the two adjacent triangles of the present edge along with their intra-triangle-indices
Parameters
pT0is used to return the triangle whose directed edge the present edge is
idx0is the opposite intra-triangle-index in pT0 of the present edge
pT1is the other adjacent triangle at the present edge (or NULL)
idx1is the intra-triangle index of the present edge in pT1 (or -1)

◆ operator!=()

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

operator!=() returns true if the compared edges are different. Be aware that edges are directed and therefore two adjacent triangles do not share the same edge.

◆ operator<()

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

operator<() does NOT compare edge lengths but the associated triangle pointers and intra-triangle indices. This is useful when edges are used in STL containers.

◆ operator==()

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

operator==() compares oriented edges, i.e., it returns only true when the two edges have been made from the same triangle and the same intra-triangle-index.


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