#include <vector3D.h>
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. | |
Vector3D & | clear () |
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. | |
Vector3D & | operator= (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. | |
Vector3D & | operator*= (double scalar) |
Multiplies each element by a scalar. | |
Vector3D & | operator/= (double scalar) |
Divides each element by a scalar. | |
Vector3D & | operator+= (const Vector3D &vec) |
Adds the elements of another Vector3D. | |
Vector3D & | operator-= (const Vector3D &vec) |
Subtracts the elements of another Vector3D. | |
Vector3D | operator- () |
Returns a Vector3D equal to *this, but with each element negated. |
Definition at line 28 of file vector3D.h.
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.
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).
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.
source | The Vector3D to be copied. |
Definition at line 67 of file vector3D.h.
dlr::numeric::Vector3D::~Vector3D | ( | ) | [inline] |
Vector3D& dlr::numeric::Vector3D::clear | ( | ) | [inline] |
Resets the vector to (0.0, 0.0, 0.0).
Definition at line 82 of file vector3D.h.
Vector3D& dlr::numeric::Vector3D::operator*= | ( | double | scalar | ) | [inline] |
Multiplies each element by a scalar.
scalar | X, Y, and Z values will be multiplied by this value. |
Definition at line 204 of file vector3D.h.
Vector3D dlr::numeric::Vector3D::operator- | ( | ) | [inline] |
Returns a Vector3D equal to *this, but with each element negated.
Definition at line 247 of file vector3D.h.
References Vector3D().
Vector3D& dlr::numeric::Vector3D::operator/= | ( | double | scalar | ) | [inline] |
Divides each element by a scalar.
scalar | X, Y, and Z values will be divided by this value. |
Definition at line 214 of file vector3D.h.
Assignment operator.
source | The vector to be copied. |
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().
index | This argument is the index into *this. |
Definition at line 190 of file vector3D.h.
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().
index | This argument is the index into *this. |
Definition at line 173 of file vector3D.h.
void dlr::numeric::Vector3D::setValue | ( | double | xCoord, | |
double | yCoord, | |||
double | zCoord, | |||
double | alpha | |||
) | [inline] |
Explicitly sets 3D homogeneous coordinates.
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.
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.
Definition at line 124 of file vector3D.h.
double& dlr::numeric::Vector3D::x | ( | ) | [inline] |
Returns the x component of the vector by reference.
Definition at line 117 of file vector3D.h.
Referenced by dlr::numeric::AmanatidesWoo3D< ARRAY3D >::AmanatidesWoo3D(), dlr::numeric::operator*(), dlr::numeric::Transform3DTo2D::operator*(), dlr::numeric::Transform3D::operator*(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator<<(), dlr::numeric::operator==(), and operator[]().
double dlr::numeric::Vector3D::y | ( | ) | const [inline] |
Returns the y component of the vector by value.
Definition at line 138 of file vector3D.h.
double& dlr::numeric::Vector3D::y | ( | ) | [inline] |
Returns the y component of the vector by reference.
Definition at line 131 of file vector3D.h.
Referenced by dlr::numeric::AmanatidesWoo3D< ARRAY3D >::AmanatidesWoo3D(), dlr::numeric::operator*(), dlr::numeric::Transform3DTo2D::operator*(), dlr::numeric::Transform3D::operator*(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator<<(), dlr::numeric::operator==(), and operator[]().
double dlr::numeric::Vector3D::z | ( | ) | const [inline] |
Returns the z component of the vector by value.
Definition at line 152 of file vector3D.h.
double& dlr::numeric::Vector3D::z | ( | ) | [inline] |
Returns the z component of the vector by reference.
Definition at line 145 of file vector3D.h.
Referenced by dlr::numeric::AmanatidesWoo3D< ARRAY3D >::AmanatidesWoo3D(), dlr::numeric::operator*(), dlr::numeric::Transform3DTo2D::operator*(), dlr::numeric::Transform3D::operator*(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator<<(), dlr::numeric::operator==(), and operator[]().