AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Defines an oriented plane within a 2-D or 3-D Euclidean space and provides associated operators, such as, projection, signed distance, orientation, etc. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/primal/geometry/Plane.hpp>
Public Types | |
using | VectorType = primal::Vector< T, NDIMS > |
using | PointType = primal::Point< T, NDIMS > |
Public Member Functions | |
AXOM_HOST_DEVICE int | getDimension () const |
Returns the dimension of the Plane. More... | |
AXOM_HOST_DEVICE const VectorType & | getNormal () const |
Returns a const pointer to the plane's unit normal. More... | |
AXOM_HOST_DEVICE T | getOffset () const |
Returns the offset of the plane from origin. More... | |
AXOM_HOST_DEVICE T | signedDistance (const PointType &x) const |
Computes the signed distance of the specified point to this Plane. More... | |
PointType | projectPoint (const PointType &x) const |
Computes the projection of a given point, x, onto this Plane. More... | |
void | flip () |
Flips the orientation of the plane. More... | |
AXOM_HOST_DEVICE int | getOrientation (const PointType &x, double TOL=1.e-9) const |
Computes the orientation of the point with respect to this Plane. More... | |
std::ostream & | print (std::ostream &os) const |
Prints the Plane information in the given output stream. More... | |
Constructors | |
AXOM_HOST_DEVICE | Plane (const VectorType &normal, const PointType &x) |
Constructs a Plane with a given normal, \( \mathcal{N} \), that passes through the specified point, \( x \). More... | |
AXOM_HOST_DEVICE | Plane (const VectorType &normal, T offset) |
Constructs a plane with a specified normal, \( \mathcal{N} \), located at the given offset from origin. More... | |
Defines an oriented plane within a 2-D or 3-D Euclidean space and provides associated operators, such as, projection, signed distance, orientation, etc.
The Plane object defines an oriented plane in Hessian Normal form:
\( \mathcal{N} \cdot x - d = 0 \)
where, \( \mathcal{N} \) is a unit normal and \( d \) is the offset of the plane (in the direction of the specified normal) to the origin.
The Plane class defines a co-dimension-one plane that splits the ambient space into two halfspaces, such that, the signed distance for any point is: (a) negative below the plance, (b) positive above the plane and (c) zero on the plane.
A Plane object may be constructed in three ways:
T | the underlying data type, e.g., double, float, etc. |
NDIMS | the number of dimensions |
using axom::primal::Plane< T, NDIMS >::VectorType = primal::Vector<T, NDIMS> |
using axom::primal::Plane< T, NDIMS >::PointType = primal::Point<T, NDIMS> |
axom::primal::Plane< T, NDIMS >::Plane | ( | const VectorType & | normal, |
const PointType & | x | ||
) |
Constructs a Plane with a given normal, \( \mathcal{N} \), that passes through the specified point, \( x \).
[in] | normal | the supplied plane normal, \( \mathcal{N} \) |
[in] | x | a specified point that the plane passes through, \( x \) |
References axom::primal::Point< T, NDIMS >::array(), AXOM_STATIC_ASSERT_MSG, axom::primal::Vector< T, NDIMS >::is_zero(), and SLIC_ASSERT_MSG.
axom::primal::Plane< T, NDIMS >::Plane | ( | const VectorType & | normal, |
T | offset | ||
) |
Constructs a plane with a specified normal, \( \mathcal{N} \), located at the given offset from origin.
[in] | normal | the supplied plane normal, \( \mathcal{N} \) |
[in] | offset | the plane offset from origin |
References AXOM_STATIC_ASSERT_MSG, axom::primal::Vector< T, NDIMS >::is_zero(), and SLIC_ASSERT_MSG.
|
inline |
|
inline |
Returns a const pointer to the plane's unit normal.
|
inline |
Returns the offset of the plane from origin.
|
inline |
Computes the signed distance of the specified point to this Plane.
[in] | x | buffer consisting of the query point coordinates. |
References axom::primal::Point< T, NDIMS >::array(), AXOM_HOST_DEVICE, axom::primal::Vector< T, NDIMS >::dot(), axom::primal::Plane< T, NDIMS >::flip(), axom::primal::Plane< T, NDIMS >::getOrientation(), axom::primal::Plane< T, NDIMS >::print(), and axom::primal::Plane< T, NDIMS >::projectPoint().
Referenced by axom::primal::Plane< T, NDIMS >::getOrientation(), and axom::primal::Plane< T, NDIMS >::projectPoint().
|
inline |
Computes the projection of a given point, x, onto this Plane.
[in] | x | buffer consisting of the coordinates of the point to project. |
References axom::primal::Plane< T, NDIMS >::signedDistance().
Referenced by axom::primal::Plane< T, NDIMS >::signedDistance().
|
inline |
Flips the orientation of the plane.
Referenced by axom::primal::Plane< T, NDIMS >::signedDistance().
|
inline |
Computes the orientation of the point with respect to this Plane.
[in] | x | buffer consisting of the query point coordinates. |
[in] | TOL | user-supplied tolerance. Optional. Default is 1.e-9. |
x
lies on the plane x
is above the plane x
is below the plane References axom::utilities::isNearlyEqual(), axom::primal::ON_BOUNDARY, axom::primal::ON_NEGATIVE_SIDE, axom::primal::ON_POSITIVE_SIDE, and axom::primal::Plane< T, NDIMS >::signedDistance().
Referenced by axom::primal::Plane< T, NDIMS >::signedDistance().
std::ostream & axom::primal::Plane< T, NDIMS >::print | ( | std::ostream & | os | ) | const |
Prints the Plane information in the given output stream.
[in] | os | The output stream to write to. |
References axom::primal::Vector< T, NDIMS >::unitVector().
Referenced by axom::primal::Plane< T, NDIMS >::signedDistance().