OSG::Vector< ValueTypeT, SizeI > Class Template Reference
[BaseObjectslibOSGBase]

#include <OSGVector.h>

Inheritance diagram for OSG::Vector< ValueTypeT, SizeI >:
OSG::Point< ValueTypeT, SizeI > SelectVecStorage

List of all members.

Public Types

typedef Point< ValueTypeT, SizeI > Inherited
 Parent type.
typedef Vector< ValueTypeT, SizeI > Self
typedef ValueTypeT ValueType
 Value type.
typedef TypeTraits< ValueTypeT >
::RealReturnType 
RealReturnType
 Write point to the given stream.
typedef Inherited::PointType PointType
 Own type.
typedef Inherited::VectorType VectorType
 Type of the corresponding vector of the same size and value type.

Public Member Functions

Constructors



 Vector (void)
 Vector (const ValueTypeT *pVals)
 Constructor which takes a const value array.
 Vector (ValueTypeT *pVals)
 Constructor which takes a const value array.
template<class ValueType2T , UInt32 Size2I>
 Vector (const Point< ValueType2T, Size2I > &pnt)
template<class ValueType2T , UInt32 Size2I>
 Vector (const Vector< ValueType2T, Size2I > &vec)
 Vector (const Vector &source)
 Vector (const ValueType rVal1)
 Vector (const ValueType rVal1, const ValueType rVal2)
 Vector (const ValueType rVal1, const ValueType rVal2, const ValueType rVal3)
 Vector (const ValueType rVal1, const ValueType rVal2, const ValueType rVal3, const ValueType rVal4)
Destructor



 ~Vector (void)
Common Math



RealReturnType length (void) const
 Euclidean length of the vector.
RealReturnType squareLength (void) const
 square of the Euclidean length of the vector
void normalize (void)
 Changes vector to be of unit length.
Vector cross (const Vector &vec) const
 Returns the right handed cross-product for a given vector; This function is implemented for size 3 vectors only.
Vector operator% (const Vector &vec) const
 Euclidean length of the vector.
void crossThis (const Vector &vec)
 Calculates the right handed cross-product with a given vector; This function is implemented for size 3 vectors only.
ValueType dot (const Vector &vec) const
 Return the dot (inner) product for a given vector.
ValueType operator* (const Vector &vec) const
 Euclidean length of the vector.
ValueType dot (const PointType &pnt) const
 Euclidean length of the vector.
ValueType operator* (const PointType &pnt) const
 Euclidean length of the vector.
RealReturnType enclosedAngle (const Vector &vec) const
 Returns the angle between this and another vector.
RealReturnType projectTo (const Vector &toVec)
 Euclidean length of the vector.
Conv



PointTypeaddToZero (void)
 Returns the corrosponding point by adding it to zero.
const PointTypeaddToZero (void) const
 Returns the corrosponding point by adding it to zero.
VectorsubZero (void)
 Returns the corrosponding point by adding it to zero.
const VectorsubZero (void) const
 Returns the corrosponding point by adding it to zero.
Math



Vector operator- (const Vector &vec) const
 Component wise binary vector subtraction operator.
Vector operator+ (const Vector &vec) const
 Component wise binary vector addition operator.
Vector operator* (const ValueType val) const
 Component wise binary scalar multiplication.
Vector operator- (void) const
 Nondestructive unary negation, returns new vector.
Assignment



Vectoroperator= (const Vector &source)
Comparison



bool operator< (const Vector &other) const
bool operator== (const Vector &other) const
 Equal operator, using Eps as the tolerance.
bool operator!= (const Vector &other) const
 Not eual operator, using Eps as the tolerance.

Static Public Attributes

static const Vector Null

Related Functions

(Note that these are not member functions.)



Vector Types



typedef OSG::Vector
< OSG::UInt8, 1 > 
Vec1ub
typedef OSG::Vec1ubVec1ubP
typedef OSG::Vector< OSG::Int8, 1 > Vec1b
typedef OSG::Vec1bVec1bP
typedef OSG::Vector
< OSG::UInt16, 1 > 
Vec1us
typedef OSG::Vec1usVec1usP
typedef OSG::Vector
< OSG::Int16, 1 > 
Vec1s
typedef OSG::Vec1sVec1sP
typedef OSG::Vector
< OSG::Real32, 1 > 
Vec1f
typedef OSG::Vec1fVec1fP
typedef OSG::Vector< Fixed32, 1 > Vec1fx
typedef OSG::Vec1fxVec1fxP
typedef OSG::Vector
< OSG::Real64, 1 > 
Vec1d
typedef OSG::Vec1dVec1dP
typedef OSG::Vector
< OSG::Real128, 1 > 
Vec1ld
typedef OSG::Vec1ldVec1ldP
typedef OSG::Vector
< OSG::UInt8, 2 > 
Vec2ub
typedef OSG::Vec2ubVec2ubP
typedef OSG::Vector< OSG::Int8, 2 > Vec2b
typedef OSG::Vec2bVec2bP
typedef OSG::Vector
< OSG::UInt16, 2 > 
Vec2us
typedef OSG::Vec2usVec2usP
typedef OSG::Vector
< OSG::Int16, 2 > 
Vec2s
typedef OSG::Vec2sVec2sP
typedef OSG::Vector
< OSG::Int32, 2 > 
Vec2i
typedef OSG::Vec2iVec2iP
typedef OSG::Vector
< OSG::UInt32, 2 > 
Vec2u
typedef OSG::Vec2uVec2uP
typedef OSG::Vector
< OSG::Real32, 2 > 
Vec2f
typedef OSG::Vec2fVec2fP
typedef OSG::Vector< Fixed32, 2 > Vec2fx
typedef OSG::Vec2fVec2fP
typedef OSG::Vector
< OSG::Real64, 2 > 
Vec2d
typedef OSG::Vec2dVec2dP
typedef OSG::Vector
< OSG::Real128, 2 > 
Vec2ld
typedef OSG::Vec2ldVec2ldP
typedef OSG::Vector
< OSG::UInt8, 3 > 
Vec3ub
typedef OSG::Vec3ubVec3ubP
typedef OSG::Vector< OSG::Int8, 3 > Vec3b
typedef OSG::Vec3bVec3bP
typedef OSG::Vector
< OSG::UInt16, 3 > 
Vec3us
typedef OSG::Vec3usVec3usP
typedef OSG::Vector
< OSG::Int16, 3 > 
Vec3s
typedef OSG::Vec3sVec3sP
typedef OSG::Vector
< OSG::Real32, 3 > 
Vec3f
typedef OSG::Vec3fVec3fP
typedef OSG::Vector< Fixed32, 3 > Vec3fx
typedef OSG::Vec3fxVec3fxP
typedef OSG::Vector
< OSG::Real64, 3 > 
Vec3d
typedef OSG::Vec3dVec3dP
typedef OSG::Vector
< OSG::Real128, 3 > 
Vec3ld
typedef OSG::Vec3ldVec3ldP
typedef OSG::Vector
< OSG::UInt8, 4 > 
Vec4ub
typedef OSG::Vec4ubVec4ubP
typedef OSG::Vector< OSG::Int8, 4 > Vec4b
typedef OSG::Vec4bVec4bP
typedef OSG::Vector
< OSG::UInt16, 4 > 
Vec4us
typedef OSG::Vec4usVec4usP
typedef OSG::Vector
< OSG::Int16, 4 > 
Vec4s
typedef OSG::Vec4sVec4sP
typedef OSG::Vector
< OSG::Real32, 4 > 
Vec4f
typedef OSG::Vec4fVec4fP
typedef OSG::Vector< Fixed32, 4 > Vec4fx
typedef OSG::Vec4fxVec4fxP
typedef OSG::Vector
< OSG::Real64, 4 > 
Vec4d
typedef OSG::Vec4dVec4dP
typedef OSG::Vector
< OSG::Real128, 4 > 
Vec4ld
typedef OSG::Vec4ldVec4ldP
Vector/Point Profile Types



typedef OSG::Vec2f Vec2r
typedef OSG::Vec3f Vec3r
typedef OSG::Vec4f Vec4r

Detailed Description

template<class ValueTypeT, UInt32 SizeI>
class OSG::Vector< ValueTypeT, SizeI >

Vector Interface, for details about how vectors, points and matrices are actually build see .

Definition at line 583 of file OSGVector.h.


Member Typedef Documentation

template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::Inherited
template<class ValueTypeT, UInt32 SizeI>
typedef Vector<ValueTypeT, SizeI> OSG::Vector< ValueTypeT, SizeI >::Self

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 590 of file OSGVector.h.

template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::ValueType
template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::RealReturnType

Specializations for char-equivalent types, to prevent writing them

Used type if the returnvalue must be a real value.

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 593 of file OSGVector.h.

template<class ValueTypeT, UInt32 SizeI>
typedef Inherited::PointType OSG::Vector< ValueTypeT, SizeI >::PointType

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 595 of file OSGVector.h.

template<class ValueTypeT, UInt32 SizeI>
typedef Inherited::VectorType OSG::Vector< ValueTypeT, SizeI >::VectorType

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 596 of file OSGVector.h.


Constructor & Destructor Documentation

template<class ValueTypeT , UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::Vector ( void   )  [inline]

Definition at line 1261 of file OSGVector.inl.

01261                                       :
01262     Inherited()
01263 {
01264     for(UInt32 i = 0; i < Self::_uiSize; i++)
01265     {
01266         Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
01267     }
01268 }

template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::Vector ( const ValueTypeT *  pVals  )  [inline, explicit]

Be shure the array size at least as large as the vector size.

Definition at line 1278 of file OSGVector.inl.

01278                                                          :
01279     Inherited(pVals)
01280 {
01281 }

template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::Vector ( ValueTypeT *  pVals  )  [inline, explicit]

Be shure the array size at least as large as the vector size.

Definition at line 1290 of file OSGVector.inl.

01290                                                    :
01291     Inherited(pVals)
01292 {
01293 }

template<class ValueTypeT , UInt32 SizeI>
template<class ValueType2T , UInt32 Size2I>
OSG::Vector< ValueTypeT, SizeI >::Vector ( const Point< ValueType2T, Size2I > &  pnt  )  [inline, explicit]

Definition at line 1299 of file OSGVector.inl.

01299                                                                        :
01300
01301     Inherited(pnt)
01302 {
01303 }

template<class ValueTypeT , UInt32 SizeI>
template<class ValueType2T , UInt32 Size2I>
OSG::Vector< ValueTypeT, SizeI >::Vector ( const Vector< ValueType2T, Size2I > &  vec  )  [inline, explicit]

Definition at line 1309 of file OSGVector.inl.

01309                                                                         :
01310
01311     Inherited(vec)
01312 {
01313 }

template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::Vector ( const Vector< ValueTypeT, SizeI > &  source  ) 
template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::Vector ( const ValueType  rVal1  )  [inline]

Definition at line 1326 of file OSGVector.inl.

01327 {
01328     UInt32 i;
01329
01330     Self::_values[0] = rVal1;
01331
01332     for(i = 1; i < Self::_uiSize; i++)
01333     {
01334         Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
01335     }
01336 }

template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::Vector ( const ValueType  rVal1,
const ValueType  rVal2 
) [inline]

Definition at line 1340 of file OSGVector.inl.

01341                                                          :
01342
01343     Inherited(rVal1, rVal2)
01344 {
01345 }

template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::Vector ( const ValueType  rVal1,
const ValueType  rVal2,
const ValueType  rVal3 
) [inline]

Definition at line 1349 of file OSGVector.inl.

01351                                                          :
01352
01353     Inherited(rVal1, rVal2, rVal3)
01354 {
01355 }

template<class ValueTypeT, UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::Vector ( const ValueType  rVal1,
const ValueType  rVal2,
const ValueType  rVal3,
const ValueType  rVal4 
) [inline]

Definition at line 1359 of file OSGVector.inl.

01362                                                          :
01363
01364     Inherited(rVal1, rVal2, rVal3, rVal4)
01365 {
01366 }

template<class ValueTypeT , UInt32 SizeI>
OSG::Vector< ValueTypeT, SizeI >::~Vector ( void   )  [inline]

Definition at line 1374 of file OSGVector.inl.

01375 {
01376 }


Member Function Documentation

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI >::RealReturnType OSG::Vector< ValueTypeT, SizeI >::length ( void   )  const [inline]
template<class ValueTypeT , UInt32 SizeI>
void OSG::Vector< ValueTypeT, SizeI >::normalize ( void   )  [inline]

Definition at line 1414 of file OSGVector.inl.

References OSG::Eps, OSG::Vector< ValueTypeT, SizeI >::length(), and OSG::osgAbs().

Referenced by OSG::addPoint(), OSG::Surface::buildSurface(), OSG::PerspectiveShadowMapHandler::calcBodyVec(), OSG::Billboard::calcMatrix(), OSG::PerspectiveShadowMapHandler::calcPerspectiveSpot(), OSG::TrapezoidalShadowMapEngine::calcTrapezoidalTransform(), OSG::PerspectiveShadowMapHandler::calcUpVec2(), OSG::QuadTreeTerrain::changed(), OSG::TextVectorGlyph::computeContourOrientations(), OSG::computeEdgeNormal(), OSG::QuadTreeTerrain::createNormalMap(), drawViewerQuads< posTrait, colTrait, texTrait, sizeTrait >::draw(), drawViewerObjects< posTrait, colTrait, sizeTrait, geoTrait >::draw(), drawObjects< posTrait, colTrait, sizeTrait, normalTrait, geoTrait >::draw(), drawViewerObjects< posTrait, colTrait, sizeTrait, geoTrait >::drawIndexed(), drawObjects< posTrait, colTrait, sizeTrait, normalTrait, geoTrait >::drawIndexed(), drawViewerQuads< posTrait, colTrait, texTrait, sizeTrait >::drawIndexed(), OSG::WalkEngine::forward(), OSG::FlyEngine::forward(), OSG::TextVectorGlyph::getNormals(), OSG::NormalQuantifier::getSubIndex(), OSG::Line::intersect(), OSG::Line::Line(), OSG::Plane::Plane(), OSG::PerspectiveShadowMapHandler::pntInFrontOf(), OSG::GeoTypeGraphOp::processNormals(), OSG::MergeGraphOp::processTransformations(), OSG::RAWSceneFileType::read(), OSG::OFLocalVertexPoolRecord::readContinue(), OSG::WalkEngine::right(), OSG::FlyEngine::right(), OSG::FlyEngine::rotate(), OSG::QuaternionBase< ValueTypeT >::setValue(), OSG::Line::setValue(), OSG::NormalQuantifier::subdivide(), OSG::Plane::transform(), OSG::CylinderVolume::transform(), OSG::ShadowStage::updateLights(), and OSG::TileGeometryLoad::updateView().

