GLC_Vector2d is a 2 dimensions Vector. More...
#include <glc_vector2d.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_Vector2d () | |
| GLC_Vector2d (const double &dX, const double &dY) | |
| GLC_Vector2d (const GLC_Vector2d &Vect) | |
Operator Overload | |
| GLC_Vector2d | operator+ (const GLC_Vector2d &Vect) const |
| GLC_Vector2d & | operator= (const GLC_Vector2d &Vect) |
| GLC_Vector2d & | operator= (const GLC_Vector2df &Vect) |
| GLC_Vector2d * | operator+= (const GLC_Vector2d &Vect) |
| GLC_Vector2d | operator- (const GLC_Vector2d &Vect) const |
| GLC_Vector2d * | operator-= (const GLC_Vector2d &Vect) |
| double | operator^ (const GLC_Vector2d &Vect) const |
| double | operator* (const GLC_Vector2d &Vect) const |
| GLC_Vector2d | operator* (double Scalaire) const |
| bool | operator== (const GLC_Vector2d &Vect) const |
| bool | operator!= (const GLC_Vector2d &Vect) const |
Set Functions | |
| GLC_Vector2d & | setX (const double &dX) |
| GLC_Vector2d & | setY (const double &dY) |
| GLC_Vector2d & | setVect (const double &dX, const double &dY) |
| GLC_Vector2d & | setVect (const GLC_Vector2d &Vect) |
| GLC_Vector2d & | setLength (double) |
| Set vector lenght from the given scalar and return a reference of this vector. | |
| GLC_Vector2d & | normalize () |
| Normalize this vector and return a reference to it. | |
Get Functions | |
| double | getX (void) const |
| double | getY (void) const |
| const double * | return_dVect (void) const |
| bool | isNull (void) const |
| QString | toString () const |
| return the string representation of vector | |
| GLC_Vector2d | perp () const |
| return a vector perpendicular to this | |
Private Attributes | |
| double | m_Vector [2] |
Friends | |
| class | GLC_Vector4d |
| class | GLC_Vector3d |
| GLC_Vector2d | operator- (const GLC_Vector2d &Vect) |
GLC_Vector2d is a 2 dimensions Vector.
GLC_Vector2d is used to represent 2D position and vectors.
Definition at line 46 of file glc_vector2d.h.
| GLC_Vector2d::GLC_Vector2d | ( | ) | [inline] |
Default constructor Value is set to
X = 0.0
Y = 0.0
Definition at line 68 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
| GLC_Vector2d::GLC_Vector2d | ( | const double & | dX, | |
| const double & | dY | |||
| ) | [inline] |
Standard constructor With x, y = 0.0
Definition at line 75 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
| GLC_Vector2d::GLC_Vector2d | ( | const GLC_Vector2d & | Vect | ) | [inline] |
Recopy constructor Sample use
NewVect = new GLC_Vector2d(OldVect);
Definition at line 87 of file glc_vector2d.h.
References m_Vector, and GLC_Vector3d::m_Vector.
| double GLC_Vector2d::getX | ( | void | ) | const [inline] |
X Composante
Definition at line 235 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
Referenced by GLC_RepFlyMover::createRepresentation(), glc::findIntersection(), GLC_RepFlyMover::glDraw(), glc::isIntersected(), glc::isIntersectedRaySegment(), GLC_Viewport::mapToOpenGLScreen(), GLC_TsrMover::move(), and glc::perpVector().
| double GLC_Vector2d::getY | ( | void | ) | const [inline] |
Y Composante
Definition at line 240 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
Referenced by GLC_RepFlyMover::createRepresentation(), glc::findIntersection(), GLC_RepFlyMover::glDraw(), glc::isIntersected(), glc::isIntersectedRaySegment(), GLC_Viewport::mapNormalyzeToOpenGLScreen(), GLC_Viewport::mapToOpenGLScreen(), GLC_TsrMover::move(), and glc::perpVector().
| bool GLC_Vector2d::isNull | ( | void | ) | const [inline] |
Return true if the vector is null
Definition at line 250 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
Referenced by GLC_TsrMover::move().
| GLC_Vector2d& GLC_Vector2d::normalize | ( | ) | [inline] |
Normalize this vector and return a reference to it.
Definition at line 224 of file glc_vector2d.h.
References GLC_Vector3d::setLength().
| bool GLC_Vector2d::operator!= | ( | const GLC_Vector2d & | Vect | ) | const [inline] |
Overload "!=" operator
Definition at line 178 of file glc_vector2d.h.
| GLC_Vector2d GLC_Vector2d::operator* | ( | double | Scalaire | ) | const [inline] |
Overload scalar product "*" operator between 1 vector and one scalar
Definition at line 162 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
| double GLC_Vector2d::operator* | ( | const GLC_Vector2d & | Vect | ) | const [inline] |
Overload scalar product "*" operator between 2 vector
Definition at line 156 of file glc_vector2d.h.
References m_Vector, and GLC_Vector3d::m_Vector.
| GLC_Vector2d GLC_Vector2d::operator+ | ( | const GLC_Vector2d & | Vect | ) | const [inline] |
Overload binary "+" operator
Definition at line 100 of file glc_vector2d.h.
References m_Vector, and GLC_Vector3d::m_Vector.
| GLC_Vector2d* GLC_Vector2d::operator+= | ( | const GLC_Vector2d & | Vect | ) | [inline] |
Overload "+=" operator
Definition at line 127 of file glc_vector2d.h.
| GLC_Vector2d GLC_Vector2d::operator- | ( | const GLC_Vector2d & | Vect | ) | const [inline] |
Overload binary "-" operator
Definition at line 135 of file glc_vector2d.h.
References m_Vector, and GLC_Vector3d::m_Vector.
| GLC_Vector2d* GLC_Vector2d::operator-= | ( | const GLC_Vector2d & | Vect | ) | [inline] |
Overload binary "-=" operator
Definition at line 143 of file glc_vector2d.h.
| GLC_Vector2d& GLC_Vector2d::operator= | ( | const GLC_Vector2df & | Vect | ) | [inline] |
Overload "=" operator
Definition at line 117 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector, and GLC_Vector2df::vector.
| GLC_Vector2d& GLC_Vector2d::operator= | ( | const GLC_Vector2d & | Vect | ) | [inline] |
Overload "=" operator
Definition at line 108 of file glc_vector2d.h.
References m_Vector, and GLC_Vector3d::m_Vector.
| bool GLC_Vector2d::operator== | ( | const GLC_Vector2d & | Vect | ) | const [inline] |
Overload equality "==" operator
Definition at line 169 of file glc_vector2d.h.
References m_Vector, and GLC_Vector3d::m_Vector.
| double GLC_Vector2d::operator^ | ( | const GLC_Vector2d & | Vect | ) | const [inline] |
Overload dot product "^" operator
Definition at line 150 of file glc_vector2d.h.
References m_Vector, and GLC_Vector3d::m_Vector.
| GLC_Vector2d GLC_Vector2d::perp | ( | ) | const [inline] |
return a vector perpendicular to this
Definition at line 260 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
| const double* GLC_Vector2d::return_dVect | ( | void | ) | const [inline] |
retourne un pointeur constant vers le tableau du vecteur.
Definition at line 245 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
| GLC_Vector2d & GLC_Vector2d::setLength | ( | double | norme | ) | [inline] |
Set vector lenght from the given scalar and return a reference of this vector.
Definition at line 281 of file glc_vector2d.h.
References m_Vector.
| GLC_Vector2d& GLC_Vector2d::setVect | ( | const GLC_Vector2d & | Vect | ) | [inline] |
From another Vector
Definition at line 213 of file glc_vector2d.h.
References m_Vector, and GLC_Vector3d::m_Vector.
| GLC_Vector2d& GLC_Vector2d::setVect | ( | const double & | dX, | |
| const double & | dY | |||
| ) | [inline] |
All Composante
Definition at line 205 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
Referenced by GLC_Vector3d::toVector2d().
| GLC_Vector2d& GLC_Vector2d::setX | ( | const double & | dX | ) | [inline] |
X Composante
Definition at line 191 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
Referenced by GLC_Vector3d::toVector2d().
| GLC_Vector2d& GLC_Vector2d::setY | ( | const double & | dY | ) | [inline] |
Y Composante
Definition at line 198 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
Referenced by GLC_Viewport::mapNormalyzeToOpenGLScreen(), and GLC_Vector3d::toVector2d().
| QString GLC_Vector2d::toString | ( | ) | const [inline] |
return the string representation of vector
Definition at line 255 of file glc_vector2d.h.
References GLC_Vector3d::m_Vector.
friend class GLC_Vector3d [friend] |
Definition at line 49 of file glc_vector2d.h.
friend class GLC_Vector4d [friend] |
Definition at line 48 of file glc_vector2d.h.
| GLC_Vector2d operator- | ( | const GLC_Vector2d & | Vect | ) | [friend] |
Overload unary "-" operator
Definition at line 52 of file glc_vector2d.h.
double GLC_Vector2d::m_Vector[2] [private] |
Vector array definition
vector[0] X
vector[1] Y
Definition at line 274 of file glc_vector2d.h.
Referenced by GLC_Vector2d(), GLC_Vector4d::GLC_Vector4d(), operator*(), operator+(), operator-(), GLC_Vector4d::operator=(), operator=(), operator==(), operator^(), setLength(), and setVect().