AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Represents an octahedral geometric shape defined by six points. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/primal/geometry/Octahedron.hpp>
Public Types | |
using | PointType = Point< T, NDIMS > |
using | VectorType = Vector< T, NDIMS > |
Public Member Functions | |
AXOM_HOST_DEVICE | Octahedron () |
Default Octahedron constructor. Creates a degenerate octahedron. More... | |
AXOM_HOST_DEVICE | Octahedron (const PointType &p, const PointType &q, const PointType &r, const PointType &s, const PointType &t, const PointType &u) |
Creates an octahedron from the 6 points p,q,r,s,t,u. More... | |
AXOM_HOST_DEVICE | Octahedron (const PointType *pts) |
Octahedron constructor from an array of Points. More... | |
AXOM_HOST_DEVICE | Octahedron (const axom::ArrayView< PointType > pts) |
Octahedron constructor from an Array of Points. More... | |
AXOM_HOST_DEVICE | Octahedron (std::initializer_list< PointType > pts) |
Octahedron constructor from an initializer list of Points. 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 bool | equals (const Octahedron &other, double eps=1.e-24) const |
Test if this Octahedron is equal to another, within a tolerance. More... | |
std::ostream & | print (std::ostream &os) const |
Simple formatted print of an octahedron instance. More... | |
Static Public Attributes | |
static constexpr int | NUM_VERTS = 6 |
Represents an octahedral geometric shape defined by six points.
T | the coordinate type, e.g., double, float, etc. |
NDIMS | the number of spatial dimensions |
There are six vertices in the octahedron, labelled P through U as the constructor's arguments. They are accessible using the square-brackets operator, with P being index 0, Q index 1, through U as index 5.
Imagine a regular octahedron with two parallel triangles, top and bottom— the end-caps, as it were. If you look "down", normal to the end-cap triangles, you will see that the vertices of the top triangle protrude beyond the edges of the bottom triangle (and vice versa). Here's a diagram showing just the end-cap triangles, omitting the other edges for clarity.
* * P * /\ * Q -------- U * \ / * /\ /\ * R --\ /-- T * \/ * S * *
Now imagine looking from the side, edge-on to the end-caps. If you unroll the "side-wall" triangles, you get a triangle strip. Here's another diagram showing just the triangle strip, with the same points labeled. Points P and Q are repeated so we can show all eight faces.
* * Q --- S --- U --- Q * / \ / \ / \ / * / \ / \ / \ / * P --- R --- T --- P * *
using axom::primal::Octahedron< T, NDIMS >::PointType = Point<T, NDIMS> |
using axom::primal::Octahedron< T, NDIMS >::VectorType = Vector<T, NDIMS> |
|
inline |
Default Octahedron constructor. Creates a degenerate octahedron.
|
inline |
Creates an octahedron from the 6 points p,q,r,s,t,u.
[in] | Point | corresponding to vertex p of the octahedron. |
[in] | Point | corresponding to vertex q of the octahedron. |
[in] | Point | corresponding to vertex r of the octahedron. |
[in] | Point | corresponding to vertex s of the octahedron. |
[in] | Point | corresponding to vertex t of the octahedron. |
[in] | Point | corresponding to vertex u of the octahedron. |
p is opposite s, q is opposite t, r is opposite u.
|
inlineexplicit |
Octahedron constructor from an array of Points.
[in] | pts | An array containing at least 6 Points. |
References axom::primal::Octahedron< T, NDIMS >::NUM_VERTS.
|
inlineexplicit |
Octahedron constructor from an Array of Points.
[in] | pts | An ArrayView containing at 6 Points. |
References axom::primal::Octahedron< T, NDIMS >::NUM_VERTS, axom::ArrayView< T, DIM, SPACE >::size(), and SLIC_ASSERT.
|
inlineexplicit |
Octahedron constructor from an initializer list of Points.
[in] | pts | an initializer list containing 6 Points |
References axom::primal::Octahedron< T, NDIMS >::NUM_VERTS, and SLIC_ASSERT.
|
inline |
Index operator to get the i^th vertex.
idx | The index of the desired vertex |
References axom::primal::Octahedron< T, NDIMS >::NUM_VERTS, and SLIC_ASSERT.
|
inline |
Index operator to get the i^th vertex.
idx | The index of the desired vertex |
References axom::primal::Octahedron< T, NDIMS >::NUM_VERTS, and SLIC_ASSERT.
|
inline |
Test if this Octahedron is equal to another, within a tolerance.
References axom::primal::Octahedron< T, NDIMS >::NUM_VERTS, and axom::primal::squared_distance().
|
inline |
Simple formatted print of an octahedron instance.
os | The output stream to write to |
|
staticconstexpr |