01415 {
01416     ValueTypeT rLength = ValueTypeT(length());
01417
01418     if(osgAbs(rLength) < Eps)
01419     {
01420         rLength = TypeTraits<ValueTypeT>::getOneElement();
01421     }
01422     else
01423     {
01424         rLength = TypeTraits<ValueTypeT>::getOneElement() / rLength;
01425     }
01426
01427     for(UInt32 i = 0; i < Self::_uiSize; i++)
01428     {
01429         Self::_values[i] *= rLength;
01430     }
01431 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::cross ( const Vector< ValueTypeT, SizeI > &  vec  )  const [inline]

Definition at line 1444 of file OSGVector.inl.

Referenced by OSG::Billboard::calcMatrix(), OSG::PerspectiveShadowMapHandler::calcUpVec2(), OSG::QuadTreeTerrain::changed(), OSG::Surface::checkOrient(), OSG::CErrorQuadTree::ComputeError(), OSG::BSplineTensorSurface::computeNormal(), OSG::BSplineTensorSurface::computeNormalTex(), OSG::QuadTreeTerrain::createNormalMap(), drawViewerQuads< posTrait, colTrait, texTrait, sizeTrait >::draw(), drawViewerObjects< posTrait, colTrait, sizeTrait, geoTrait >::draw(), drawObjects< posTrait, colTrait, sizeTrait, normalTrait, geoTrait >::draw(), drawViewerObjects< posTrait, colTrait, sizeTrait, geoTrait >::drawIndexed(), drawObjects< posTrait, colTrait, sizeTrait, normalTrait, geoTrait >::drawIndexed(), drawViewerQuads< posTrait, colTrait, texTrait, sizeTrait >::drawIndexed(), OSG::Line::getClosestPoints(), OSG::ProjectionCameraDecorator::getProjectionTranslation(), OSG::FrustumVolume::getScalarVolume(), OSG::Plane::intersect(), OSG::Line::intersect(), OSG::Vector< ValueTypeT, SizeI >::operator%(), OSG::PerspectiveShadowMapHandler::pntInFrontOf(), OSG::NormalQuantifier::rayTriangle(), OSG::QuaternionBase< ValueTypeT >::setValue(), and OSG::ProjectionCameraDecorator::updateData().

01445 {
01446     Vector<ValueTypeT, SizeI> returnValue;
01447
01448     if(Self::_uiSize >= 3)
01449     {
01450         returnValue[0] =
01451             Self::_values[1] * vec._values[2] -
01452             Self::_values[2] * vec._values[1];
01453         returnValue[1] =
01454             Self::_values[2] * vec._values[0] -
01455             Self::_values[0] * vec._values[2];
01456         returnValue[2] =
01457             Self::_values[0] * vec._values[1] -
01458             Self::_values[1] * vec._values[0];
01459     }
01460     else
01461     {
01462         // Must be changed
01463         fprintf(stderr, "cross only implemented for size 3\n");
01464     }
01465
01466     return returnValue;
01467 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator% ( const Vector< ValueTypeT, SizeI > &  vec  )  const [inline]

Definition at line 1472 of file OSGVector.inl.

References OSG::Vector< ValueTypeT, SizeI >::cross().

01473 {
01474     return this->cross(vec);
01475 }

template<class ValueTypeT , UInt32 SizeI>
void OSG::Vector< ValueTypeT, SizeI >::crossThis ( const Vector< ValueTypeT, SizeI > &  vec  )  [inline]

Definition at line 1483 of file OSGVector.inl.

Referenced by OSG::WalkEngine::forward(), OSG::Plane::Plane(), OSG::RAWSceneFileType::read(), OSG::WalkEngine::right(), OSG::FlyEngine::right(), OSG::FlyEngine::rotate(), OSG::TrackballEngine::rotate(), OSG::CylinderVolume::transform(), and OSG::Trackball::updateRotation().

01484 {
01485     if(Self::_uiSize >= 3)
01486     {
01487         ValueTypeT rTmp[2];
01488
01489         rTmp[0] =
01490             Self::_values[1] * vec._values[2] -
01491             Self::_values[2] * vec._values[1];
01492         rTmp[1] =
01493             Self::_values[2] * vec._values[0] -
01494             Self::_values[0] * vec._values[2];
01495
01496         Self::_values[2] =
01497             Self::_values[0] * vec._values[1] -
01498             Self::_values[1] * vec._values[0];
01499
01500         Self::_values[0] = rTmp[0];
01501         Self::_values[1] = rTmp[1];
01502     }
01503     else
01504     {
01505         // Must be changed
01506         fprintf(stderr, "crossThis only available for size 3\n");
01507     }
01508 }

template<class ValueTypeT , UInt32 SizeI>
ValueTypeT OSG::Vector< ValueTypeT, SizeI >::operator* ( const Vector< ValueTypeT, SizeI > &  vec  )  const [inline]

Definition at line 1532 of file OSGVector.inl.

References OSG::Vector< ValueTypeT, SizeI >::dot().

01533 {
01534     return this->dot(vec);
01535 }

template<class ValueTypeT , UInt32 SizeI>
ValueTypeT OSG::Vector< ValueTypeT, SizeI >::dot ( const PointType pnt  )  const [inline]

Definition at line 1539 of file OSGVector.inl.

01540 {
01541     ValueTypeT rTmpVal = Self::_values[0] * pnt[0];
01542
01543     for(UInt32 i = 1; i < Self::_uiSize; i++)
01544     {
01545         rTmpVal += Self::_values[i] * pnt[i];
01546     }
01547
01548     return rTmpVal;
01549 }

template<class ValueTypeT , UInt32 SizeI>
ValueTypeT OSG::Vector< ValueTypeT, SizeI >::operator* ( const PointType pnt  )  const [inline]

Definition at line 1553 of file OSGVector.inl.

References OSG::Vector< ValueTypeT, SizeI >::dot().

01554 {
01555      return this->dot(pnt);
01556 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI >::RealReturnType OSG::Vector< ValueTypeT, SizeI >::enclosedAngle ( const Vector< ValueTypeT, SizeI > &  vec  )  const [inline]

Definition at line 1563 of file OSGVector.inl.

References OSG::Vector< ValueTypeT, SizeI >::dot(), OSG::Eps, OSG::Point< ValueTypeT, SizeI >::isZero(), OSG::Vector< ValueTypeT, SizeI >::length(), OSG::osgACos(), and OSG::Pi.

Referenced by OSG::ShadowStage::updateLights().

01564 {
01565     RealReturnType returnValue;
01566
01567     if(Self::isZero() || vec.isZero())
01568     {
01569         returnValue = TypeTraits<RealReturnType>::getZeroElement();
01570     }
01571     else
01572     {
01573         returnValue  = dot(vec);
01574         returnValue /= (length() * vec.length());
01575
01576         if((returnValue - Eps) < -1.)
01577         {
01578             returnValue = Pi;
01579         }
01580         else if((returnValue + Eps) > 1.)
01581         {
01582             returnValue = TypeTraits<RealReturnType>::getZeroElement();
01583         }
01584         else
01585         {
01586             returnValue = osgACos(returnValue);
01587         }
01588     }
01589
01590     return returnValue;
01591 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI >::RealReturnType OSG::Vector< ValueTypeT, SizeI >::projectTo ( const Vector< ValueTypeT, SizeI > &  toVec  )  [inline]

Definition at line 1596 of file OSGVector.inl.

References OSG::Vector< ValueTypeT, SizeI >::dot(), OSG::Eps, OSG::osgAbs(), and OSG::Point< ValueTypeT, SizeI >::setNull().

Referenced by OSG::Plane::transform().

01597 {
01598     RealReturnType rDot       = this ->dot(toVec);
01599     RealReturnType rSquareDot = toVec .dot(toVec);
01600
01601     if(rSquareDot > Eps)
01602     {
01603         rDot /= rSquareDot;
01604
01605         if(osgAbs(rDot) > Eps)
01606         {
01607             *this  = toVec;
01608             *this *= ValueTypeT(rDot);
01609         }
01610         else
01611         {
01612             this->setNull();
01613             rDot = TypeTraits<RealReturnType>::getZeroElement();
01614         }
01615     }
01616     else
01617     {
01618         rDot = TypeTraits<RealReturnType>::getOneElement();
01619     }
01620
01621     return rDot;
01622 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI >::PointType & OSG::Vector< ValueTypeT, SizeI >::addToZero ( void   )  [inline]

Definition at line 1639 of file OSGVector.inl.

Referenced by OSG::Manipulator::mouseMove().

01640 {
01641     return *(static_cast<PointType *>(this));
01642 }

template<class ValueTypeT , UInt32 SizeI>
const Vector< ValueTypeT, SizeI >::PointType & OSG::Vector< ValueTypeT, SizeI >::addToZero ( void   )  const [inline]

Definition at line 1629 of file OSGVector.inl.

01630 {
01631     return *(static_cast<const PointType *>(this));
01632 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI > & OSG::Vector< ValueTypeT, SizeI >::subZero ( void   )  [inline]

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 1647 of file OSGVector.inl.

01648 {
01649     return *this;
01650 }

template<class ValueTypeT , UInt32 SizeI>
const Vector< ValueTypeT, SizeI > & OSG::Vector< ValueTypeT, SizeI >::subZero ( void   )  const [inline]

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 1655 of file OSGVector.inl.

01656 {
01657     return (*this);
01658 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator- ( const Vector< ValueTypeT, SizeI > &  vec  )  const [inline]

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 1668 of file OSGVector.inl.

01669 {
01670     Vector<ValueTypeT, SizeI> returnValue;
01671
01672     for(UInt32 i = 0; i < Self::_uiSize; i++)
01673     {
01674         returnValue[i] = Self::_values[i] - vec[i];
01675     }
01676
01677     return returnValue;
01678 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator+ ( const Vector< ValueTypeT, SizeI > &  vec  )  const [inline]

Definition at line 1685 of file OSGVector.inl.

01686 {
01687     Vector<ValueTypeT, SizeI> returnValue;
01688
01689     for(UInt32 i = 0; i < Self::_uiSize; i++)
01690     {
01691         returnValue[i] = Self::_values[i] + vec[i];
01692     }
01693
01694     return returnValue;
01695 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator* ( const ValueType  val  )  const [inline]

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 1703 of file OSGVector.inl.

01704 {
01705     Vector<ValueTypeT, SizeI> returnValue;
01706
01707     for(UInt32 i = 0; i < Self::_uiSize; i++)
01708     {
01709         returnValue[i] = Self::_values[i] * rVal;
01710     }
01711
01712     return returnValue;
01713 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::operator- ( void   )  const [inline]

Definition at line 1720 of file OSGVector.inl.

01721 {
01722     Vector<ValueTypeT, SizeI> returnValue;
01723
01724     for(UInt32 i = 0; i < Self::_uiSize; i++)
01725     {
01726         returnValue._values[i] = - Self::_values[i];
01727     }
01728
01729     return returnValue;
01730 }

template<class ValueTypeT , UInt32 SizeI>
Vector< ValueTypeT, SizeI > & OSG::Vector< ValueTypeT, SizeI >::operator= ( const Vector< ValueTypeT, SizeI > &  source  )  [inline]

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 1738 of file OSGVector.inl.

01739 {
01740     if(this == &source)
01741         return *this;
01742
01743     *(static_cast<Inherited *>(this)) =
01744         static_cast<const Inherited &>(source);
01745
01746     return *this;
01747 }

template<class ValueTypeT , UInt32 SizeI>
bool OSG::Vector< ValueTypeT, SizeI >::operator< ( const Vector< ValueTypeT, SizeI > &  other  )  const [inline]

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 1754 of file OSGVector.inl.

01755 {
01756     bool ret = false;
01757
01758     for(UInt32 i = 0; i < Self::_uiSize; i++)
01759     {
01760         if(Self::_values[i] > other._values[i])
01761         {
01762             break;
01763         }
01764         if(Self::_values[i] < other._values[i])
01765         {
01766             ret = true;
01767             break;
01768         }
01769     }
01770
01771     return ret;
01772 }

template<class ValueTypeT , UInt32 SizeI>
bool OSG::Vector< ValueTypeT, SizeI >::operator== ( const Vector< ValueTypeT, SizeI > &  other  )  const [inline]

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 1778 of file OSGVector.inl.

References OSG::Eps, and OSG::Point< ValueTypeT, SizeI >::equals().

01779 {
01780     return Self::equals(other, ValueTypeT(Eps));
01781 }

template<class ValueTypeT , UInt32 SizeI>
bool OSG::Vector< ValueTypeT, SizeI >::operator!= ( const Vector< ValueTypeT, SizeI > &  other  )  const [inline]

Reimplemented from OSG::Point< ValueTypeT, SizeI >.

Definition at line 1787 of file OSGVector.inl.

01788 {
01789     return ! (*this == other);
01790 }


Member Data Documentation

template<class ValueTypeT, UInt32 SizeI>
const Vector< ValueTypeT, SizeI > OSG::Vector< ValueTypeT, SizeI >::Null [inline, static]

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