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... | |
Triangle2 * | getOppositeTriangle (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 | 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 | |
Triangle2 * | aOppTriangles [3] |
Point2 * | aVertexPointer [3] |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Triangle2 &c) |
void | registerTriangles (Triangle2 *fromTriangle, int ith, Triangle2 *toTriangle, int jth) |
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.
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()
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()
Point2 GEOM_FADE25D::Triangle2::getBarycenter | ( | ) | const |
Point2 GEOM_FADE25D::Triangle2::getCircumcenter | ( | CircumcenterQuality & | ccq, |
bool | bForceExact = false |
||
) | const |
[out] | ccq | returns the quality of the computed point and is one of CCQ_INEXACT, CCQ_EXACT and CCQ_OUT_OF_BOUNDS. |
[in] | bForceExact | forces exact computation with multiple-precision arithmetic. When bForceExact=false, then the faster double-precision arithmetic is used for good shaped triangles. |
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. double GEOM_FADE25D::Triangle2::getInteriorAngle25D | ( | int | ith | ) | const |
double GEOM_FADE25D::Triangle2::getInteriorAngle2D | ( | int | ith | ) | const |
Note: The getInteriorAngle() method is deprecated and replaced by getInteriorAngle2D() and getInteriorAngle25D()
|
inline |
p | is a pointer to a vertex in *this |
|
inline |
(p0,p1) in the triangle
|
inline |
pTriangle | is a neighbor triangle of *this. |
Vector2 GEOM_FADE25D::Triangle2::getNormalVector | ( | ) | const |
|
inline |
Returns the i-th neighbor triangle, i.e. the one opposite to the i-th corner.
ith | is the intra-triangle-index of the opposite corner of *this |
double GEOM_FADE25D::Triangle2::getSquaredEdgeLength25D | ( | int | ith | ) | const |
Returns the squared length of the ith edge.
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.
bool GEOM_FADE25D::Triangle2::hasOnEdge | ( | int | i, |
const Point2 & | q | ||
) | const |
q
is exactly on the i-th edge bool GEOM_FADE25D::Triangle2::hasVertex | ( | const Point2 & | vtx | ) | const |
vtx
is a corner of the triangle bool GEOM_FADE25D::Triangle2::hasVertex | ( | const Point2 * | pVtx | ) | const |
pVtx
is a corner of the triangle
|
inline |
ith | is the index of the corner of *this which does not touch pTriangle |
pTriangle | is a pointer to the triangle which shares two corners with *this |