NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Simple 3D Vector implementation that is used in the Surface Extraction and surface smoothing and decimation algorithms. More...
Public Member Functions | |
BasicVec3D () | |
Default constructor. More... | |
BasicVec3D (float x1, float y1, float z1) | |
Constructor with coordinates as parameters. More... | |
BasicVec3D (float av[3]) | |
Constructor with coordinates as parameters in a float array. More... | |
BasicVec3D (const BasicVec3D &v) | |
Constructor with coordinates as parameters in a Vec3D. More... | |
virtual | ~BasicVec3D () |
Destructor that intentionally does nothing. More... | |
BasicVec3D & | operator= (const BasicVec3D &v) |
Assignment operator. More... | |
bool | operator== (const BasicVec3D &v) |
Comparision operator. More... | |
bool | operator!= (const BasicVec3D &v) |
Not equal operator. More... | |
BasicVec3D | operator- () const |
Unary operator that changes the sign of the coordinates. More... | |
void | Normalize () |
Normalize the vector. More... | |
void | SetZero () |
Set all coordinates to zero. More... | |
float | SelfDot () |
Compute and return dot product with self. More... | |
float | Length () |
Compute and return length of the vector. More... | |
float | Distance (const BasicVec3D &v) const |
Compute and return distance from a point. More... | |
float | DistanceSquared (const BasicVec3D &v) const |
Compute and return squared distance from a point. More... | |
float | Distance (const BasicVec3D &v1, const BasicVec3D &v2) |
Compute and return distance of two points. More... | |
float | DistanceSquared (const BasicVec3D &v1, const BasicVec3D &v2) |
Compute and return squared distance of two points. More... | |
void | SetX (float x) |
Sets the X coordinate of the vector. More... | |
float | GetX () const |
Returns the X coordinate of the vector. More... | |
void | SetY (float y) |
Sets the Y coordinate of the vector. More... | |
float | GetY () const |
Returns the Y coordinate of the vector. More... | |
void | SetZ (float z) |
Sets the Z coordinate of the vector. More... | |
float | GetZ () const |
Returns the Z coordinate of the vector. More... | |
BasicVec3D | operator+ (float f) const |
BasicVec3D | operator- (float f) const |
BasicVec3D | operator* (float f) const |
BasicVec3D | operator/ (float f) const |
BasicVec3D & | operator+= (float f) |
BasicVec3D & | operator-= (float f) |
BasicVec3D & | operator*= (float f) |
BasicVec3D & | operator/= (float f) |
BasicVec3D | operator+ (const BasicVec3D &v) const |
BasicVec3D & | operator+= (const BasicVec3D &v) |
BasicVec3D | operator- (const BasicVec3D &v) const |
BasicVec3D & | operator-= (const BasicVec3D &v) |
float | Dot (const BasicVec3D &v) const |
BasicVec3D | Cross (const BasicVec3D &v) const |
BasicVec3D | NormalizedCross (const BasicVec3D &v) const |
float | Dot (const BasicVec3D &v1, const BasicVec3D &v2) |
BasicVec3D | Cross (const BasicVec3D &v1, const BasicVec3D &v2) |
BasicVec3D | NormalizedCross (const BasicVec3D &v1, const BasicVec3D &v2) |
Friends | |
BasicVec3D | operator* (float a, const BasicVec3D &v) |
std::ostream & | operator<< (std::ostream &os, const BasicVec3D &vo) |
Simple 3D Vector implementation that is used in the Surface Extraction and surface smoothing and decimation algorithms.
niftk::BasicVec3D::BasicVec3D | ( | ) |
Default constructor.
niftk::BasicVec3D::BasicVec3D | ( | float | x1, |
float | y1, | ||
float | z1 | ||
) |
Constructor with coordinates as parameters.
niftk::BasicVec3D::BasicVec3D | ( | float | av[3] | ) |
Constructor with coordinates as parameters in a float array.
niftk::BasicVec3D::BasicVec3D | ( | const BasicVec3D & | v | ) |
Constructor with coordinates as parameters in a Vec3D.
|
inlinevirtual |
Destructor that intentionally does nothing.
BasicVec3D niftk::BasicVec3D::Cross | ( | const BasicVec3D & | v | ) | const |
Dot and Cross Products
BasicVec3D niftk::BasicVec3D::Cross | ( | const BasicVec3D & | v1, |
const BasicVec3D & | v2 | ||
) |
Dot and Cross Products
float niftk::BasicVec3D::Distance | ( | const BasicVec3D & | v | ) | const |
Compute and return distance from a point.
float niftk::BasicVec3D::Distance | ( | const BasicVec3D & | v1, |
const BasicVec3D & | v2 | ||
) |
Compute and return distance of two points.
float niftk::BasicVec3D::DistanceSquared | ( | const BasicVec3D & | v | ) | const |
Compute and return squared distance from a point.
float niftk::BasicVec3D::DistanceSquared | ( | const BasicVec3D & | v1, |
const BasicVec3D & | v2 | ||
) |
Compute and return squared distance of two points.
float niftk::BasicVec3D::Dot | ( | const BasicVec3D & | v | ) | const |
Dot and Cross Products
float niftk::BasicVec3D::Dot | ( | const BasicVec3D & | v1, |
const BasicVec3D & | v2 | ||
) |
Dot and Cross Products
|
inline |
Returns the X coordinate of the vector.
|
inline |
Returns the Y coordinate of the vector.
|
inline |
Returns the Z coordinate of the vector.
float niftk::BasicVec3D::Length | ( | ) |
Compute and return length of the vector.
void niftk::BasicVec3D::Normalize | ( | ) |
Normalize the vector.
BasicVec3D niftk::BasicVec3D::NormalizedCross | ( | const BasicVec3D & | v | ) | const |
Dot and Cross Products
BasicVec3D niftk::BasicVec3D::NormalizedCross | ( | const BasicVec3D & | v1, |
const BasicVec3D & | v2 | ||
) |
Dot and Cross Products
bool niftk::BasicVec3D::operator!= | ( | const BasicVec3D & | v | ) |
Not equal operator.
BasicVec3D niftk::BasicVec3D::operator* | ( | float | f | ) | const |
Scalar operations
BasicVec3D & niftk::BasicVec3D::operator*= | ( | float | f | ) |
Scalar operations
BasicVec3D niftk::BasicVec3D::operator+ | ( | float | f | ) | const |
Scalar operations
BasicVec3D niftk::BasicVec3D::operator+ | ( | const BasicVec3D & | v | ) | const |
Vector operations
BasicVec3D & niftk::BasicVec3D::operator+= | ( | float | f | ) |
Scalar operations
BasicVec3D & niftk::BasicVec3D::operator+= | ( | const BasicVec3D & | v | ) |
Vector operations
BasicVec3D niftk::BasicVec3D::operator- | ( | float | f | ) | const |
Scalar operations
BasicVec3D niftk::BasicVec3D::operator- | ( | const BasicVec3D & | v | ) | const |
Vector operations
BasicVec3D niftk::BasicVec3D::operator- | ( | ) | const |
Unary operator that changes the sign of the coordinates.
BasicVec3D & niftk::BasicVec3D::operator-= | ( | float | f | ) |
Scalar operations
BasicVec3D & niftk::BasicVec3D::operator-= | ( | const BasicVec3D & | v | ) |
Vector operations
BasicVec3D niftk::BasicVec3D::operator/ | ( | float | f | ) | const |
Scalar operations
BasicVec3D & niftk::BasicVec3D::operator/= | ( | float | f | ) |
Scalar operations
BasicVec3D & niftk::BasicVec3D::operator= | ( | const BasicVec3D & | v | ) |
Assignment operator.
bool niftk::BasicVec3D::operator== | ( | const BasicVec3D & | v | ) |
Comparision operator.
float niftk::BasicVec3D::SelfDot | ( | ) |
Compute and return dot product with self.
|
inline |
Sets the X coordinate of the vector.
|
inline |
Sets the Y coordinate of the vector.
|
inline |
Sets the Z coordinate of the vector.
void niftk::BasicVec3D::SetZero | ( | ) |
Set all coordinates to zero.
|
friend |
Other operations
|
friend |
Other operations