Public Member Functions | Private Attributes | Related Functions | List of all members
vgl_ray_3d< Type > Class Template Reference

Represents a 3-d ray. More...

#include <vgl_fwd.h>

Public Member Functions

 vgl_ray_3d ()=default
 Default constructor - does not initialise!. More...
 
 vgl_ray_3d (vgl_ray_3d< Type > const &l)
 Copy constructor. More...
 
 vgl_ray_3d (vgl_point_3d< Type > const &p0, vgl_vector_3d< Type > const &direction)
 Construct from orign and direction. More...
 
 vgl_ray_3d (vgl_point_3d< Type > const &origin, vgl_point_3d< Type > const &p)
 Construct from two points. More...
 
 vgl_ray_3d (vgl_line_segment_3d< Type > const &ls)
 Construct from a line segment, direction from 1 to 2. More...
 
 vgl_ray_3d (vgl_line_3d_2_points< Type > const &ls)
 Construct from a line 2 points direction from 1 to 2. More...
 
 ~vgl_ray_3d ()=default
 Destructor. More...
 
vgl_point_3d< Type > origin () const
 Accessors. More...
 
vgl_vector_3d< Type > direction () const
 
bool operator== (vgl_ray_3d< Type > const &r) const
 The comparison operator. More...
 
bool operator!= (vgl_ray_3d< Type >const &other) const
 
void set (vgl_point_3d< Type > const &p0, vgl_vector_3d< Type > const &direction)
 Assignment. More...
 
bool contains (const vgl_point_3d< Type > &p) const
 Check if point p is on the ray and lies in the positive ray direction. More...
 

Private Attributes

vgl_point_3d< Type > p0_
 The ray origin. More...
 
vgl_vector_3d< Type > t_
 ray direction vector More...
 

Related Functions

(Note that these are not member functions.)

template<class T >
bool vgl_intersection (vgl_ray_3d< T > const &r1, vgl_ray_3d< T > const &r2, vgl_point_3d< T > &i_pnt)
 Return the intersection point of rays. Returns false if rays are parallel or intersect outside of positive ray domain. More...
 
template<class T >
bool vgl_intersection (vgl_box_3d< T > const &box, vgl_ray_3d< T > const &ray, vgl_point_3d< T > &p0, vgl_point_3d< T > &p1)
 Return true if ray intersects box. If so, compute intersection points. More...
 
template<class Type >
std::ostream & operator<< (std::ostream &s, const vgl_ray_3d< Type > &p)
 Write to stream. More...
 
template<class Type >
std::istream & operator>> (std::istream &is, vgl_ray_3d< Type > &p)
 Read from stream. More...
 

Detailed Description

template<class Type>
class vgl_ray_3d< Type >

Represents a 3-d ray.

The ray origin is p0 and the direction is t_.

Definition at line 21 of file vgl_fwd.h.

Constructor & Destructor Documentation

◆ vgl_ray_3d() [1/6]

template<class Type>
vgl_ray_3d< Type >::vgl_ray_3d ( )
inlinedefault

Default constructor - does not initialise!.

◆ vgl_ray_3d() [2/6]

template<class Type>
vgl_ray_3d< Type >::vgl_ray_3d ( vgl_ray_3d< Type > const &  l)
inline

Copy constructor.

Definition at line 36 of file vgl_ray_3d.h.

◆ vgl_ray_3d() [3/6]

template<class Type>
vgl_ray_3d< Type >::vgl_ray_3d ( vgl_point_3d< Type > const &  p0,
vgl_vector_3d< Type > const &  direction 
)
inline

Construct from orign and direction.

Definition at line 40 of file vgl_ray_3d.h.

◆ vgl_ray_3d() [4/6]

template<class Type>
vgl_ray_3d< Type >::vgl_ray_3d ( vgl_point_3d< Type > const &  origin,
vgl_point_3d< Type > const &  p 
)
inline

Construct from two points.

Definition at line 45 of file vgl_ray_3d.h.

◆ vgl_ray_3d() [5/6]

template<class Type>
vgl_ray_3d< Type >::vgl_ray_3d ( vgl_line_segment_3d< Type > const &  ls)
inline

Construct from a line segment, direction from 1 to 2.

Definition at line 49 of file vgl_ray_3d.h.

◆ vgl_ray_3d() [6/6]

template<class Type>
vgl_ray_3d< Type >::vgl_ray_3d ( vgl_line_3d_2_points< Type > const &  ls)
inline

Construct from a line 2 points direction from 1 to 2.

Definition at line 56 of file vgl_ray_3d.h.

◆ ~vgl_ray_3d()

template<class Type>
vgl_ray_3d< Type >::~vgl_ray_3d ( )
inlinedefault

Destructor.

Member Function Documentation

◆ contains()

template<class Type >
bool vgl_ray_3d< Type >::contains ( const vgl_point_3d< Type > &  p) const

Check if point p is on the ray and lies in the positive ray direction.

Definition at line 16 of file vgl_ray_3d.hxx.

◆ direction()

template<class Type>
vgl_vector_3d<Type> vgl_ray_3d< Type >::direction ( ) const
inline

Definition at line 68 of file vgl_ray_3d.h.

◆ operator!=()

template<class Type>
bool vgl_ray_3d< Type >::operator!= ( vgl_ray_3d< Type >const &  other) const
inline

Definition at line 75 of file vgl_ray_3d.h.

◆ operator==()

template<class Type>
bool vgl_ray_3d< Type >::operator== ( vgl_ray_3d< Type > const &  r) const
inline

The comparison operator.

Definition at line 72 of file vgl_ray_3d.h.

◆ origin()

template<class Type>
vgl_point_3d<Type> vgl_ray_3d< Type >::origin ( ) const
inline

Accessors.

Definition at line 66 of file vgl_ray_3d.h.

◆ set()

template<class Type>
void vgl_ray_3d< Type >::set ( vgl_point_3d< Type > const &  p0,
vgl_vector_3d< Type > const &  direction 
)
inline

Assignment.

Definition at line 79 of file vgl_ray_3d.h.

Friends And Related Function Documentation

◆ operator<<()

template<class Type >
std::ostream & operator<< ( std::ostream &  s,
const vgl_ray_3d< Type > &  p 
)
related

Write to stream.

◆ operator>>()

template<class Type >
std::istream & operator>> ( std::istream &  is,
vgl_ray_3d< Type > &  p 
)
related

Read from stream.

◆ vgl_intersection() [1/2]

template<class T >
bool vgl_intersection ( vgl_ray_3d< T > const &  r1,
vgl_ray_3d< T > const &  r2,
vgl_point_3d< T > &  i_pnt 
)
related

Return the intersection point of rays. Returns false if rays are parallel or intersect outside of positive ray domain.

◆ vgl_intersection() [2/2]

template<class T >
bool vgl_intersection ( vgl_box_3d< T > const &  box,
vgl_ray_3d< T > const &  ray,
vgl_point_3d< T > &  p0,
vgl_point_3d< T > &  p1 
)
related

Return true if ray intersects box. If so, compute intersection points.

If ray origin is inside box then p0==p1

Definition at line 171 of file vgl_intersection.hxx.

Member Data Documentation

◆ p0_

template<class Type>
vgl_point_3d<Type> vgl_ray_3d< Type >::p0_
private

The ray origin.

Definition at line 29 of file vgl_ray_3d.h.

◆ t_

template<class Type>
vgl_vector_3d<Type> vgl_ray_3d< Type >::t_
private

ray direction vector

Definition at line 30 of file vgl_ray_3d.h.


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