Triangle. More...
#include <Triangle2.h>
Public Member Functions | |
Triangle2 () | |
Constructor. | |
void | clearProperties () |
Clear all corners and neighbor pointers. | |
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 | 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. | |
Triangle2 * | getOppositeTriangle (const int ith) const |
Get the i-th neighbor triangle. 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 | |
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) |
Triangle.
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_FADE2D::Triangle2::getArea2D | ( | ) | const |
Get 2D Area.
Returns the 2D area of the triangle.
Note: The getArea() method is deprecated and replaced by getArea2D() to keep the names consistent.
Point2 GEOM_FADE2D::Triangle2::getBarycenter | ( | ) | const |
Get the barycenter of a triangle.
Point2 GEOM_FADE2D::Triangle2::getCircumcenter | ( | CircumcenterQuality & | ccq, |
bool | bForceExact = false |
||
) | const |
Get the circumcenter of the triangle.
[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_FADE2D::Triangle2::getInteriorAngle2D | ( | int | ith | ) | const |
Get interior 2D angle.
Note: The getArea() method is deprecated and replaced by getInteriorAngle2D() to keep the names consistent.
|
inline |
Get the index of p in the triangle.
p | is a pointer to a vertex in *this |
|
inline |
Get the index of (p0,p1)
(p0,p1) in the triangle
|
inline |
Get the neighbor index of pTriangle.
pTriangle | is a neighbor triangle of *this. |
|
inline |
Get the i-th neighbor triangle.
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_FADE2D::Triangle2::getSquaredEdgeLength2D | ( | int | ith | ) | const |
**
Method for internal use
Squared edge length
Returns the squared length of the ith edge.
bool GEOM_FADE2D::Triangle2::hasOn | ( | const Point2 & | q | ) | const |
Has on (triangle)
q
is on the triangle bool GEOM_FADE2D::Triangle2::hasOnEdge | ( | int | i, |
const Point2 & | q | ||
) | const |
Has point on edge.
q
is exactly on the i-th edge bool GEOM_FADE2D::Triangle2::hasVertex | ( | const Point2 & | vtx | ) | const |
Has vertex.
vtx
is a corner of the triangle bool GEOM_FADE2D::Triangle2::hasVertex | ( | const Point2 * | pVtx | ) | const |
Has vertex.
pVtx
is a corner of the triangle
|
inline |
Set the i-th neighbor triangle.
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 |