GLC_Vector3d Class Reference

GLC_Vector3d is a 3 dimensions Vector. More...

#include <glc_vector3d.h>

List of all members.

Public Member Functions

Constructor / Destructor

 GLC_Vector3d ()
 Default constructor.
 GLC_Vector3d (double x, double y, double z)
 Standard constructor with coordinate: (x, y, z).
 GLC_Vector3d (const GLC_Vector3d &vector)
 Construct a 3d vector from another 3d vector.
 GLC_Vector3d (const GLC_Vector3df &vector)
 Construct a 3d vector from another 3d float vector.
 GLC_Vector3d (const GLC_Vector2d &vector)
 Construct a 3d vector from a 2d float vector.
Get Functions

double x () const
 Return the x coordinate of this vector.
double y () const
 Return the y coordinate of this vector.
double z () const
 Return the z coordinate of this vector.
const double * data () const
 Return a const pointer to this vector data.
bool isNull () const
 Return true if this vector is null.
double length () const
 Return the length of this vector.
GLC_Vector2d toVector2d (const GLC_Vector3d &mask) const
 Return the 2D vector specified by the given mask vector.
double angleWithVect (GLC_Vector3d Vect) const
 Return the Angle from this vector to the given vector (from 0 to PI).
double signedAngleWithVect (GLC_Vector3d Vect, const GLC_Vector3d &dir) const
 Return the signed angle from this vector to th given vector with the given direction (from 0 to -PI and 0 to PI).
GLC_Vector3df toVector3df () const
 Return the float 3D vector from this vector.
QString toString () const
 Return the string of this vector.
GLC_Vector3d inverted () const
 Return the inverted vector of this vector.
Operator Overload

GLC_Vector3d operator+ (const GLC_Vector3d &vector) const
 Return the Addition of this vector to the given vector.
GLC_Vector3doperator= (const GLC_Vector3d &vector)
 Copy the given vector to this vector and return a reference to this vector.
GLC_Vector3doperator= (const GLC_Vector3df &)
 Copy the given float vector to this vector and return a reference to this vector.
GLC_Vector3doperator+= (const GLC_Vector3d &vector)
 Add this vector to the given vector and return a reference to this vector.
GLC_Vector3d operator- (const GLC_Vector3d &Vect) const
 Return the substracts of the given vector to this vector.
GLC_Vector3doperator-= (const GLC_Vector3d &Vect)
 Substracts the given vector to this vector and return a reference to this vector.
GLC_Vector3d operator^ (const GLC_Vector3d &vector) const
 Return the cross product of this vector to the given vector.
double operator* (const GLC_Vector3d &Vect) const
 Return the scalar product of this vector to the given vector.
GLC_Vector3d operator* (double Scalaire) const
 Return the scalar product of this vector to the given scalar.
bool operator== (const GLC_Vector3d &vector) const
 Return true if this vector is fuzzyequal to the given vector.
bool operator> (const GLC_Vector3d &vector) const
 Return true if this vector is > to the given vector.
bool operator< (const GLC_Vector3d &vector) const
 Return true if this vector is < to the given vector.
bool operator!= (const GLC_Vector3d &Vect) const
 Return false if this vector is fuzzyequal to the given vector.
Set Functions

GLC_Vector3dsetX (const double &dX)
 Set x coordinate of this vector from the given x coordinate.
GLC_Vector3dsetY (const double &dY)
 Set y coordinate of this vector from the given y coordinate.
GLC_Vector3dsetZ (const double &dZ)
 Set z coordinate of this vector from the given z coordinate.
GLC_Vector3dsetVect (double, double, double)
 Set (x, y, z) coordinate of this vector from the given (x, y, z) coordinates.
GLC_Vector3dsetVect (const GLC_Vector3d &vector)
 Set (x, y, z) coordinate of this vector from the given vector coordinates.
GLC_Vector3dsetLength (double)
 Set vector lenght from the given scalar and return a reference of this vector.
GLC_Vector3dnormalize ()
 Normalize this vector and return a reference to it.
GLC_Vector3dinvert ()
 Invert this vector and return a reference to it.

Private Attributes

double m_Vector [3]

Friends

class GLC_Vector4d
class GLC_Matrix4x4
GLC_Vector3d operator- (const GLC_Vector3d &Vect)
 Overload unary "-" operator.
GLC_Vector3d operator* (double s, const GLC_Vector3d &v)
 Overload scalar operator.

Detailed Description

GLC_Vector3d is a 3 dimensions Vector.

GLC_Vector3d is used to represent 3D vectors in 3D space coordinate.

Definition at line 43 of file glc_vector3d.h.


Constructor & Destructor Documentation

GLC_Vector3d::GLC_Vector3d (  )  [inline]

Default constructor.

Value is set to
X = 0.0
Y = 0.0
Z = 0.0

Definition at line 314 of file glc_vector3d.h.

References m_Vector.

Referenced by GLC_Matrix4x4::scalingX(), GLC_Matrix4x4::scalingY(), and GLC_Matrix4x4::scalingZ().

GLC_Vector3d::GLC_Vector3d ( double  x,
double  y,
double  z 
) [inline]

Standard constructor with coordinate: (x, y, z).

Definition at line 321 of file glc_vector3d.h.

References m_Vector.

GLC_Vector3d::GLC_Vector3d ( const GLC_Vector3d vector  )  [inline]

Construct a 3d vector from another 3d vector.

Definition at line 73 of file glc_vector3d.h.

References m_Vector.

GLC_Vector3d::GLC_Vector3d ( const GLC_Vector3df vector  )  [inline]

Construct a 3d vector from another 3d float vector.

Definition at line 328 of file glc_vector3d.h.

References GLC_Vector3df::m_Vector, and m_Vector.

GLC_Vector3d::GLC_Vector3d ( const GLC_Vector2d vector  )  [inline]

Construct a 3d vector from a 2d float vector.

Definition at line 335 of file glc_vector3d.h.

References GLC_Vector2d::getX(), GLC_Vector2d::getY(), and m_Vector.


Member Function Documentation

double GLC_Vector3d::angleWithVect ( GLC_Vector3d  Vect  )  const [inline]

Return the Angle from this vector to the given vector (from 0 to PI).

Definition at line 432 of file glc_vector3d.h.

References isNull(), and normalize().

Referenced by glc::polygonIsConvex().

const double* GLC_Vector3d::data (  )  const [inline]

Return a const pointer to this vector data.

Definition at line 102 of file glc_vector3d.h.

GLC_Vector3d & GLC_Vector3d::invert ( void   )  [inline]

Invert this vector and return a reference to it.

Definition at line 410 of file glc_vector3d.h.

References m_Vector.

Referenced by GLC_Camera::setEyeCam(), and GLC_Camera::setTargetCam().

GLC_Vector3d GLC_Vector3d::inverted (  )  const [inline]

Return the inverted vector of this vector.

Definition at line 131 of file glc_vector3d.h.

References GLC_Matrix4x4::GLC_Vector3d.

Referenced by glc::pointsAreCollinear(), and signedAngleWithVect().

bool GLC_Vector3d::isNull ( void   )  const [inline]
double GLC_Vector3d::length ( void   )  const [inline]
GLC_Vector3d& GLC_Vector3d::normalize (  )  [inline]
bool GLC_Vector3d::operator!= ( const GLC_Vector3d Vect  )  const [inline]

Return false if this vector is fuzzyequal to the given vector.

Definition at line 195 of file glc_vector3d.h.

GLC_Vector3d GLC_Vector3d::operator* ( double  Scalaire  )  const [inline]

Return the scalar product of this vector to the given scalar.

Definition at line 181 of file glc_vector3d.h.

References GLC_Matrix4x4::GLC_Vector3d.

double GLC_Vector3d::operator* ( const GLC_Vector3d Vect  )  const [inline]

Return the scalar product of this vector to the given vector.

Definition at line 177 of file glc_vector3d.h.

References m_Vector.

GLC_Vector3d GLC_Vector3d::operator+ ( const GLC_Vector3d vector  )  const [inline]

Return the Addition of this vector to the given vector.

Definition at line 142 of file glc_vector3d.h.

References GLC_Matrix4x4::GLC_Vector3d, and m_Vector.

GLC_Vector3d& GLC_Vector3d::operator+= ( const GLC_Vector3d vector  )  [inline]

Add this vector to the given vector and return a reference to this vector.

Definition at line 156 of file glc_vector3d.h.

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

Return the substracts of the given vector to this vector.

Definition at line 163 of file glc_vector3d.h.

References GLC_Matrix4x4::GLC_Vector3d, and m_Vector.

GLC_Vector3d& GLC_Vector3d::operator-= ( const GLC_Vector3d Vect  )  [inline]

Substracts the given vector to this vector and return a reference to this vector.

Definition at line 167 of file glc_vector3d.h.

bool GLC_Vector3d::operator< ( const GLC_Vector3d vector  )  const [inline]

Return true if this vector is < to the given vector.

Definition at line 378 of file glc_vector3d.h.

References m_Vector.

GLC_Vector3d & GLC_Vector3d::operator= ( const GLC_Vector3df Vect  )  [inline]

Copy the given float vector to this vector and return a reference to this vector.

Definition at line 342 of file glc_vector3d.h.

References GLC_Vector3df::m_Vector, and m_Vector.

GLC_Vector3d& GLC_Vector3d::operator= ( const GLC_Vector3d vector  )  [inline]

Copy the given vector to this vector and return a reference to this vector.

Definition at line 146 of file glc_vector3d.h.

References m_Vector.

bool GLC_Vector3d::operator== ( const GLC_Vector3d vector  )  const [inline]

Return true if this vector is fuzzyequal to the given vector.

Definition at line 361 of file glc_vector3d.h.

References m_Vector.

bool GLC_Vector3d::operator> ( const GLC_Vector3d vector  )  const [inline]

Return true if this vector is > to the given vector.

Definition at line 370 of file glc_vector3d.h.

References m_Vector.

GLC_Vector3d GLC_Vector3d::operator^ ( const GLC_Vector3d vector  )  const [inline]

Return the cross product of this vector to the given vector.

Definition at line 351 of file glc_vector3d.h.

References m_Vector.

GLC_Vector3d & GLC_Vector3d::setLength ( double  norme  )  [inline]

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

Definition at line 395 of file glc_vector3d.h.

References m_Vector.

Referenced by GLC_TrackBallMover::mapForTracking(), GLC_Vector2d::normalize(), GLC_Camera::setCam(), GLC_Camera::setDistEyeTarget(), GLC_Camera::setDistTargetEye(), GLC_Camera::setEyeCam(), GLC_Camera::setTargetCam(), and GLC_Camera::zoom().

GLC_Vector3d& GLC_Vector3d::setVect ( const GLC_Vector3d vector  )  [inline]

Set (x, y, z) coordinate of this vector from the given vector coordinates.

Definition at line 230 of file glc_vector3d.h.

References m_Vector.

GLC_Vector3d & GLC_Vector3d::setVect ( double  x,
double  y,
double  z 
) [inline]
GLC_Vector3d& GLC_Vector3d::setX ( const double &  dX  )  [inline]

Set x coordinate of this vector from the given x coordinate.

Definition at line 206 of file glc_vector3d.h.

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

Set y coordinate of this vector from the given y coordinate.

Definition at line 213 of file glc_vector3d.h.

Referenced by GLC_ZoomMover::init(), and GLC_ZoomMover::move().

GLC_Vector3d& GLC_Vector3d::setZ ( const double &  dZ  )  [inline]

Set z coordinate of this vector from the given z coordinate.

Definition at line 220 of file glc_vector3d.h.

Referenced by GLC_FlyMover::mapForFlying(), and GLC_TrackBallMover::mapForTracking().

double GLC_Vector3d::signedAngleWithVect ( GLC_Vector3d  Vect,
const GLC_Vector3d dir 
) const [inline]

Return the signed angle from this vector to th given vector with the given direction (from 0 to -PI and 0 to PI).

Definition at line 447 of file glc_vector3d.h.

References getDeterminant3x3(), inverted(), isNull(), m_Vector, normalize(), and glc::PI.

QString GLC_Vector3d::toString (  )  const [inline]

Return the string of this vector.

Definition at line 489 of file glc_vector3d.h.

References m_Vector.

GLC_Vector2d GLC_Vector3d::toVector2d ( const GLC_Vector3d mask  )  const [inline]

Return the 2D vector specified by the given mask vector.

retrieve component corresponding to mask vector NULL component

Definition at line 418 of file glc_vector3d.h.

References m_Vector, GLC_Vector2d::setVect(), GLC_Vector2d::setX(), and GLC_Vector2d::setY().

GLC_Vector3df GLC_Vector3d::toVector3df (  )  const [inline]

Return the float 3D vector from this vector.

Definition at line 124 of file glc_vector3d.h.

Referenced by GLC_OffToWorld::computeNormal(), GLC_ObjToWorld::computeNormal(), and GLC_ColladaToWorld::computeNormalOfCurrentPrimitiveOfCurrentMesh().

double GLC_Vector3d::x (  )  const [inline]
double GLC_Vector3d::y (  )  const [inline]
double GLC_Vector3d::z (  )  const [inline]

Friends And Related Function Documentation

friend class GLC_Matrix4x4 [friend]

Definition at line 46 of file glc_vector3d.h.

Referenced by GLC_Matrix4x4::inverted().

friend class GLC_Vector4d [friend]

Definition at line 45 of file glc_vector3d.h.

GLC_Vector3d operator* ( double  s,
const GLC_Vector3d v 
) [friend]

Overload scalar operator.

Definition at line 53 of file glc_vector3d.h.

GLC_Vector3d operator- ( const GLC_Vector3d Vect  )  [friend]

Overload unary "-" operator.

Definition at line 49 of file glc_vector3d.h.


Member Data Documentation

double GLC_Vector3d::m_Vector[3] [private]

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

SourceForge.net Logo

©2005-2011 Laurent Ribon