dlr::numeric::Vector3D Class Reference

The Vector2D class represents a real valued 2D vector. More...

#include <vector3D.h>

List of all members.

Public Member Functions

 Vector3D ()
 Default constructor initializes to (0, 0, 0).
 Vector3D (double xCoord, double yCoord, double zCoord)
 Explicitly sets 3D coordinates.
 Vector3D (double xCoord, double yCoord, double zCoord, double alpha)
 Explicitly sets 3D homogeneous coordinates.
 Vector3D (const Vector3D &source)
 Copy constructor.
 ~Vector3D ()
 Destructor.
Vector3Dclear ()
 Resets the vector to (0.0, 0.0, 0.0).
void setValue (double xCoord, double yCoord, double zCoord)
 Explicitly sets 3D coordinates.
void setValue (double xCoord, double yCoord, double zCoord, double alpha)
 Explicitly sets 3D homogeneous coordinates.
double & x ()
 Returns the x component of the vector by reference.
double x () const
 Returns the x component of the vector by value.
double & y ()
 Returns the y component of the vector by reference.
double y () const
 Returns the y component of the vector by value.
double & z ()
 Returns the z component of the vector by reference.
double z () const
 Returns the z component of the vector by value.
Vector3Doperator= (const Vector3D &source)
 Assignment operator.
double & operator[] (size_t index)
 The indexing operator returns a reference to the x, y, or z component of *this as if *this were a three element array.
double operator[] (size_t index) const
 The indexing operator returns the value of the x, y, or z component of *this as if *this were a three element array.
Vector3Doperator*= (double scalar)
 Multiplies each element by a scalar.
Vector3Doperator/= (double scalar)
 Divides each element by a scalar.
Vector3Doperator+= (const Vector3D &vec)
 Adds the elements of another Vector3D.
Vector3Doperator-= (const Vector3D &vec)
 Subtracts the elements of another Vector3D.
Vector3D operator- ()
 Returns a Vector3D equal to *this, but with each element negated.


Detailed Description

The Vector2D class represents a real valued 2D vector.

Definition at line 28 of file vector3D.h.


Constructor & Destructor Documentation

dlr::numeric::Vector3D::Vector3D (  )  [inline]

Default constructor initializes to (0, 0, 0).

Definition at line 33 of file vector3D.h.

Referenced by operator-().

dlr::numeric::Vector3D::Vector3D ( double  xCoord,
double  yCoord,
double  zCoord 
) [inline]

Explicitly sets 3D coordinates.

Parameters:
xCoord After construction, the vector will have this value as its X coordinate.
yCoord After construction, the vector will have this value as its Y coordinate.
zCoord After construction, the vector will have this value as its Z coordinate.

Definition at line 46 of file vector3D.h.

dlr::numeric::Vector3D::Vector3D ( double  xCoord,
double  yCoord,
double  zCoord,
double  alpha 
) [inline]

Explicitly sets 3D homogeneous coordinates.

A 3D homogeneous vector has the form (xCoord, yCoord, zCoord, alpha), and corresponds to the 3D point (xCoord/alpha, yCoord/alpha, zCoord/alpha).

Parameters:
xCoord The homogeneous X coordinate.
yCoord The homogeneous Y coordinate.
zCoord The homogeneous Z coordinate.
alpha Scale factor.

Definition at line 59 of file vector3D.h.

dlr::numeric::Vector3D::Vector3D ( const Vector3D source  )  [inline]

Copy constructor.

Parameters:
source The Vector3D to be copied.

Definition at line 67 of file vector3D.h.

dlr::numeric::Vector3D::~Vector3D (  )  [inline]

Destructor.

Definition at line 74 of file vector3D.h.


Member Function Documentation

Vector3D& dlr::numeric::Vector3D::clear (  )  [inline]

Resets the vector to (0.0, 0.0, 0.0).

Returns:
A reference to *this.

Definition at line 82 of file vector3D.h.

Vector3D& dlr::numeric::Vector3D::operator*= ( double  scalar  )  [inline]

Multiplies each element by a scalar.

