Public Member Functions | Private Attributes | Related Functions
vgl_ray_3d< Type > Class Template Reference

Represents a 3-d ray. More...

#include <vgl_ray_3d.h>

List of all members.

Public Member Functions

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

Private Attributes

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

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.
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.
template<class Type >
vcl_ostream & operator<< (vcl_ostream &s, const vgl_ray_3d< Type > &p)
 Write to stream.
template<class Type >
vcl_istream & operator>> (vcl_istream &is, vgl_ray_3d< Type > &p)
 Read from stream.

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 27 of file vgl_ray_3d.h.


Constructor & Destructor Documentation

template<class Type>
vgl_ray_3d< Type >::vgl_ray_3d ( ) [inline]

Default constructor - does not initialise!.

Definition at line 33 of file vgl_ray_3d.h.

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.

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.

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.

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.

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.

template<class Type>
vgl_ray_3d< Type >::~vgl_ray_3d ( ) [inline]

Destructor.

Definition at line 63 of file vgl_ray_3d.h.


Member Function Documentation

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 13 of file vgl_ray_3d.txx.

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

Definition at line 68 of file vgl_ray_3d.h.

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.

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.

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.

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

template<class Type >
vcl_ostream & operator<< ( vcl_ostream &  s,
const vgl_ray_3d< Type > &  p 
) [related]

Write to stream.

template<class Type >
vcl_istream & operator>> ( vcl_istream &  is,
vgl_ray_3d< Type > &  p 
) [related]

Read from stream.

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.

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 167 of file vgl_intersection.txx.


Member Data Documentation

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.

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: