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.5.0/src/axom/primal/geometry/Plane.hpp>
Public Member Functions | |
~Plane () | |
Destructor. More... | |
int | getDimension () const |
Returns the dimension of the Plane. More... | |
const T * | getNormal () const |
Returns a const pointer to the plane's unit normal. More... | |
T | getOffset () const |
Returns the offset of the plane from origin. More... | |
T | computeSignedDistance (const T *x) const |
Computes the signed distance of the specified point to this Plane. More... | |
void | projectPoint (const T *x, T *projx) const |
Computes the projection of a given point, x, onto this Plane. More... | |
void | flip () |
Flips the orientation of the plane. More... | |
int | getOrientation (const T *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 | |
Plane (const T *normal, const T *x) | |
Constructs a Plane with a given normal, \( \mathcal{N} \), that passes through the specified point, \( x \). More... | |
Plane (const T *normal, T offset) | |
Constructs a plane with a specified normal, \( \mathcal{N} \), located at the given offset from origin. More... | |
Plane (const T *x1, const T *x2, const T *x3) | |
Constructs a Plane that goes through the specified points. 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 |
axom::primal::Plane< T, NDIMS >::Plane | ( | const T * | normal, |
const T * | 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_STATIC_ASSERT_MSG, axom::numerics::dot_product(), axom::numerics::normalize(), and SLIC_ASSERT.
axom::primal::Plane< T, NDIMS >::Plane | ( | const T * | 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::numerics::normalize(), and SLIC_ASSERT.
axom::primal::Plane< T, NDIMS >::Plane | ( | const T * | x1, |
const T * | x2, | ||
const T * | x3 | ||
) |
Constructs a Plane that goes through the specified points.
[in] | x1 | coordinates of the first point. |
[in] | x2 | coordinates of the second point. |
[in] | x3 | coordinates of the third point, or nullptr for 2D. |
References AXOM_STATIC_ASSERT_MSG, axom::numerics::cross_product(), axom::numerics::dot_product(), axom::utilities::isNearlyEqual(), axom::numerics::normalize(), SLIC_ASSERT, and SLIC_ERROR_IF.
axom::primal::Plane< T, NDIMS >::~Plane | ( | ) |
Destructor.
|
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. |
x
, should point to a buffer that is at least NDIMS long.References axom::numerics::dot_product(), 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. |
[out] | projx | buffer to store the coordinates of the projected point. |
x
should point to a buffer that is at least NDIMS long. projx
should point to a buffer that is at least NDIMS long.References axom::primal::Plane< T, NDIMS >::computeSignedDistance().
Referenced by axom::primal::Plane< T, NDIMS >::computeSignedDistance().
|
inline |
Flips the orientation of the plane.
Referenced by axom::primal::Plane< T, NDIMS >::computeSignedDistance().
|
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::primal::Plane< T, NDIMS >::computeSignedDistance(), axom::utilities::isNearlyEqual(), axom::primal::ON_BOUNDARY, axom::primal::ON_NEGATIVE_SIDE, and axom::primal::ON_POSITIVE_SIDE.
Referenced by axom::primal::Plane< T, NDIMS >::computeSignedDistance().
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. |
Referenced by axom::primal::Plane< T, NDIMS >::computeSignedDistance().