AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Represents a triangular geometric shape defined by three points. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/primal/geometry/Triangle.hpp>
Public Types | |
enum | { NUM_TRI_VERTS = 3 } |
using | PointType = Point< T, NDIMS > |
using | VectorType = Vector< T, NDIMS > |
Public Member Functions | |
AXOM_HOST_DEVICE | Triangle () |
Default constructor. Creates a degenerate triangle. More... | |
AXOM_HOST_DEVICE | Triangle (const PointType &A, const PointType &B, const PointType &C) |
Custom Constructor. Creates a triangle from the 3 points A,B,C. More... | |
AXOM_HOST_DEVICE | ~Triangle () |
Destructor. More... | |
AXOM_HOST_DEVICE PointType & | operator[] (int idx) |
Index operator to get the i^th vertex. More... | |
AXOM_HOST_DEVICE const PointType & | operator[] (int idx) const |
Index operator to get the i^th vertex. More... | |
AXOM_HOST_DEVICE VectorType | normal () const |
Returns the normal of the triangle (not normalized) More... | |
AXOM_HOST_DEVICE double | area () const |
Returns the area of the triangle. More... | |
Point< double, 3 > | physToBarycentric (const PointType &p) const |
Returns the barycentric coordinates of a point within a triangle. More... | |
PointType | baryToPhysical (const Point< double, 3 > &bary) const |
Returns the physical coordinates of a barycentric point. More... | |
AXOM_HOST_DEVICE bool | degenerate (double eps=1.0e-12) const |
Returns whether the triangle is degenerate. More... | |
bool | checkInTriangle (const PointType &p, double eps=1.0e-8) const |
Returns whether Point P is in the triangle for some 3d Triangle. More... | |
AXOM_HOST_DEVICE double | angle (int idx) const |
Computes the request angle corresponding to the given vertex ID. More... | |
std::ostream & | print (std::ostream &os) const |
Simple formatted print of a triangle instance. More... | |
Represents a triangular geometric shape defined by three points.
T | the coordinate type, e.g., double, float, etc. |
NDIMS | the number of dimensions |
using axom::primal::Triangle< T, NDIMS >::PointType = Point<T, NDIMS> |
using axom::primal::Triangle< T, NDIMS >::VectorType = Vector<T, NDIMS> |
axom::primal::Triangle< T, NDIMS >::Triangle | ( | ) |
Default constructor. Creates a degenerate triangle.
axom::primal::Triangle< T, NDIMS >::Triangle | ( | const PointType & | A, |
const PointType & | B, | ||
const PointType & | C | ||
) |
Custom Constructor. Creates a triangle from the 3 points A,B,C.
[in] | A | point instance corresponding to vertex A of the triangle. |
[in] | B | point instance corresponding to vertex B of the triangle. |
[in] | C | point instance corresponding to vertex C of the triangle. |
|
inline |
Destructor.
|
inline |
Index operator to get the i^th vertex.
idx | The index of the desired vertex |
|
inline |
Index operator to get the i^th vertex.
idx | The index of the desired vertex |
|
inline |
Returns the normal of the triangle (not normalized)
Referenced by axom::quest::SignedDistance< NDIMS, ExecSpace >::computeDistances().
|
inline |
Returns the area of the triangle.
Referenced by axom::primal::Triangle< double, NDIMS >::degenerate().
|
inline |
Returns the barycentric coordinates of a point within a triangle.
Referenced by axom::primal::Triangle< double, NDIMS >::checkInTriangle().
|
inline |
Returns the physical coordinates of a barycentric point.
[in] | bary | Barycentric coordinates relative to this triangle |
|
inline |
Returns whether the triangle is degenerate.
Referenced by axom::quest::getMeshTriangle().
|
inline |
Returns whether Point P is in the triangle for some 3d Triangle.
|
inline |
Computes the request angle corresponding to the given vertex ID.
[in] | idx | the index of the corresponding vertex |
Referenced by axom::primal::Triangle< double, NDIMS >::checkInTriangle(), and axom::quest::SignedDistance< NDIMS, ExecSpace >::computeDistances().
|
inline |
Simple formatted print of a triangle instance.
os | The output stream to write to |