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/v0.5.0/src/axom/primal/geometry/Ray.hpp>

Public Types

typedef Point< T, NDIMS > PointType
 
typedef Segment< T, NDIMS > SegmentType
 
typedef Vector< T, NDIMS > VectorType
 

Public Member Functions

 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...
 
 ~Ray ()
 Ray Destructor. More...
 
const PointTypeorigin () const
 Returns the point of origin of this Ray instance. More...
 
PointType at (const T &t) const
 Returns a point along the ray by evaluating \( R(t) \). More...
 
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

◆ PointType

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

◆ SegmentType

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

◆ VectorType

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

Constructor & Destructor Documentation

◆ Ray() [1/2]

template<typename T , int NDIMS>
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() [2/2]

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 axom::primal::Segment< T, NDIMS >::source(), axom::primal::Segment< T, NDIMS >::target(), and axom::primal::Vector< T, NDIMS >::unitVector().

◆ ~Ray()

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

Ray Destructor.

Member Function Documentation

◆ origin()

template<typename T, int NDIMS>
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.

References axom::primal::Ray< T, NDIMS >::at().

◆ at()

template<typename T , int NDIMS>
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 \)

Referenced by axom::quest::InOutOctree< DIM >::generateIndex(), and axom::primal::Ray< T, NDIMS >::origin().

◆ direction()

template<typename T, int NDIMS>
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

Referenced by axom::quest::InOutOctree< DIM >::generateIndex().

◆ 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: