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)
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
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 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)

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.

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 77 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 89 of file glc_vector2d.h.

References m_Vector, and GLC_Vector3d::m_Vector.


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 257 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 231 of file glc_vector2d.h.

References GLC_Vector3d::setLength().

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

Overload "!=" operator

Definition at line 185 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 169 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 163 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 107 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 134 of file glc_vector2d.h.

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

Overload binary "-" operator

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

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

Overload "=" operator

Definition at line 124 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 115 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 176 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 157 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 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 252 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 288 of file glc_vector2d.h.

References m_Vector.

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

From another Vector

Definition at line 220 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 212 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 198 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 205 of file glc_vector2d.h.

References GLC_Vector3d::m_Vector.

Referenced by GLC_Viewport::mapNormalyzeToOpenGLScreen(), and GLC_Vector3d::toVector2d().

QPointF GLC_Vector2d::toQPointF (  )  const [inline]

Return the QPointF of this GLC_Vector.

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

References GLC_Vector3d::m_Vector.


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::m_Vector[2] [private]

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

Definition at line 281 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().


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

SourceForge.net Logo

©2005-2011 Laurent Ribon