OSG::VectorInterface< ValueTypeT, StorageInterfaceT > Class Template Reference

#include <OSGVector.h>

Inheritance diagram for OSG::VectorInterface< ValueTypeT, StorageInterfaceT >:

OSG::PointInterface< ValueTypeT, StorageInterfaceT > List of all members.

Public Types

typedef PointInterface< ValueTypeT,
StorageInterfaceT > 
Inherited
 Parent type.
typedef TypeTraits< ValueTypeT
>::RealReturnType 
RealReturnType
 Used type if the returnvalue must be a real value.
typedef ValueTypeT ValueType
 Value type.
typedef Inherited PntInterface
typedef VectorInterface< ValueTypeT,
StorageInterfaceT > 
Self
 Own type.
typedef VectorInterface< ValueTypeT,
StorageInterfaceT > 
VecInterface

Public Member Functions

Constructors


 VectorInterface (void)
 VectorInterface (const ValueTypeT *pVals)
 Constructor which takes a const value array.
 VectorInterface (ValueTypeT *pVals)
 Constructor which takes a const value array.
template<class ValueType2T, class StorageInterface2T>
 VectorInterface (const PointInterface< ValueType2T, StorageInterface2T > &vec)
template<class ValueType2T, class StorageInterface2T>
 VectorInterface (const VectorInterface< ValueType2T, StorageInterface2T > &vec)
 VectorInterface (const VectorInterface &source)
 VectorInterface (const ValueTypeT rVal1)
 VectorInterface (const ValueTypeT rVal1, const ValueTypeT rVal2)
 VectorInterface (const ValueTypeT rVal1, const ValueTypeT rVal2, const ValueTypeT rVal3)
 VectorInterface (const ValueTypeT rVal1, const ValueTypeT rVal2, const ValueTypeT rVal3, const ValueTypeT rVal4)
Destructor


 ~VectorInterface (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.
VectorInterface cross (const VectorInterface &vec) const
 Returns the right handed cross-product for a given vector; This function is implemented for size 3 vectors only.
VectorInterface operator% (const VectorInterface &vec) const
 Euclidean length of the vector.
void crossThis (const VectorInterface &vec)
 Calculates the right handed cross-product with a given vector; This function is implemented for size 3 vectors only.
ValueTypeT dot (const VectorInterface &vec) const
 Return the dot (inner) product for a given vector.
ValueTypeT operator * (const VectorInterface &vec) const
 Euclidean length of the vector.
ValueTypeT dot (const PntInterface &pnt) const
 Euclidean length of the vector.
ValueTypeT operator * (const PntInterface &pnt) const
 Euclidean length of the vector.
RealReturnType enclosedAngle (const VectorInterface &vec) const
 Returns the angle between this and another vector.
RealReturnType projectTo (const VectorInterface &toVec)
 Euclidean length of the vector.
Conv


PntInterfaceaddToZero (void)
 Returns the corrosponding point by adding it to zero.
const PntInterfaceaddToZero (void) const
 Returns the corrosponding point by adding it to zero.
VectorInterfacesubZero (void)
 Returns the corrosponding point by adding it to zero.
const VectorInterfacesubZero (void) const
 Returns the corrosponding point by adding it to zero.
Math


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


VectorInterfaceoperator= (const VectorInterface &source)
Comparison


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


void setNull (void)
void setValue (const PointInterface &vec)
template<class ValueType2T, class StorageInterface2T>
void setValue (const PointInterface< ValueType2T, StorageInterface2T > &vec)
void setValue (const ValueTypeT *pVals)
void setValue (ValueTypeT *pVals)
 Set value from a given array, be sure to match sizes.
void setValue (const Char8 *szString)
void setValue (Char8 *szString)
void setValueFromCString (const Char8 *szString)
 Extract values from given string, where both (const and not const) must be present, otherwise the compiler strikes back :-) (GV).
void setValueFromCString (Char8 *szString)
 Extract values from given string, where both (const and not const) must be present, otherwise the compiler strikes back :-) (GV).
Get Values


ValueTypeT * getValues (void)
 Get a pointer to the value storage.
const ValueTypeT * getValues (void) const
 Get a const pointer to the value storage.
Common Math


bool isZero (void) const
 Returns true iff the norm of each value is less than Eps.
void negate (void)
 Negates each value of the point in place.
bool equals (const PointInterface &vec, const ValueTypeT tolerance) const
 Returns true iff the two points are eual within a given tolerance.
RealReturnType dist (const PointInterface &vec) const
 Returns the distance between the two points.
RealReturnType dist2 (const PointInterface &vec) const
 Returns the distance between the two points, squared.
RealReturnType maxValue (void) const
 Returns the maximum value of the vector.
Math


void operator *= (const ValueTypeT val)
 Component wise scalar multiplication.
void operator/= (const ValueTypeT val)
 Component wise scalar division.
VecInterface operator- (const PointInterface &vec) const
 Point substraction, returns a new vector.
PointInterface operator- (const VecInterface &vec) const
 Component wise binary vector addition operator.
PointInterface operator- (void)
 Nondestructive unary negation, returns new point.
PointInterface operator+ (const VecInterface &vec) const
 Component wise binary vector addition operator.
void operator+= (const VecInterface &vec)
 Component wise vector addition.
void operator-= (const VecInterface &vec)
 Component wise vector substraction.
Element Access


ValueTypeT & operator[] (const UInt32 uiVal)
const ValueTypeT & operator[] (const UInt32 uiVal) const
Comparison


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

Static Public Attributes

static const VectorInterface Null

Detailed Description

template<class ValueTypeT, class StorageInterfaceT>
class OSG::VectorInterface< ValueTypeT, StorageInterfaceT >

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

Definition at line 551 of file OSGVector.h.


Member Typedef Documentation

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::Inherited

Reimplemented from OSG::PointInterface< ValueTypeT, StorageInterfaceT >.

Definition at line 559 of file OSGVector.h.

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::RealReturnType

Reimplemented from OSG::PointInterface< ValueTypeT, StorageInterfaceT >.

Definition at line 561 of file OSGVector.h.

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::ValueType

template<class ValueTypeT, class StorageInterfaceT>
typedef Inherited OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::PntInterface

Definition at line 565 of file OSGVector.h.

template<class ValueTypeT, class StorageInterfaceT>
typedef VectorInterface<ValueTypeT, StorageInterfaceT> OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::Self

Reimplemented from OSG::PointInterface< ValueTypeT, StorageInterfaceT >.

Definition at line 568 of file OSGVector.h.

template<class ValueTypeT, class StorageInterfaceT>
typedef VectorInterface<ValueTypeT, StorageInterfaceT> OSG::PointInterface< ValueTypeT, StorageInterfaceT >::VecInterface [inherited]

Definition at line 354 of file OSGVector.h.


Constructor & Destructor Documentation

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( void   )  [inline]

Definition at line 1340 of file OSGVector.inl.

01340                                                                     : 
01341     Inherited()
01342 {
01343     for(UInt32 i = 0; i < Self::_uiSize; i++)
01344     {
01345         Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
01346     }
01347 }

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( const ValueTypeT *  pVals  )  [inline, explicit]

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

Definition at line 1358 of file OSGVector.inl.

01358                                                                            :
01359     Inherited(pVals)
01360 {
01361 }

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( ValueTypeT *  pVals  )  [inline, explicit]

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

Definition at line 1371 of file OSGVector.inl.

01371                                                                      : 
01372     Inherited(pVals)
01373 {
01374 }

template<class ValueTypeT, class StorageInterfaceT>
template<class ValueType2T, class StorageInterface2T>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( const PointInterface< ValueType2T, StorageInterface2T > &  vec  )  [inline, explicit]

Definition at line 1380 of file OSGVector.inl.

01381                                                                 :
01382 
01383     Inherited(vec)
01384 {
01385 }

template<class ValueTypeT, class StorageInterfaceT>
template<class ValueType2T, class StorageInterface2T>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( const VectorInterface< ValueType2T, StorageInterface2T > &  vec  )  [inline, explicit]

Definition at line 1391 of file OSGVector.inl.

01392                                                                  :
01393 
01394     Inherited(vec)
01395 {
01396 }

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  source  )  [inline]

Definition at line 1401 of file OSGVector.inl.

01402                                    : 
01403 
01404     Inherited(source)
01405 {
01406 }

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( const ValueTypeT  rVal1  )  [inline]

Definition at line 1411 of file OSGVector.inl.

01412 {
01413     UInt32 i;
01414 
01415     Self::_values[0] = rVal1;
01416 
01417     for(i = 1; i < Self::_uiSize; i++)
01418     {
01419         Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
01420     }
01421 }

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( const ValueTypeT  rVal1,
const ValueTypeT  rVal2 
) [inline]

Definition at line 1426 of file OSGVector.inl.

01427                                                                             :
01428 
01429     Inherited(rVal1, rVal2)
01430 {
01431 }

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( const ValueTypeT  rVal1,
const ValueTypeT  rVal2,
const ValueTypeT  rVal3 
) [inline]

Definition at line 1436 of file OSGVector.inl.

01438                                                                             :
01439 
01440     Inherited(rVal1, rVal2, rVal3)
01441 {
01442 }

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface ( const ValueTypeT  rVal1,
const ValueTypeT  rVal2,
const ValueTypeT  rVal3,
const ValueTypeT  rVal4 
) [inline]

Definition at line 1447 of file OSGVector.inl.

01450                                                                             :
01451 
01452     Inherited(rVal1, rVal2, rVal3, rVal4)
01453 {
01454 }

template<class ValueTypeT, class StorageInterfaceT>
OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::~VectorInterface ( void   )  [inline]

Definition at line 1463 of file OSGVector.inl.

01464 {
01465 }


Member Function Documentation

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT >::RealReturnType OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::length ( void   )  const [inline]

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT >::RealReturnType OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::squareLength ( void   )  const [inline]

Definition at line 1475 of file OSGVector.inl.

Referenced by OSG::calcVertexNormals(), and OSG::Line::getClosestPoints().

01476 {
01477     RealReturnType rTmpVal = RealReturnType(Self::_values[0] * 
01478                                             Self::_values[0] );
01479 
01480     for(UInt32 i = 1; i < Self::_uiSize; i++)
01481     {
01482         rTmpVal += Self::_values[i] * Self::_values[i];
01483     }
01484 
01485     return rTmpVal;
01486 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::normalize ( void   )  [inline]

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT > OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::cross ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  vec  )  const [inline]

Definition at line 1534 of file OSGVector.inl.

Referenced by OSG::Billboard::calcMatrix(), OSG::Line::getClosestPoints(), OSG::FrustumVolume::getScalarVolume(), OSG::Plane::intersect(), OSG::Line::intersect(), OSG::MatrixLookAt(), OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator%(), OSG::points_from_basis(), OSG::NormalQuantifier::rayTriangle(), OSG::QuaternionBase< ValueTypeT >::setValue(), and OSG::ProjectionCameraDecorator::updateData().

01535 {
01536     VectorInterface<ValueTypeT, StorageInterfaceT> returnValue;
01537 
01538     if(Self::_uiSize >= 3)
01539     {
01540         returnValue[0] =
01541             Self::_values[1] * vec._values[2] - 
01542             Self::_values[2] * vec._values[1];
01543         returnValue[1] =
01544             Self::_values[2] * vec._values[0] - 
01545             Self::_values[0] * vec._values[2];
01546         returnValue[2] =
01547             Self::_values[0] * vec._values[1] - 
01548             Self::_values[1] * vec._values[0];
01549     }
01550     else
01551     {
01552         // Must be changed
01553         fprintf(stderr, "cross only implemented for size 3\n");
01554     }
01555 
01556     return returnValue;
01557 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT > OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator% ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  vec  )  const [inline]

Definition at line 1562 of file OSGVector.inl.

References OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::cross().

01564 {
01565     return this->cross(vec);
01566 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::crossThis ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  vec  )  [inline]

Definition at line 1575 of file OSGVector.inl.

Referenced by OSG::calcVertexNormals(), OSG::WalkNavigator::forward(), OSG::Plane::Plane(), OSG::RAWSceneFileType::read(), OSG::WalkNavigator::right(), OSG::FlyNavigator::right(), OSG::TrackballNavigator::rotate(), OSG::FlyNavigator::rotate(), OSG::CylinderVolume::transform(), and OSG::Trackball::updateRotation().

01576 {
01577     if(Self::_uiSize >= 3)
01578     {
01579         ValueTypeT rTmp[2];
01580 
01581         rTmp[0] = 
01582             Self::_values[1] * vec._values[2] - 
01583             Self::_values[2] * vec._values[1];
01584         rTmp[1] = 
01585             Self::_values[2] * vec._values[0] - 
01586             Self::_values[0] * vec._values[2];
01587 
01588         Self::_values[2] =
01589             Self::_values[0] * vec._values[1] -
01590             Self::_values[1] * vec._values[0];
01591 
01592         Self::_values[0] = rTmp[0];
01593         Self::_values[1] = rTmp[1];
01594     }
01595     else
01596     {
01597         // Must be changed
01598         fprintf(stderr, "crossThis only available for size 3\n");
01599     }
01600 }

template<class ValueTypeT, class StorageInterfaceT>
ValueTypeT OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::dot ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  vec  )  const [inline]

template<class ValueTypeT, class StorageInterfaceT>
ValueTypeT OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator * ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  vec  )  const [inline]

Definition at line 1625 of file OSGVector.inl.

References OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::dot().

01627 {
01628     return this->dot(vec);
01629 }

template<class ValueTypeT, class StorageInterfaceT>
ValueTypeT OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::dot ( const PntInterface pnt  )  const [inline]

Definition at line 1633 of file OSGVector.inl.

01635 {
01636     ValueTypeT rTmpVal = Self::_values[0] * pnt[0];
01637 
01638     for(UInt32 i = 1; i < Self::_uiSize; i++)
01639     {
01640         rTmpVal += Self::_values[i] * pnt[i];
01641     }
01642 
01643     return rTmpVal;
01644 }

template<class ValueTypeT, class StorageInterfaceT>
ValueTypeT OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator * ( const PntInterface pnt  )  const [inline]

Definition at line 1648 of file OSGVector.inl.

References OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::dot().

01650 {
01651      return this->dot(pnt);
01652 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT >::RealReturnType OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::enclosedAngle ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  vec  )  const [inline]

Definition at line 1659 of file OSGVector.inl.

References OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::dot(), OSG::Eps, OSG::PointInterface< ValueTypeT, StorageInterfaceT >::isZero(), OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::length(), OSG::osgACos(), and OSG::Pi.

01661 {
01662     RealReturnType returnValue;
01663 
01664     if(Self::isZero() || vec.isZero())
01665     {
01666         returnValue = TypeTraits<RealReturnType>::getZeroElement();
01667     }
01668     else
01669     {
01670         returnValue  = dot(vec);
01671         returnValue /= (length() * vec.length());
01672 
01673         if((returnValue - Eps) < -1.)
01674         {
01675             returnValue = Pi;
01676         }
01677         else if((returnValue + Eps) > 1.)
01678         {
01679             returnValue = TypeTraits<RealReturnType>::getZeroElement();
01680         }
01681         else
01682         {
01683             returnValue = osgACos(returnValue);
01684         }
01685     }
01686 
01687     return returnValue;
01688 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT >::RealReturnType OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::projectTo ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  toVec  )  [inline]

Definition at line 1693 of file OSGVector.inl.

References OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::dot(), OSG::Eps, OSG::osgAbs(), and OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setNull().

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

01695 {
01696     RealReturnType rDot       = dot(toVec);
01697     RealReturnType rSquareDot = toVec.dot(toVec);
01698 
01699     if(rSquareDot > Eps)
01700     {
01701         rDot /= rSquareDot;
01702 
01703         if(osgAbs(rDot) > Eps)
01704         {
01705             *this  = toVec;
01706             *this *= ValueTypeT(rDot);
01707         }
01708         else
01709         {
01710             this->setNull();
01711             rDot = TypeTraits<RealReturnType>::getZeroElement();
01712         }
01713     }
01714     else
01715     {
01716         rDot = TypeTraits<RealReturnType>::getOneElement();
01717     }
01718 
01719     return rDot;
01720 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT >::PntInterface & OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::addToZero ( void   )  [inline]

Definition at line 1741 of file OSGVector.inl.

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

01742 {
01743     return *(static_cast<PntInterface *>(this));
01744 }

template<class ValueTypeT, class StorageInterfaceT>
const VectorInterface< ValueTypeT, StorageInterfaceT >::PntInterface & OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::addToZero ( void   )  const [inline]

Definition at line 1729 of file OSGVector.inl.

01730 {
01731     return *(static_cast<const PntInterface *>(this));
01732 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT > & OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::subZero ( void   )  [inline]

Reimplemented from OSG::PointInterface< ValueTypeT, StorageInterfaceT >.

Definition at line 1749 of file OSGVector.inl.

01750 {
01751     return *this;
01752 }

template<class ValueTypeT, class StorageInterfaceT>
const VectorInterface< ValueTypeT, StorageInterfaceT > & OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::subZero ( void   )  const [inline]

Reimplemented from OSG::PointInterface< ValueTypeT, StorageInterfaceT >.

Definition at line 1757 of file OSGVector.inl.

01758 {
01759     return (*this);
01760 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT > OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator- ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  vec  )  const [inline]

Definition at line 1770 of file OSGVector.inl.

01772 {
01773     VectorInterface<ValueTypeT, StorageInterfaceT> returnValue;
01774 
01775     for(UInt32 i = 0; i < StorageInterfaceT::_uiSize; i++)
01776     {
01777         returnValue[i] = Self::_values[i] - vec[i];
01778     }
01779 
01780     return returnValue;
01781 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT > OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator+ ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  vec  )  const [inline]

Definition at line 1788 of file OSGVector.inl.

01790 {
01791     VectorInterface<ValueTypeT, StorageInterfaceT> returnValue;
01792 
01793     for(UInt32 i = 0; i < StorageInterfaceT::_uiSize; i++)
01794     {
01795         returnValue[i] = Self::_values[i] + vec[i];
01796     }
01797 
01798     return returnValue;
01799 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT > OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator * ( const ValueTypeT  rVal  )  const [inline]

Reimplemented from OSG::PointInterface< ValueTypeT, StorageInterfaceT >.

Definition at line 1807 of file OSGVector.inl.

01809 {
01810     VectorInterface<ValueTypeT, StorageInterfaceT> returnValue;
01811 
01812     for(UInt32 i = 0; i < StorageInterfaceT::_uiSize; i++)
01813     {
01814         returnValue[i] = Self::_values[i] * rVal;
01815     }
01816 
01817     return returnValue;
01818 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT > OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator- ( void   )  const [inline]

Definition at line 1825 of file OSGVector.inl.

01826 {
01827     VectorInterface<ValueTypeT, StorageInterfaceT> returnValue;
01828 
01829     for(UInt32 i = 0; i < Self::_uiSize; i++)
01830     {
01831         returnValue._values[i] = - Self::_values[i];
01832     }
01833 
01834     return returnValue;
01835 }

template<class ValueTypeT, class StorageInterfaceT>
VectorInterface< ValueTypeT, StorageInterfaceT > & OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator= ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  source  )  [inline]

Definition at line 1843 of file OSGVector.inl.

01845 {
01846     if(this == &source)
01847         return *this;
01848 
01849     *(static_cast<Inherited *>(this)) = 
01850         static_cast<const Inherited &>(source);
01851 
01852     return *this;
01853 }

template<class ValueTypeT, class StorageInterfaceT>
bool OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator< ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  other  )  const [inline]

Definition at line 1860 of file OSGVector.inl.

01862 {
01863     bool ret = false;
01864 
01865     for(UInt32 i = 0; i < Self::_uiSize; i++)
01866     {
01867         if(Self::_values[i] > other._values[i])
01868         {
01869             break;
01870         }
01871         if(Self::_values[i] < other._values[i])
01872         {
01873             ret = true;
01874             break;
01875         }
01876     }
01877 
01878     return ret;
01879 }

template<class ValueTypeT, class StorageInterfaceT>
bool OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator== ( const VectorInterface< ValueTypeT, StorageInterfaceT > &  other  )  const [inline]

Definition at line 1885 of file OSGVector.inl.

References OSG::Eps, and OSG::PointInterface< ValueTypeT, StorageInterfaceT >::equals().

01887 {
01888     return Self::equals(other, ValueTypeT(Eps));
01889 }

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

Definition at line 1895 of file OSGVector.inl.

01897 {
01898     return ! (*this == other);
01899 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setNull ( void   )  [inline, inherited]

Definition at line 649 of file OSGVector.inl.

Referenced by OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::projectTo().

00650 {
00651     for(UInt32 i = 0; i < Self::_uiSize; i++)
00652     {
00653         Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00654     }
00655 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValue ( const PointInterface< ValueTypeT, StorageInterfaceT > &  vec  )  [inline, inherited]