GLC_Vector2d Class Reference

GLC_Vector2d is a 2 dimensions Vector. More...

#include <glc_vector2d.h>

List of all members.

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_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
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)
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 dVecteur [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 48 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 70 of file glc_vector2d.h.

GLC_Vector2d::GLC_Vector2d ( const double &  dX,
const double &  dY 
) [inline]

Standard constructor With x, y = 0.0

Definition at line 77 of file glc_vector2d.h.

GLC_Vector2d::GLC_Vector2d ( const GLC_Vector2d Vect  )  [inline]

Recopy constructor Sample use

 NewVect = new GLC_Vector2d(OldVect);

Definition at line 89 of file glc_vector2d.h.

References dVecteur.


Member Function Documentation

double GLC_Vector2d::getX ( void   )  const [inline]
double GLC_Vector2d::getY ( void   )  const [inline]
bool GLC_Vector2d::isNull ( void   )  const [inline]

Return true if the vector is null

Definition at line 245 of file glc_vector2d.h.

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

Overload "!=" operator

Definition at line 180 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 164 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 158 of file glc_vector2d.h.

References dVecteur.

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

Overload binary "+" operator

Definition at line 102 of file glc_vector2d.h.

References dVecteur.

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

Overload "+=" operator

Definition at line 129 of file glc_vector2d.h.

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

Overload binary "-" operator

Definition at line 137 of file glc_vector2d.h.

References dVecteur.

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

Overload binary "-=" operator

Definition at line 145 of file glc_vector2d.h.

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

Overload "=" operator

Definition at line 119 of file glc_vector2d.h.

References GLC_Vector2df::vector.

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

Overload "=" operator

Definition at line 110 of file glc_vector2d.h.

References dVecteur.

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

Overload equality "==" operator

Definition at line 171 of file glc_vector2d.h.

References dVecteur.

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

Overload dot product "^" operator

Definition at line 152 of file glc_vector2d.h.

References dVecteur.

GLC_Vector2d GLC_Vector2d::perp (  )  const [inline]

return a vector perpendicular to this

Definition at line 255 of file glc_vector2d.h.

const double* GLC_Vector2d::return_dVect ( void   )  const [inline]

retourne un pointeur constant vers le tableau du vecteur.

Definition at line 240 of file glc_vector2d.h.

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

From another Vector

Definition at line 215 of file glc_vector2d.h.

References dVecteur.

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

All Composante

Definition at line 207 of file glc_vector2d.h.

Referenced by GLC_Vector3d::toVector2d().

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

X Composante

Definition at line 193 of file glc_vector2d.h.

Referenced by GLC_Vector3d::toVector2d().

GLC_Vector2d& GLC_Vector2d::setY ( const double &  dY  )  [inline]

Y Composante

Definition at line 200 of file glc_vector2d.h.

Referenced by GLC_Vector3d::toVector2d().

QString GLC_Vector2d::toString (  )  const [inline]

return the string representation of vector

Definition at line 250 of file glc_vector2d.h.


Friends And Related Function Documentation

friend class GLC_Vector3d [friend]

Definition at line 51 of file glc_vector2d.h.

friend class GLC_Vector4d [friend]

Definition at line 50 of file glc_vector2d.h.

GLC_Vector2d operator- ( const GLC_Vector2d Vect  )  [friend]

Overload unary "-" operator

Definition at line 54 of file glc_vector2d.h.


Member Data Documentation

double GLC_Vector2d::dVecteur[2] [private]

Vector array definition
vector[0] X
vector[1] Y

Definition at line 269 of file glc_vector2d.h.

Referenced by GLC_Vector2d(), GLC_Vector4d::GLC_Vector4d(), operator*(), operator+(), operator-(), GLC_Vector4d::operator=(), operator=(), operator==(), operator^(), and setVect().


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

SourceForge.net Logo

©2005 Laurent Ribon