GLC_Vector4d is a 4 dimensions Vector. More...
#include <glc_vector4d.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_Vector4d () | |
| GLC_Vector4d (const double &dX, const double &dY, const double &dZ, const double &dW=1.0) | |
| Standard constructor With x, y, z and w with default value of 1.0. | |
| GLC_Vector4d (const GLC_Vector4d &Vect) | |
| Copy constructor. | |
| GLC_Vector4d (const GLC_Vector3d &Vect) | |
| Copy from an GLC_Vector3d. | |
| GLC_Vector4d (const GLC_Vector3df &Vect) | |
| Copy from an GLC_Vector3d. | |
| GLC_Vector4d (const GLC_Vector2d &Vect) | |
| Copy from an GLC_Vector3d. | |
Operator Overload | |
| GLC_Vector4d | operator+ (const GLC_Vector4d &Vect) const |
| Overload binary "+" operator. | |
| GLC_Vector4d & | operator= (const GLC_Vector4d &Vect) |
| Overload "=" operator. | |
| GLC_Vector4d & | operator= (const GLC_Vector3d &Vect) |
| Overload "=" operator. | |
| GLC_Vector4d & | operator= (const GLC_Vector3df &Vect) |
| Overload "=" operator. | |
| GLC_Vector4d & | operator= (const GLC_Vector2d &Vect) |
| Overload "=" operator. | |
| GLC_Vector4d * | operator+= (const GLC_Vector4d &Vect) |
| Overload "+=" operator. | |
| GLC_Vector4d | operator- (const GLC_Vector4d &Vect) const |
| Overload binary "-" operator. | |
| GLC_Vector4d * | operator-= (const GLC_Vector4d &Vect) |
| Overload binary "-=" operator. | |
| GLC_Vector4d | operator^ (const GLC_Vector4d &Vect) const |
| Overload dot product "^" operator. | |
| double | operator* (const GLC_Vector4d &Vect) const |
| Overload scalar product "*" operator between 2 vector. | |
| GLC_Vector4d | operator* (double Scalaire) const |
| Overload scalar product "*" operator between 1 vector and one scalar. | |
| bool | operator== (const GLC_Vector4d &Vect) const |
| Overload equality "==" operator. | |
| bool | operator!= (const GLC_Vector4d &Vect) const |
| Overload dot product "!=" operator. | |
Set Functions | |
| GLC_Vector4d & | setX (const double &dX) |
| X Compound. | |
| GLC_Vector4d & | setY (const double &dY) |
| Y Compound. | |
| GLC_Vector4d & | setZ (const double &dZ) |
| Z Compound. | |
| GLC_Vector4d & | setW (const double &dW) |
| W Compound. | |
| GLC_Vector4d & | setVect (const double &dX, const double &dY, const double &dZ, const double &dW=1) |
| All Compound. | |
| GLC_Vector4d & | setVect (const GLC_Vector4d &Vect) |
| From another Vector. | |
| GLC_Vector4d & | setNormal (const double &Norme) |
| Vector Normal. | |
| GLC_Vector4d & | invert (void) |
Get Functions | |
| double | X (void) const |
| Return X Compound. | |
| double | Y (void) const |
| Return Y Compound. | |
| double | Z (void) const |
| Return Z Compound. | |
| double | W (void) const |
| Return W Compound. | |
| GLC_Vector3d | toVector3d () const |
| GLC_Vector3df | toVector3df () const |
| const double * | data (void) const |
| Return a pointer to vector data. | |
| double | norm (void) const |
| Return Vector Norm. | |
| bool | isNull (void) const |
| double | getAngleWithVect (GLC_Vector4d Vect) const |
| Return the Angle with another vector. | |
| QString | toString () const |
| Return the vector string. | |
| GLC_Vector2d | toVector2d (const GLC_Vector4d &) const |
| Return the 2D vector specified by a mask vector. | |
| QVector< float > | toFloat3dQVector () const |
| Return a QVector<float> of 3 values. | |
Private Types | |
| enum | { VECT4DIMENSION = 4 } |
Private Member Functions | |
| void | normalizeW (void) |
| Normalize Vector w <- 1. | |
Private Attributes | |
| double | vector [VECT4DIMENSION] |
Friends | |
| class | GLC_Matrix4x4 |
| GLC_Matrix4x4 class. | |
| GLC_Vector4d | operator- (const GLC_Vector4d &Vect) |
| Overload unary "-" operator. | |
GLC_Vector4d is a 4 dimensions Vector.
GLC_Vector4d is used to represent 3D position and vectors.
it had 4 Dimensions for compatibility purpose with GLC_Matrix4x4
Definition at line 47 of file glc_vector4d.h.
anonymous enum [private] |
Vector array definition
vector[0] X
vector[1] Y
vector[2] Z
vector[3] 1
Definition at line 381 of file glc_vector4d.h.
| GLC_Vector4d::GLC_Vector4d | ( | ) | [inline] |
Default constructor Value is set to
X = 0.0
Y = 0.0
Z = 0.0
W = 1.0
Definition at line 70 of file glc_vector4d.h.
| GLC_Vector4d::GLC_Vector4d | ( | const double & | dX, | |
| const double & | dY, | |||
| const double & | dZ, | |||
| const double & | dW = 1.0 | |||
| ) | [inline] |
Standard constructor With x, y, z and w with default value of 1.0.
Definition at line 79 of file glc_vector4d.h.
| GLC_Vector4d::GLC_Vector4d | ( | const GLC_Vector4d & | Vect | ) | [inline] |
| GLC_Vector4d::GLC_Vector4d | ( | const GLC_Vector3d & | Vect | ) | [inline] |
Copy from an GLC_Vector3d.
Definition at line 93 of file glc_vector4d.h.
References GLC_Vector3d::m_Vector.
| GLC_Vector4d::GLC_Vector4d | ( | const GLC_Vector3df & | Vect | ) | [inline] |
Copy from an GLC_Vector3d.
Definition at line 102 of file glc_vector4d.h.
References GLC_Vector3df::m_Vector.
| GLC_Vector4d::GLC_Vector4d | ( | const GLC_Vector2d & | Vect | ) | [inline] |
Copy from an GLC_Vector3d.
Definition at line 111 of file glc_vector4d.h.
References GLC_Vector2d::m_Vector.
| const double* GLC_Vector4d::data | ( | void | ) | const [inline] |
Return a pointer to vector data.
Definition at line 322 of file glc_vector4d.h.
| double GLC_Vector4d::getAngleWithVect | ( | GLC_Vector4d | Vect | ) | const |
Return the Angle with another vector.
Definition at line 114 of file glc_vector4d.cpp.
References isNull(), and setNormal().
| GLC_Vector4d& GLC_Vector4d::invert | ( | void | ) | [inline] |
Invert Vector
Definition at line 278 of file glc_vector4d.h.
| bool GLC_Vector4d::isNull | ( | void | ) | const [inline] |
| double GLC_Vector4d::norm | ( | void | ) | const [inline] |
Return Vector Norm.
Definition at line 327 of file glc_vector4d.h.
| void GLC_Vector4d::normalizeW | ( | void | ) | [private] |
| bool GLC_Vector4d::operator!= | ( | const GLC_Vector4d & | Vect | ) | const [inline] |
Overload dot product "!=" operator.
Definition at line 225 of file glc_vector4d.h.
| GLC_Vector4d GLC_Vector4d::operator* | ( | double | Scalaire | ) | const [inline] |
Overload scalar product "*" operator between 1 vector and one scalar.
Definition at line 215 of file glc_vector4d.h.
| double GLC_Vector4d::operator* | ( | const GLC_Vector4d & | Vect | ) | const [inline] |
Overload scalar product "*" operator between 2 vector.
Definition at line 207 of file glc_vector4d.h.
References vector.
| GLC_Vector4d GLC_Vector4d::operator+ | ( | const GLC_Vector4d & | Vect | ) | const [inline] |
| GLC_Vector4d* GLC_Vector4d::operator+= | ( | const GLC_Vector4d & | Vect | ) | [inline] |
Overload "+=" operator.
Definition at line 180 of file glc_vector4d.h.
| GLC_Vector4d GLC_Vector4d::operator- | ( | const GLC_Vector4d & | Vect | ) | const [inline] |
| GLC_Vector4d* GLC_Vector4d::operator-= | ( | const GLC_Vector4d & | Vect | ) | [inline] |
Overload binary "-=" operator.
Definition at line 197 of file glc_vector4d.h.
| GLC_Vector4d& GLC_Vector4d::operator= | ( | const GLC_Vector2d & | Vect | ) | [inline] |
Overload "=" operator.
Definition at line 169 of file glc_vector4d.h.
References GLC_Vector2d::m_Vector.
| GLC_Vector4d& GLC_Vector4d::operator= | ( | const GLC_Vector3df & | Vect | ) | [inline] |
Overload "=" operator.
Definition at line 158 of file glc_vector4d.h.
References GLC_Vector3df::m_Vector.
| GLC_Vector4d& GLC_Vector4d::operator= | ( | const GLC_Vector3d & | Vect | ) | [inline] |
Overload "=" operator.
Definition at line 147 of file glc_vector4d.h.
References GLC_Vector3d::m_Vector.
| GLC_Vector4d& GLC_Vector4d::operator= | ( | const GLC_Vector4d & | Vect | ) | [inline] |
| bool GLC_Vector4d::operator== | ( | const GLC_Vector4d & | Vect | ) | const |
| GLC_Vector4d GLC_Vector4d::operator^ | ( | const GLC_Vector4d & | Vect | ) | const |
Overload dot product "^" operator.
Definition at line 35 of file glc_vector4d.cpp.
References vector.
| GLC_Vector4d & GLC_Vector4d::setNormal | ( | const double & | Norme | ) |
Vector Normal.
Definition at line 94 of file glc_vector4d.cpp.
References vector.
Referenced by getAngleWithVect().
| GLC_Vector4d& GLC_Vector4d::setVect | ( | const GLC_Vector4d & | Vect | ) | [inline] |
| GLC_Vector4d & GLC_Vector4d::setVect | ( | const double & | dX, | |
| const double & | dY, | |||
| const double & | dZ, | |||
| const double & | dW = 1 | |||
| ) |
All Compound.
Definition at line 72 of file glc_vector4d.cpp.
References vector.
Referenced by operator>>().
| GLC_Vector4d & GLC_Vector4d::setW | ( | const double & | dW | ) |
| GLC_Vector4d& GLC_Vector4d::setX | ( | const double & | dX | ) | [inline] |
X Compound.
Definition at line 238 of file glc_vector4d.h.
| GLC_Vector4d& GLC_Vector4d::setY | ( | const double & | dY | ) | [inline] |
Y Compound.
Definition at line 245 of file glc_vector4d.h.
| GLC_Vector4d& GLC_Vector4d::setZ | ( | const double & | dZ | ) | [inline] |
Z Compound.
Definition at line 252 of file glc_vector4d.h.
| QVector<float> GLC_Vector4d::toFloat3dQVector | ( | ) | const [inline] |
Return a QVector<float> of 3 values.
Definition at line 355 of file glc_vector4d.h.
| QString GLC_Vector4d::toString | ( | ) | const |
| GLC_Vector2d GLC_Vector4d::toVector2d | ( | const GLC_Vector4d & | mask | ) | const |
Return the 2D vector specified by a mask vector.
retrieve component corresponding to mask NULL component
Definition at line 143 of file glc_vector4d.cpp.
References vector, GLC_Vector3d::x(), and GLC_Vector3d::y().
| GLC_Vector3d GLC_Vector4d::toVector3d | ( | ) | const [inline] |
Definition at line 313 of file glc_vector4d.h.
References GLC_Matrix4x4::GLC_Vector3d.
| GLC_Vector3df GLC_Vector4d::toVector3df | ( | ) | const [inline] |
Definition at line 317 of file glc_vector4d.h.
| double GLC_Vector4d::W | ( | void | ) | const [inline] |
| double GLC_Vector4d::X | ( | void | ) | const [inline] |
| double GLC_Vector4d::Y | ( | void | ) | const [inline] |
| double GLC_Vector4d::Z | ( | void | ) | const [inline] |
friend class GLC_Matrix4x4 [friend] |
GLC_Matrix4x4 class.
Definition at line 50 of file glc_vector4d.h.
| GLC_Vector4d operator- | ( | const GLC_Vector4d & | Vect | ) | [friend] |
Overload unary "-" operator.
Definition at line 53 of file glc_vector4d.h.
double GLC_Vector4d::vector[VECT4DIMENSION] [private] |
Definition at line 382 of file glc_vector4d.h.
Referenced by GLC_Vector4d(), normalizeW(), operator*(), operator+(), operator-(), operator=(), operator==(), operator^(), setNormal(), setVect(), setW(), toString(), and toVector2d().