OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
A 3-dimension vector. More...
#include <Vector3D.h>
Public Member Functions | |
Vector3D () | |
Default constructor. More... | |
Vector3D (double x, double y, double z) | |
Constructor. More... | |
bool | operator== (const Vector3D &) const |
bool | operator!= (const Vector3D &) const |
Vector3D & | operator+= (const Vector3D &vector) |
Add and assign. More... | |
Vector3D & | operator-= (const Vector3D &vector) |
Subtract and assign. More... | |
Vector3D & | operator*= (double factor) |
Scale and assign. More... | |
Vector3D | operator- () const |
Negative vector. More... | |
double & | operator() (int i) |
Get component. More... | |
double | operator() (int i) const |
Get component. More... | |
void | getComponents (double &x, double &y, double &z) const |
Get components. More... | |
double | getX () const |
Get component. More... | |
double | getY () const |
Get component. More... | |
double | getZ () const |
Get component. More... | |
void | clear () |
Set to zero. More... | |
bool | isZero () const |
Test for zero. More... | |
void | setX (double) |
Set component. More... | |
void | setY (double) |
Set component. More... | |
void | setZ (double) |
Set component. More... | |
Protected Attributes | |
double | v [3] |
A 3-dimension vector.
Definition at line 31 of file Vector3D.h.
|
inline |
Default constructor.
Definition at line 132 of file Vector3D.h.
References v.
Referenced by operator-().
Vector3D::Vector3D | ( | double | x, |
double | y, | ||
double | z | ||
) |
void Vector3D::clear | ( | ) |
void Vector3D::getComponents | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | const |
Get components.
Definition at line 98 of file Vector3D.cpp.
References v.
Referenced by Euclid3D::getAll().
|
inline |
Get component.
Definition at line 144 of file Vector3D.h.
References v.
Referenced by Euclid3D::getX().
|
inline |
Get component.
Definition at line 148 of file Vector3D.h.
References v.
Referenced by Euclid3D::getY().
|
inline |
Get component.
Definition at line 152 of file Vector3D.h.
References v.
Referenced by Euclid3D::getZ().
bool Vector3D::isZero | ( | ) | const |
Test for zero.
Definition at line 106 of file Vector3D.cpp.
References v.
Referenced by Euclid3D::isPureXRotation(), Euclid3D::isPureYRotation(), Euclid3D::isPureZRotation(), and Euclid3D::setDisplacement().
bool Vector3D::operator!= | ( | const Vector3D & | rhs | ) | const |
Definition at line 63 of file Vector3D.cpp.
References v.
|
inline |
|
inline |
Vector3D & Vector3D::operator*= | ( | double | factor | ) |
Vector3D Vector3D::operator- | ( | ) | const |
Negative vector.
Definition at line 68 of file Vector3D.cpp.
References v, and Vector3D().
bool Vector3D::operator== | ( | const Vector3D & | rhs | ) | const |
Definition at line 58 of file Vector3D.cpp.
References v.
|
inline |
Set component.
Definition at line 156 of file Vector3D.h.
References v.
Referenced by Euclid3D::setX().
|
inline |
Set component.
Definition at line 160 of file Vector3D.h.
References v.
Referenced by Euclid3D::setY().
|
inline |
Set component.
Definition at line 164 of file Vector3D.h.
References v.
Referenced by Euclid3D::setZ().
|
protected |
Definition at line 103 of file Vector3D.h.
Referenced by clear(), getComponents(), getX(), getY(), getZ(), isZero(), operator!=(), operator()(), operator*=(), operator+=(), operator-(), operator-=(), operator==(), setX(), setY(), setZ(), and Vector3D().