dlr::geometry::Ray2D Class Reference

The Ray2D class represents a ray in 2D space. More...

#include <ray2D.h>

List of all members.

Public Member Functions

 Ray2D ()
 The default constructor initializes to the ray that starts at the origin and points along the X axis.
 Ray2D (const Vector2D &point, const Vector2D &direction, bool normalize=true)
 This constructor initializes the ray using a point and a direction.
 Ray2D (double aa, double bb, double cc)
 This constructor initializes the ray according to the equation Ax + By + C = 0.
 Ray2D (const Ray2D &source)
 The copy constructor deep copies its argument.
 ~Ray2D ()
 Destructor.
Ray2Doperator= (const Ray2D &source)
 The assignment operator deep copies its argument.
const Vector2D & getDirection () const
 This member function returns the direction of the ray.
const Vector2D & getDirectionVector () const
 This member function returns the direction of the ray.
const Vector2D & getOrigin () const
 This member function returns the start point of the ray.


Detailed Description

The Ray2D class represents a ray in 2D space.

Definition at line 28 of file ray2D.h.


Constructor & Destructor Documentation

dlr::geometry::Ray2D::Ray2D (  )  [inline]

The default constructor initializes to the ray that starts at the origin and points along the X axis.

Definition at line 35 of file ray2D.h.

dlr::geometry::Ray2D::Ray2D ( const Vector2D &  point,
const Vector2D &  direction,
bool  normalize = true 
)

This constructor initializes the ray using a point and a direction.

Parameters:
point This argument specifies the start point of the ray.
direction This argument specifies the direction of the ray.
normalized If the direction vector is already normalized to unit length, then you can save some computation by setting this argument to false.

Definition at line 27 of file ray2D.cpp.

dlr::geometry::Ray2D::Ray2D ( double  aa,
double  bb,
double  cc 
)

This constructor initializes the ray according to the equation Ax + By + C = 0.

After construction, the ray origin is set to [-aa*cc / k, -bb*cc / k], where k = aa*aa + bb*bb, and the ray direction is set parallel to [-bb, aa].

Parameters:
aa This argument is the "A" coefficient of the line equation.
bb This argument is the "B" coefficient of the line equation.
cc This argument is the "C" coefficient of the line equation.

Definition at line 42 of file ray2D.cpp.

dlr::geometry::Ray2D::Ray2D ( const Ray2D source  ) 

The copy constructor deep copies its argument.

Parameters:
source This argument is the class instance to be copied.

Definition at line 54 of file ray2D.cpp.

dlr::geometry::Ray2D::~Ray2D (  )  [inline]

Destructor.

Definition at line 82 of file ray2D.h.


Member Function Documentation

const Vector2D& dlr::geometry::Ray2D::getDirection (  )  const [inline]

This member function returns the direction of the ray.

Returns:
The return value is a const reference to Vector2D representing the direction of the ray.

Definition at line 104 of file ray2D.h.

Referenced by getDirectionVector().

const Vector2D& dlr::geometry::Ray2D::getDirectionVector (  )  const [inline]

This member function returns the direction of the ray.

Returns:
The return value is a const reference to Vector2D representing the direction of the ray.

Definition at line 114 of file ray2D.h.

References getDirection().

const Vector2D& dlr::geometry::Ray2D::getOrigin (  )  const [inline]

This member function returns the start point of the ray.

Returns:
The return value is a const reference to Vector2D representing the start point of the ray.

Definition at line 124 of file ray2D.h.

Ray2D & dlr::geometry::Ray2D::operator= ( const Ray2D source  ) 

The assignment operator deep copies its argument.

Parameters:
source This argument is the class instance to be copied.
Returns:
The return value is a reference to *this.

Definition at line 65 of file ray2D.cpp.

References m_direction, and m_origin.


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

Generated on Wed Nov 25 11:45:25 2009 for dlrGeometry Utility Library by  doxygen 1.5.8