Represents a triangle in a triangulation. More...
#include <Triangle2.h>
Public Member Functions | |
| Triangle2 () | |
| Default constructor. | |
| double | getArea25D () const |
| Get the 2.5D area of the triangle. More... | |
| double | getArea2D () const |
| Get the 2D area of the triangle. More... | |
| Point2 | getBarycenter () const |
| Get the barycenter of the triangle. More... | |
| Point2 | getCircumcenter (CircumcenterQuality &ccq, bool bForceExact=false) const |
| Get the circumcenter of the triangle. More... | |
| Point2 * | getCorner (const int idx) const |
| Retrieves the specified corner of the triangle. More... | |
| void | getCorners (Point2 *&p0, Point2 *&p1, Point2 *&p2) const |
| Retrieves all three triangle corners. More... | |
| double | getInteriorAngle25D (int idx) const |
| Get the interior 2.5D angle. More... | |
| double | getInteriorAngle2D (int idx) const |
| Get interior 2D angle. More... | |
| int | getIntraTriangleIndex (const Point2 *p0, const Point2 *p1) const |
| Get the index of the specified edge. More... | |
| int | getIntraTriangleIndex (const Point2 *pCorner) const |
| Get the index of the specified corner. More... | |
| int | getIntraTriangleIndex (const Triangle2 *pNeig) const |
| Get the index of the specified neighbor triangle. More... | |
| int | getMaxIndex () const |
| Get the index of the largest edge. More... | |
| double | getMaxSqEdgeLen2D () const |
| Get the maximum squared 2D edge length. More... | |
| int | getMinIndex () const |
| Get the index of the smallest edge. More... | |
| Vector2 | getNormalVector () const |
| Get the normal vector of the triangle. More... | |
| Triangle2 * | getOppositeTriangle (const int idx) const |
| Get the neighbor triangle at the specified index. More... | |
| double | getSquaredEdgeLength25D (int idx) const |
| Get the squared 2.5D length of the specified edge. More... | |
| double | getSquaredEdgeLength2D (int idx) const |
| Get the squared 2D length of the specified edge. More... | |
| bool | hasOn (const Point2 &q) const |
| Check if the triangle includes the specified point. More... | |
| bool | hasOnEdge (int idx, const Point2 &q) const |
| Check if an edge includes the specified point. More... | |
| bool | hasVertex (const Point2 &q) const |
| Check if the specified point coincides with a corner of the triangle. More... | |
| bool | hasVertex (const Point2 *pVtx) const |
| Check if the specified vertex is a corner of the triangle. More... | |
| void | setProperties (Point2 *pI, Point2 *pJ, Point2 *pK) |
| Set all corners. More... | |
| void | setVertexPointer (const int idx, Point2 *pVtx) |
| Set a corner. More... | |
Friends | |
| CLASS_DECLSPEC friend std::ostream & | operator<< (std::ostream &stream, const Triangle2 &c) |
| Output operator for Triangle2. More... | |
| void | registerTriangles (Triangle2 *fromTriangle, int ith, Triangle2 *toTriangle, int jth) |
Triangle2 represents a triangle in a Fade_2D triangulation.
Details:
Point2. The corners are counterclockwise ordered and can be retrieved using the intra-triangle indices 0, 1 and 2.
| double GEOM_FADE25D::Triangle2::getArea25D | ( | ) | const |
Computes the 2.5D area of the current triangle.
| double GEOM_FADE25D::Triangle2::getArea2D | ( | ) | const |
Computes the 2D area of the current triangle.
| Point2 GEOM_FADE25D::Triangle2::getBarycenter | ( | ) | const |
Computes and returns the barycenter the this triangle.
| Point2 GEOM_FADE25D::Triangle2::getCircumcenter | ( | CircumcenterQuality & | ccq, |
| bool | bForceExact = false |
||
| ) | const |
Returns the circumcenter (the center of the circumcircle) of the current triangle.
| [out] | ccq | Indicates the quality of the computed circumcenter and is one of CCQ_INEXACT, CCQ_EXACT, and CCQ_OUT_OF_BOUNDS. |
| [in] | bForceExact | If true, forces exact computation with multiple-precision arithmetic. |
ccq is set to CCQ_OUT_OF_BOUNDS. To avoid these cases, insert four dummy vertices around the triangulation at coordinates 10 times larger than the domain of the data points. This restricts the Voronoi cells to a manageable range.
|
inline |
Retrieves a Point2* corresponding to the triangle corner specified by the intra-triangle index idx.
| idx | The intra-triangle index of the corner (0, 1, or 2). |
idx of the triangle. Retrieves the three corners of the Triangle2.
| [out] | p0,p1,p2 | Pointers to the three corners |
| double GEOM_FADE25D::Triangle2::getInteriorAngle25D | ( | int | idx | ) | const |
Returns the interior 2.5D angle at the vertex specified by the intra-triangle index idx.
idx. | double GEOM_FADE25D::Triangle2::getInteriorAngle2D | ( | int | idx | ) | const |
Returns the interior 2D angle at the vertex specified by the intra-triangle index idx.
idx
|
inline |
Retrieves the intra-triangle index of the edge defined by (p0,p1) in the current triangle.
| p0,p1 | Two corners specifying an edge of the current triangle. The order of p0 and p1 does not matter. |
(p0, p1) in the current triangle. This index corresponds to the intra-triangle index of the vertex opposite to this edge.
|
inline |
Retrieves the index of the triangle corner pCorner.
| pCorner | A pointer to a corner in the current triangle. |
pCorner in the current triangle.
|
inline |
Retrieves the intra-triangle index of the neighbor triangle pNeig.
pNeig in the current triangle is 0.| pNeig | A neighbor triangle of the current triangle. |
pNeig in the current triangle. This index corresponds to the intra-triangle index of the vertex opposite to pNeig in the current triangle. | int GEOM_FADE25D::Triangle2::getMaxIndex | ( | ) | const |
Returns the index of edge with the largest 2D length.
| double GEOM_FADE25D::Triangle2::getMaxSqEdgeLen2D | ( | ) | const |
Computes and returns the largest squared 2D edge length among the triangle's edges.
| int GEOM_FADE25D::Triangle2::getMinIndex | ( | ) | const |
Returns the intra-triangle index of the edge with the smallest 2D length.
| Vector2 GEOM_FADE25D::Triangle2::getNormalVector | ( | ) | const |
Computes the normalized normal vector of the current triangle.
|
inline |
Retrieves the neighbor triangle opposite to the corner at the specified intra-triangle index idx.
| idx | The intra-triangle index specifying the opposite corner (0, 1 or 2) |
idx, if any; NULL otherwise. | double GEOM_FADE25D::Triangle2::getSquaredEdgeLength25D | ( | int | idx | ) | const |
Computes the squared 2.5D length of the edge at index idx.
| idx | The index of the edge for which the squared 2.5D length is computed. |
idx. | double GEOM_FADE25D::Triangle2::getSquaredEdgeLength2D | ( | int | idx | ) | const |
Computes the squared 2D length of the edge at index idx.
| idx | The index of the edge for which the squared length is computed. |
idx.| bool GEOM_FADE25D::Triangle2::hasOn | ( | const Point2 & | q | ) | const |
Checks if the specified point q is on the current triangle.
| q | The point to test. |
true if q lies on the current triangle, false otherwise.This is a 2D test; it ignores the z coordinate.
| bool GEOM_FADE25D::Triangle2::hasOnEdge | ( | int | idx, |
| const Point2 & | q | ||
| ) | const |
Checks if the specified point q lies exactly on the edge at index idx of the current triangle.
true if the point q lies exactly on the edge at index idx, false otherwise.| bool GEOM_FADE25D::Triangle2::hasVertex | ( | const Point2 & | q | ) | const |
| bool GEOM_FADE25D::Triangle2::hasVertex | ( | const Point2 * | pVtx | ) | const |
Sets the three corner points. This method is mostly for internal use.
| pI,pJ,pK | The corners to be assigned. |
|
inline |
Sets the corner at the intra-triangle index idx. This method is mostly for internal use.
| idx | The intra-triangle index (0, 1, or 2). |
| pVtx | A pointer to a Point2 object |
|
friend |