AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::primal::Ray< T, NDIMS > Class Template Reference

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/primal/geometry/Ray.hpp>

Public Types

using CoordType = T
 
using PointType = Point< T, NDIMS >
 
using SegmentType = Segment< T, NDIMS >
 
using VectorType = Vector< T, NDIMS >
 

Public Member Functions

 Ray ()=delete
 Disable the default constructor. More...
 
AXOM_HOST_DEVICE Ray (const PointType &origin, const VectorType &direction)
 Constructs a ray object with the given origin and direction. More...
 
 Ray (const SegmentType &S)
 Constructs a ray object from a directed segment. More...
 
AXOM_HOST_DEVICE const PointTypeorigin () const
 Returns the point of origin of this Ray instance. More...
 
AXOM_HOST_DEVICE PointType at (const T &t) const
 Returns a point along the ray by evaluating \( R(t) \). More...
 
AXOM_HOST_DEVICE const VectorTypedirection () const
 Returns the direction vector of this Ray instance. More...
 
std::ostream & print (std::ostream &os) const
 Simple formatted print of a ray instance. More...
 

Member Typedef Documentation

◆ CoordType

template<typename T , int NDIMS>
using axom::primal::Ray< T, NDIMS >::CoordType = T

◆ PointType

template<typename T , int NDIMS>
using axom::primal::Ray< T, NDIMS >::PointType = Point<T, NDIMS>

◆ SegmentType

template<typename T , int NDIMS>
using axom::primal::Ray< T, NDIMS >::SegmentType = Segment<T, NDIMS>

◆ VectorType

template<typename T , int NDIMS>
using axom::primal::Ray< T, NDIMS >::VectorType = Vector<T, NDIMS>

Constructor & Destructor Documentation

◆ Ray() [1/3]

template<typename T , int NDIMS>
axom::primal::Ray< T, NDIMS >::Ray ( )
delete

Disable the default constructor.

◆ Ray() [2/3]

template<typename T , int NDIMS>
AXOM_HOST_DEVICE axom::primal::Ray< T, NDIMS >::Ray ( const PointType origin,
const VectorType direction 
)

Constructs a ray object with the given origin and direction.

Parameters
[in]originthe origin of the ray.
[in]directionthe direction of the ray.
Precondition
direction.squared_norm()!= 0.0

References SLIC_ASSERT, and axom::primal::Vector< T, NDIMS >::squared_norm().

◆ Ray() [3/3]

template<typename T , int NDIMS>
axom::primal::Ray< T, NDIMS >::Ray ( const SegmentType S)
explicit

Constructs a ray object from a directed segment.

Parameters
[in]Suser-supplied segment.

References SLIC_ASSERT, and axom::primal::Vector< T, NDIMS >::squared_norm().

Member Function Documentation

◆ origin()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE const PointType& axom::primal::Ray< T, NDIMS >::origin ( ) const
inline

Returns the point of origin of this Ray instance.

Returns
origin a point instance corresponding to the origin of the ray.

◆ at()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE Point< T, NDIMS > axom::primal::Ray< T, NDIMS >::at ( const T &  t) const
inline

Returns a point along the ray by evaluating \( R(t) \).

Parameters
[in]tuser-supplied value for R(t).
Returns
p a point along the ray.
Precondition
\( t \ge 0 \)

◆ direction()

template<typename T , int NDIMS>
AXOM_HOST_DEVICE const VectorType& axom::primal::Ray< T, NDIMS >::direction ( ) const
inline

Returns the direction vector of this Ray instance.

Returns
direction the direction vector of the ray.
Postcondition
direction.norm()==1

◆ print()

template<typename T , int NDIMS>
std::ostream& axom::primal::Ray< T, NDIMS >::print ( std::ostream &  os) const
inline

Simple formatted print of a ray instance.

Parameters
osThe output stream to write to
Returns
A reference to the modified ostream

The documentation for this class was generated from the following file: