GLC_Vector3d is a 3 dimensions Vector. More...
#include <glc_vector3d.h>
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. | |
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. | |
| 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_Vector3d & | operator= (const GLC_Vector3d &vector) |
| Copy the given vector to this vector and return a reference to this vector. | |
| GLC_Vector3d & | operator= (const GLC_Vector3df &) |
| Copy the given float vector to this vector and return a reference to this vector. | |
| GLC_Vector3d & | operator+= (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_Vector3d & | operator-= (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_Vector3d & | setX (const double &dX) |
| Set x coordinate of this vector from the given x coordinate. | |
| GLC_Vector3d & | setY (const double &dY) |
| Set y coordinate of this vector from the given y coordinate. | |
| GLC_Vector3d & | setZ (const double &dZ) |
| Set z coordinate of this vector from the given z coordinate. | |
| GLC_Vector3d & | setVect (double, double, double) |
| Set (x, y, z) coordinate of this vector from the given (x, y, z) coordinates. | |
| GLC_Vector3d & | setVect (const GLC_Vector3d &vector) |
| Set (x, y, z) coordinate of this vector from the given vector coordinates. | |
| GLC_Vector3d & | setLength (double) |
| Set vector lenght from the given scalar and return a reference of this vector. | |
| GLC_Vector3d & | normalize () |
| Normalize this vector and return a reference to it. | |
| GLC_Vector3d & | invert () |
| 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. | |
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.
| GLC_Vector3d::GLC_Vector3d | ( | ) | [inline] |
Default constructor.
Value is set to
X = 0.0
Y = 0.0
Z = 0.0
Definition at line 296 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 303 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 310 of file glc_vector3d.h.
References GLC_Vector3df::m_Vector, and m_Vector.
| double GLC_Vector3d::angleWithVect | ( | GLC_Vector3d | Vect | ) | const [inline] |
Return the Angle from this vector to the given vector.
Definition at line 407 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 99 of file glc_vector3d.h.
Referenced by GLC_Point::glDraw(), and GLC_Line::glDraw().
| GLC_Vector3d & GLC_Vector3d::invert | ( | void | ) | [inline] |
Invert this vector and return a reference to it.
Definition at line 385 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 125 of file glc_vector3d.h.
References GLC_Matrix4x4::GLC_Vector3d.
| bool GLC_Vector3d::isNull | ( | void | ) | const [inline] |
Return true if this vector is null.
Definition at line 103 of file glc_vector3d.h.
Referenced by angleWithVect(), GLC_Interpolator::CalcInterpolLineaireMat(), GLC_TurnTableMover::move(), GLC_Camera::orbit(), GLC_Matrix4x4::setMatRot(), and glc::triangulatePolygon().
| double GLC_Vector3d::length | ( | void | ) | const [inline] |
Return the length of this vector.
Definition at line 107 of file glc_vector3d.h.
Referenced by GLC_Camera::isAlmostEqualTo(), GLC_FlyMover::mapForFlying(), GLC_TrackBallMover::mapForTracking(), and GLC_Camera::zoom().
| GLC_Vector3d& GLC_Vector3d::normalize | ( | ) | [inline] |
Normalize this vector and return a reference to it.
Definition at line 234 of file glc_vector3d.h.
Referenced by angleWithVect(), GLC_OffToWorld::computeNormal(), GLC_ObjToWorld::computeNormal(), GLC_ColladaToWorld::computeNormalOfCurrentPrimitiveOfCurrentMesh(), GLC_AbstractManipulator::enterManipulateState(), GLC_AbstractManipulator::manipulate(), GLC_FlyMover::mapForFlying(), glc::project(), GLC_Matrix4x4::setMatRot(), GLC_Arrow::setViewDir(), and glc::triangulatePolygon().
| bool GLC_Vector3d::operator!= | ( | const GLC_Vector3d & | Vect | ) | const [inline] |
Return false if this vector is fuzzyequal to the given vector.
Definition at line 189 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 175 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 171 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 136 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 150 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 157 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 161 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 353 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 317 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 140 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 336 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 345 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 326 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 370 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 224 of file glc_vector3d.h.
References m_Vector.
| GLC_Vector3d & GLC_Vector3d::setVect | ( | double | x, | |
| double | y, | |||
| double | z | |||
| ) | [inline] |
Set (x, y, z) coordinate of this vector from the given (x, y, z) coordinates.
Definition at line 361 of file glc_vector3d.h.
References m_Vector.
Referenced by GLC_OctreeNode::addChildren(), GLC_BoundingBox::combine(), GLC_Camera::frontView(), GLC_Vector3df::GLC_Vector3df(), GLC_TurnTableMover::init(), GLC_TrackBallMover::init(), GLC_Camera::isoView(), GLC_TurnTableMover::move(), operator>>(), glc::polygonIsConvex(), GLC_Point::setCoordinate(), GLC_Light::setPosition(), and GLC_Camera::topView().
| GLC_Vector3d& GLC_Vector3d::setX | ( | const double & | dX | ) | [inline] |
Set x coordinate of this vector from the given x coordinate.
Definition at line 200 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 207 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 214 of file glc_vector3d.h.
Referenced by GLC_FlyMover::mapForFlying(), and GLC_TrackBallMover::mapForTracking().
| QString GLC_Vector3d::toString | ( | ) | const [inline] |
Return the string of this vector.
Definition at line 422 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 393 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 118 of file glc_vector3d.h.
Referenced by GLC_OffToWorld::computeNormal(), GLC_ObjToWorld::computeNormal(), and GLC_ColladaToWorld::computeNormalOfCurrentPrimitiveOfCurrentMesh().
| double GLC_Vector3d::x | ( | ) | const [inline] |
Return the x coordinate of this vector.
Definition at line 87 of file glc_vector3d.h.
Referenced by GLC_OctreeNode::addChildren(), GLC_Point::boundingBox(), GLC_BoundingBox::combine(), GLC_Factory::createBox(), GLC_Camera::createMatComp(), GLC_Cone::createMeshAndWire(), GLC_Arrow::createWire(), GLC_Plane::distanceToPoint(), GLC_Plane::GLC_Plane(), GLC_RepCrossMover::glDraw(), GLC_Light::glDraw(), GLC_Camera::glExecute(), GLC_BoundingBox::intersect(), GLC_Plane::lieOnThisPlane(), GLC_TrackBallMover::mapForTracking(), GLC_TsrMover::move(), operator<<(), operator>>(), GLC_Matrix4x4::setColumn(), GLC_Plane::setPlane(), GLC_Vector4d::toVector2d(), GLC_BoundingBox::transform(), GLC_StructInstance::translate(), and GLC_3DViewInstance::translate().
| double GLC_Vector3d::y | ( | ) | const [inline] |
Return the y coordinate of this vector.
Definition at line 91 of file glc_vector3d.h.
Referenced by GLC_OctreeNode::addChildren(), GLC_Point::boundingBox(), GLC_BoundingBox::combine(), GLC_Factory::createBox(), GLC_Camera::createMatComp(), GLC_Arrow::createWire(), GLC_Plane::distanceToPoint(), GLC_Plane::GLC_Plane(), GLC_RepCrossMover::glDraw(), GLC_Light::glDraw(), GLC_Camera::glExecute(), GLC_BoundingBox::intersect(), GLC_Plane::lieOnThisPlane(), GLC_TrackBallMover::mapForTracking(), GLC_ZoomMover::move(), GLC_TsrMover::move(), operator<<(), operator>>(), GLC_Matrix4x4::setColumn(), GLC_Plane::setPlane(), GLC_Vector4d::toVector2d(), GLC_BoundingBox::transform(), GLC_StructInstance::translate(), and GLC_3DViewInstance::translate().
| double GLC_Vector3d::z | ( | ) | const [inline] |
Return the z coordinate of this vector.
Definition at line 95 of file glc_vector3d.h.
Referenced by GLC_OctreeNode::addChildren(), GLC_Point::boundingBox(), GLC_BoundingBox::combine(), GLC_Factory::createBox(), GLC_Camera::createMatComp(), GLC_Arrow::createWire(), GLC_Plane::distanceToPoint(), GLC_Plane::GLC_Plane(), GLC_RepCrossMover::glDraw(), GLC_Light::glDraw(), GLC_Camera::glExecute(), GLC_BoundingBox::intersect(), GLC_Plane::lieOnThisPlane(), operator<<(), operator>>(), GLC_Matrix4x4::setColumn(), GLC_Plane::setPlane(), GLC_BoundingBox::transform(), GLC_StructInstance::translate(), and GLC_3DViewInstance::translate().
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.
double GLC_Vector3d::m_Vector[3] [private] |
Vector array definition
vector[0] X
vector[1] Y
vector[2] Z
Definition at line 252 of file glc_vector3d.h.
Referenced by GLC_Vector3df::data(), GLC_Vector2d::getX(), GLC_Vector2d::getY(), GLC_Vector2d::GLC_Vector2d(), GLC_Vector3d(), GLC_Vector3df::GLC_Vector3df(), GLC_Vector4d::GLC_Vector4d(), invert(), GLC_Vector3df::isNull(), GLC_Vector2d::isNull(), operator*(), GLC_Vector2d::operator*(), GLC_Matrix4x4::operator*(), operator+(), GLC_Vector2d::operator+(), operator-(), GLC_Vector2d::operator-(), operator<(), GLC_Vector4d::operator=(), operator=(), GLC_Vector2d::operator=(), operator==(), GLC_Vector2d::operator==(), operator>(), operator^(), GLC_Vector2d::operator^(), GLC_Vector2d::perp(), GLC_Vector2d::return_dVect(), GLC_Vector3df::setInv(), setLength(), GLC_Matrix4x4::setMatRot(), GLC_Matrix4x4::setMatTranslate(), GLC_Vector3df::setVect(), setVect(), GLC_Vector2d::setVect(), GLC_Vector3df::setX(), GLC_Vector2d::setX(), GLC_Vector3df::setY(), GLC_Vector2d::setY(), GLC_Vector3df::setZ(), toString(), GLC_Vector2d::toString(), toVector2d(), GLC_Vector3df::x(), GLC_Vector3df::y(), and GLC_Vector3df::z().