Fade2.5D Documentation pages v2.12
Delaunay Features
GEOM_FADE25D::Triangle2 Class Reference

Triangle. More...

#include <Triangle2.h>

Public Member Functions

 Triangle2 ()
 Constructor.
 
void clearProperties ()
 Clear all corners and neighbor pointers.
 
double getArea25D () const
 Get 2.5D Area. More...
 
double getArea2D () const
 Get 2D Area. More...
 
Point2 getBarycenter () const
 Get the barycenter of a triangle. More...
 
Point2 getCircumcenter (CircumcenterQuality &ccq, bool bForceExact=false) const
 Get the circumcenter of the triangle. More...
 
void getCorners (Point2 *&p0, Point2 *&p1, Point2 *&p2) const
 Get the 3 triangle corners.
 
std::pair< Point2, bool > getDual (bool bForceExact=false) const
 
double getInteriorAngle25D (int ith) const
 Get interior 2.5D angle. More...
 
double getInteriorAngle2D (int ith) const
 Get interior 2D angle. More...
 
int getIntraTriangleIndex (const Point2 *p) const
 Get the index of p in the triangle. More...
 
int getIntraTriangleIndex (const Point2 *p0, const Point2 *p1) const
 Get the index of (p0,p1) More...
 
int getIntraTriangleIndex (const Triangle2 *pTriangle) const
 Get the neighbor index of pTriangle. More...
 
int getMaxIndex () const
 Get the index of the largest edge.
 
double getMaxSqEdgeLen2D () const
 Get the maximum squared 2D edge length.
 
int getMinIndex () const
 Get the index of the smallest edge.
 
Vector2 getNormalVector () const
 Get the normal vector of a triangle. More...
 
Triangle2getOppositeTriangle (const int ith) const
 Get the i-th neighbor triangle. More...
 
double getSquaredEdgeLength25D (int ith) const
 Squared edge length. More...
 
double getSquaredEdgeLength2D (int ith) const
 ‍** More...
 
bool hasOn (const Point2 &q) const
 Has on (triangle) More...
 
bool hasOnEdge (int i, const Point2 &q) const
 Has point on edge. More...
 
bool hasVertex (const Point2 &vtx) const
 Has vertex. More...
 
bool hasVertex (const Point2 *pVtx) const
 Has vertex. More...
 
void setOppTriangle (const int ith, Triangle2 *pTriangle)
 Set the i-th neighbor triangle. More...
 
void setProperties (Point2 *pI, Point2 *pJ, Point2 *pK)
 Set all corners.
 
void setPropertiesAndOppT (Point2 *pI, Point2 *pJ, Point2 *pK, Triangle2 *pNeig0, Triangle2 *pNeig1, Triangle2 *pNeig2)
 Set all corners and neighbor triangles.
 
void setVertexPointer (const int ith, Point2 *pp)
 Set the i-th corner.
 

Protected Member Functions

double computeArea (double l0, double l1, double l2) const
 
bool getCC_inexact (double avgOffX, double avgOffY, Point2 &cc) const
 

Protected Attributes

Triangle2aOppTriangles [3]
 
Point2aVertexPointer [3]
 

Friends

std::ostream & operator<< (std::ostream &stream, const Triangle2 &c)
 
void registerTriangles (Triangle2 *fromTriangle, int ith, Triangle2 *toTriangle, int jth)
 

Detailed Description

Triangle2 is a triangle in the Fade_2D triangulation. It holds three Point2 pointers to its corners. The corners are numbered in counterclockwise order. We refer to these indices as intra-triangle-indices.

Each triangle has three neighbors which can be accessed through intra-triangle-indices: The i-th neighbor triangle of a certain triangle T is the one which shares an edge with T such that this edge does not include the i-th corner of T.

Indices and neighborships, tb is the 0-th neighbor of ta and ta is the 2nd neighbor of tb.
See also
TriangleAroundVertexIterator to find out how to access all triangles incident to a certain vertex.

Member Function Documentation

◆ getArea25D()

double GEOM_FADE25D::Triangle2::getArea25D ( ) const

Returns the 2.5D area of the triangle.

Note: The getArea() method is deprecated and replaced by getArea2D() and getArea25D()

◆ getArea2D()

double GEOM_FADE25D::Triangle2::getArea2D ( ) const

Returns the 2D area of the triangle.

Note: The getArea() method is deprecated and replaced by getArea2D() and getArea25D()

◆ getBarycenter()

Point2 GEOM_FADE25D::Triangle2::getBarycenter ( ) const
Returns
the barycenter of the triangle.

◆ getCircumcenter()

