GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Private Attributes | Friends | List of all members
GLC_Vector2d Class Reference

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)
 Copy constructor.
 
QPointF toQPointF () const
 Return the QPointF of this GLC_Vector.
 
Operator Overload
GLC_Vector2d operator+ (const GLC_Vector2d &Vect) const
 
GLC_Vector2doperator= (const GLC_Vector2d &Vect)
 
GLC_Vector2doperator= (const GLC_Vector2df &Vect)
 
GLC_Vector2doperator+= (const GLC_Vector2d &Vect)
 
GLC_Vector2d operator- (const GLC_Vector2d &Vect) const
 
GLC_Vector2doperator-= (const GLC_Vector2d &Vect)
 
double operator^ (const GLC_Vector2d &Vect) const
 
double operator* (const GLC_Vector2d &Vect) const
 
double operator/ (const GLC_Vector2d &Vect) const
 
GLC_Vector2d operator* (double Scalaire) const
 
GLC_Vector2d operator/ (double Scalaire) const
 
bool operator== (const GLC_Vector2d &Vect) const
 
bool operator!= (const GLC_Vector2d &Vect) const
 
Set Functions
GLC_Vector2dsetX (const double &dX)
 
GLC_Vector2dsetY (const double &dY)
 
GLC_Vector2dsetVect (const double &dX, const double &dY)
 
GLC_Vector2dsetVect (const GLC_Vector2d &Vect)
 
GLC_Vector2dsetLength (double)
 Set vector lenght from the given scalar and return a reference of this vector.
 
GLC_Vector2dnormalize ()
 Normalize this vector and return a reference to it.
 
Get Functions
double x (void) const
 
double y (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.
 
double length () const
 Return the length of this vector.
 

Private Attributes

double m_Vector [2]
 

Friends

class GLC_Vector4d
 
class GLC_Vector3d
 
GLC_Vector2d operator- (const GLC_Vector2d &Vect)
 

Detailed Description

GLC_Vector2d is a 2 dimensions Vector.

GLC_Vector2d is used to represent 2D position and vectors.

Definition at line 47 of file glc_vector2d.h.

Constructor & Destructor Documentation

GLC_Vector2d::GLC_Vector2d ( )
inline

Default constructor Value is set to
X = 0.0
Y = 0.0

Definition at line 69 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 76 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

GLC_Vector2d::GLC_Vector2d ( const GLC_Vector2d Vect)
inline

Copy constructor.

Definition at line 83 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector, and m_Vector.

Member Function Documentation

bool GLC_Vector2d::isNull ( void  ) const
inline

Return true if the vector is null

Definition at line 259 of file glc_vector2d.h.

References glc::EPSILON, and GLC_Vector3d::m_Vector.

Referenced by GLC_TsrMover::move().

double GLC_Vector2d::length ( void  ) const
inline

Return the length of this vector.

Definition at line 271 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

GLC_Vector2d& GLC_Vector2d::normalize ( )
inline

Normalize this vector and return a reference to it.

Definition at line 236 of file glc_vector2d.h.

References GLC_Vector3d::setLength().

bool GLC_Vector2d::operator!= ( const GLC_Vector2d Vect) const
inline

Overload "!=" operator

Definition at line 190 of file glc_vector2d.h.

double GLC_Vector2d::operator* ( const GLC_Vector2d Vect) const
inline

Overload scalar product "*" operator between 2 vector

Definition at line 157 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector, and m_Vector.

GLC_Vector2d GLC_Vector2d::operator* ( double  Scalaire) const
inline

Overload scalar product "*" operator between 1 vector and one scalar

Definition at line 169 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

GLC_Vector2d GLC_Vector2d::operator+ ( const GLC_Vector2d Vect) const
inline

Overload binary "+" operator

Definition at line 101 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector, and m_Vector.

GLC_Vector2d* GLC_Vector2d::operator+= ( const GLC_Vector2d Vect)
inline

Overload "+=" operator

Definition at line 128 of file glc_vector2d.h.

GLC_Vector2d GLC_Vector2d::operator- ( const GLC_Vector2d Vect) const
inline

Overload binary "-" operator

Definition at line 136 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector, and m_Vector.

GLC_Vector2d* GLC_Vector2d::operator-= ( const GLC_Vector2d Vect)
inline

Overload binary "-=" operator

Definition at line 144 of file glc_vector2d.h.

double GLC_Vector2d::operator/ ( const GLC_Vector2d Vect) const
inline

Overload scalar division "/" operator between 2 vector

Definition at line 163 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector, and m_Vector.

GLC_Vector2d GLC_Vector2d::operator/ ( double  Scalaire) const
inline

Overload scalar division "/" operator between 1 vector and one scalar

Definition at line 175 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

GLC_Vector2d& GLC_Vector2d::operator= ( const GLC_Vector2d Vect)
inline

Overload "=" operator

Definition at line 109 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector, and m_Vector.

GLC_Vector2d& GLC_Vector2d::operator= ( const GLC_Vector2df Vect)
inline

Overload "=" operator

Definition at line 118 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector, and GLC_Vector2df::vector.

bool GLC_Vector2d::operator== ( const GLC_Vector2d Vect) const
inline

Overload equality "==" operator

Definition at line 181 of file glc_vector2d.h.

References glc::EPSILON, GLC_Vector3d::m_Vector, and m_Vector.

double GLC_Vector2d::operator^ ( const GLC_Vector2d Vect) const
inline

Overload dot product "^" operator

Definition at line 151 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector, and m_Vector.

GLC_Vector2d GLC_Vector2d::perp ( ) const
inline

Return a vector perpendicular to this.

Definition at line 267 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 255 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

GLC_Vector2d & GLC_Vector2d::setLength ( double  lenght)
inline

Set vector lenght from the given scalar and return a reference of this vector.

Definition at line 291 of file glc_vector2d.h.

References m_Vector.

GLC_Vector2d& GLC_Vector2d::setVect ( const double &  dX,
const double &  dY 
)
inline

All Composante

Definition at line 217 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

Referenced by GLC_Vector3d::toVector2d().

GLC_Vector2d& GLC_Vector2d::setVect ( const GLC_Vector2d Vect)
inline

From another Vector

Definition at line 225 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector, and m_Vector.

GLC_Vector2d& GLC_Vector2d::setX ( const double &  dX)
inline

X Composante

Definition at line 203 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

Referenced by glc::normalyzePolygon(), and GLC_Vector3d::toVector2d().

GLC_Vector2d& GLC_Vector2d::setY ( const double &  dY)
inline
QPointF GLC_Vector2d::toQPointF ( ) const
inline

Return the QPointF of this GLC_Vector.

Definition at line 90 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

QString GLC_Vector2d::toString ( ) const
inline

return the string representation of vector

Definition at line 263 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

double GLC_Vector2d::x ( void  ) const
inline
double GLC_Vector2d::y ( void  ) const
inline

Friends And Related Function Documentation

friend class GLC_Vector3d
friend

Definition at line 50 of file glc_vector2d.h.

friend class GLC_Vector4d
friend

Definition at line 49 of file glc_vector2d.h.

GLC_Vector2d operator- ( const GLC_Vector2d Vect)
friend

Overload unary "-" operator

Definition at line 53 of file glc_vector2d.h.

Member Data Documentation

double GLC_Vector2d::m_Vector[2]
private

The documentation for this class was generated from the following file:

©2005-2013 Laurent Ribon