Parameters:
scalar X, Y, and Z values will be multiplied by this value.
Returns:
Reference to *this.

Definition at line 204 of file vector3D.h.

Vector3D& dlr::numeric::Vector3D::operator+= ( const Vector3D vec  )  [inline]

Adds the elements of another Vector3D.

Parameters:
vec The elements of vec will be added to *this.
Returns:
Reference to *this.

Definition at line 228 of file vector3D.h.

References m_x, m_y, and m_z.

Vector3D dlr::numeric::Vector3D::operator- (  )  [inline]

Returns a Vector3D equal to *this, but with each element negated.

Returns:
The result of the negation.

Definition at line 247 of file vector3D.h.

References Vector3D().

Vector3D& dlr::numeric::Vector3D::operator-= ( const Vector3D vec  )  [inline]

Subtracts the elements of another Vector3D.

Parameters:
vec The elements of vec will be subtracted from *this.
Returns:
Reference to *this.

Definition at line 238 of file vector3D.h.

References m_x, m_y, and m_z.

Vector3D& dlr::numeric::Vector3D::operator/= ( double  scalar  )  [inline]

Divides each element by a scalar.

Parameters:
scalar X, Y, and Z values will be divided by this value.
Returns:
Reference to *this.

Definition at line 214 of file vector3D.h.

Vector3D& dlr::numeric::Vector3D::operator= ( const Vector3D source  )  [inline]

Assignment operator.

Parameters:
source The vector to be copied.
Returns:
Reference to *this.

Definition at line 160 of file vector3D.h.

References m_x, m_y, m_z, and setValue().

double dlr::numeric::Vector3D::operator[] ( size_t  index  )  const [inline]

The indexing operator returns the value of the x, y, or z component of *this as if *this were a three element array.

Out of bounds indices will return this-z().

Parameters:
index This argument is the index into *this.
Returns:
The return value is the selected component of *this.

Definition at line 190 of file vector3D.h.

References x(), y(), and z().

double& dlr::numeric::Vector3D::operator[] ( size_t  index  )  [inline]

The indexing operator returns a reference to the x, y, or z component of *this as if *this were a three element array.

Out of bounds indices will return this->z().

Parameters:
index This argument is the index into *this.
Returns:
The return value is the selected component of *this.

Definition at line 173 of file vector3D.h.

References x(), y(), and z().

void dlr::numeric::Vector3D::setValue ( double  xCoord,
double  yCoord,
double  zCoord,
double  alpha 
) [inline]

Explicitly sets 3D homogeneous coordinates.

Parameters:
xCoord The homogeneous X coordinate.
yCoord The homogeneous Y coordinate.
zCoord The homogeneous Z coordinate.
alpha Scale factor.

Definition at line 107 of file vector3D.h.

void dlr::numeric::Vector3D::setValue ( double  xCoord,
double  yCoord,
double  zCoord 
) [inline]

Explicitly sets 3D coordinates.

Parameters:
xCoord The desired X coordinate.
yCoord The desired Y coordinate.
zCoord The desired Z coordinate.

Definition at line 95 of file vector3D.h.

Referenced by operator=(), and dlr::numeric::operator>>().

double dlr::numeric::Vector3D::x (  )  const [inline]

Returns the x component of the vector by value.

Returns:
The value of the x component of the vector.

Definition at line 124 of file vector3D.h.

double& dlr::numeric::Vector3D::x (  )  [inline]

double dlr::numeric::Vector3D::y (  )  const [inline]

Returns the y component of the vector by value.

Returns:
The value of the y component of the vector.

Definition at line 138 of file vector3D.h.

double& dlr::numeric::Vector3D::y (  )  [inline]

double dlr::numeric::Vector3D::z (  )  const [inline]

Returns the z component of the vector by value.

Returns:
The value of the z component of the vector.

Definition at line 152 of file vector3D.h.

double& dlr::numeric::Vector3D::z (  )  [inline]


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

Generated on Wed Nov 25 00:42:50 2009 for dlrUtilities Utility Library by  doxygen 1.5.8