Point2 GEOM_FADE25D::Triangle2::getCircumcenter ( CircumcenterQuality ccq,
bool  bForceExact = false 
) const
Parameters
[out]ccqreturns the quality of the computed point and is one of CCQ_INEXACT, CCQ_EXACT and CCQ_OUT_OF_BOUNDS.
[in]bForceExactforces exact computation with multiple-precision arithmetic. When bForceExact=false, then the faster double-precision arithmetic is used for good shaped triangles.
Returns
the circumcenter of the triangle. The z-coordinate is 0.0. You can use Fade_2D::getHeight(..) to determine the height.
Attention
Attention: The circumcenter of a nearly collinear triangle can have extremely large coordinates. Fade computes the circumcenter with multiple-precision artihmetic in this case but the result might nevertheless not be exact because it too large for double-precision coordinates. In such cases a finite point is returned and ccq returns CCQ_OUT_OF_BOUNDS. You can avoid such extreme numeric cases easily: Just insert four dummy vertices around the triangulation at coordinates 10 times larger than the domain of the data points because this restricts the Voronoi cells of the data points to this range.

◆ getInteriorAngle25D()

double GEOM_FADE25D::Triangle2::getInteriorAngle25D ( int  ith) const
Returns
the interior 2.5D angle at the ith vertex

◆ getInteriorAngle2D()

double GEOM_FADE25D::Triangle2::getInteriorAngle2D ( int  ith) const

Note: The getInteriorAngle() method is deprecated and replaced by getInteriorAngle2D() and getInteriorAngle25D()

Returns
the interior 2D angle at the ith vertex

◆ getIntraTriangleIndex() [1/3]

int GEOM_FADE25D::Triangle2::getIntraTriangleIndex ( const Point2 p) const
inline
Intra triangle index of a vertex pointer
Parameters
pis a pointer to a vertex in *this
Returns
the intra-triangle-index 0,1 or 2 of p in *this

◆ getIntraTriangleIndex() [2/3]

int GEOM_FADE25D::Triangle2::getIntraTriangleIndex ( const Point2 p0,
const Point2 p1 
) const
inline
Returns
the index of the edge (p0,p1) in the triangle

◆ getIntraTriangleIndex() [3/3]

int GEOM_FADE25D::Triangle2::getIntraTriangleIndex ( const Triangle2 pTriangle) const
inline
pTriangle is the 0-th neighbor of *this
Parameters
pTriangleis a neighbor triangle of *this.
Returns
the intra-triangle-index of the vertex in *this which is opposite (i.e., does not touch the neighbor) pTriangle.

◆ getNormalVector()

Vector2 GEOM_FADE25D::Triangle2::getNormalVector ( ) const
Returns
the normalized normal vector

◆ getOppositeTriangle()

Triangle2 * GEOM_FADE25D::Triangle2::getOppositeTriangle ( const int  ith) const
inline

Returns the i-th neighbor triangle, i.e. the one opposite to the i-th corner.

Neighbors of a triangle
Parameters
ithis the intra-triangle-index of the opposite corner of *this
Returns
the i-th neighbor triangle, i.e. the one opposite to the i-th vertex or NULL if no neighbor triangle exists which is the case at the convex hull edges of the triangulation.

◆ getSquaredEdgeLength25D()

double GEOM_FADE25D::Triangle2::getSquaredEdgeLength25D ( int  ith) const

Returns the squared length of the ith edge.

◆ getSquaredEdgeLength2D()

double GEOM_FADE25D::Triangle2::getSquaredEdgeLength2D ( int  ith) const

Method for internal use

Squared edge length

Returns the squared length of the ith edge. This method ignores the z-coordinate.

◆ hasOn()

bool GEOM_FADE25D::Triangle2::hasOn ( const Point2 q) const
Returns
if q is on the triangle

This is a 2D test i.e., z coordinate is not evaluated

◆ hasOnEdge()

bool GEOM_FADE25D::Triangle2::hasOnEdge ( int  i,
const Point2 q 
) const
Returns
if q is exactly on the i-th edge

This is a 2D test i.e., z coordinate is not evaluated

◆ hasVertex() [1/2]

bool GEOM_FADE25D::Triangle2::hasVertex ( const Point2 vtx) const
Returns
if vtx is a corner of the triangle

◆ hasVertex() [2/2]

bool GEOM_FADE25D::Triangle2::hasVertex ( const Point2 pVtx) const
Returns
if pVtx is a corner of the triangle

◆ setOppTriangle()

void GEOM_FADE25D::Triangle2::setOppTriangle ( const int  ith,
Triangle2 pTriangle 
)
inline
Make pTriangle the 0-th neighbor of *this
Parameters
ithis the index of the corner of *this which does not touch pTriangle
pTriangleis a pointer to the triangle which shares two corners with *this

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