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

#include <OSGVector.h>

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

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

Public Types

typedef 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 VectorInterface< ValueTypeT,
StorageInterfaceT > 
VecInterface
typedef PointInterface< ValueTypeT,
StorageInterfaceT > 
Self
 Own type.

Public Member Functions

Constructors


 PointInterface (void)
 PointInterface (const ValueTypeT *pVals)
 Constructor which takes a const value array.
 PointInterface (ValueTypeT *pVals)
 Constructor which takes a value array.
template<class ValueType2T, class StorageInterface2T>
 PointInterface (const PointInterface< ValueType2T, StorageInterface2T > &vec)
template<class ValueType2T, class StorageInterface2T>
 PointInterface (const VectorInterface< ValueType2T, StorageInterface2T > &vec)
 PointInterface (const PointInterface &source)
 PointInterface (const ValueTypeT rVal1)
 PointInterface (const ValueTypeT rVal1, const ValueTypeT rVal2)
 Constructor which takes two values, remaining entries will be zero.
 PointInterface (const ValueTypeT rVal1, const ValueTypeT rVal2, const ValueTypeT rVal3)
 Constructor which takes three values, remaining entries will be zero.
 PointInterface (const ValueTypeT rVal1, const ValueTypeT rVal2, const ValueTypeT rVal3, const ValueTypeT rVal4)
 Constructor which takes four values, remaining entries will be zero.
Destructor


 ~PointInterface (void)
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 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).
void setValue (const Char8 *szString)
void setValue (Char8 *szString)
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.
VecInterfacesubZero (void)
 Returns the corrosponding vector by subtracting zero.
const VecInterfacesubZero (void) const
 Returns the corrosponding vector by subtracting zero.
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- (const VecInterface &vec) const
 Component wise binary vector addition operator.
PointInterface operator * (const ValueTypeT rVal) const
 Component wise binary scalar multiplication.
PointInterface operator- (void)
 Nondestructive unary negation, returns new point.
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
Assignment


PointInterfaceoperator= (const PointInterface &source)
PointInterfaceoperator= (const VecInterface &source)
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 PointInterface Null

Detailed Description

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

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

Definition at line 341 of file OSGVector.h.


Member Typedef Documentation

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

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

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

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

Definition at line 354 of file OSGVector.h.

template<class ValueTypeT, class StorageInterfaceT>
OSG::PointInterface< ValueTypeT, StorageInterfaceT >::Self


Constructor & Destructor Documentation

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

Definition at line 363 of file OSGVector.inl.

00363                                                                   : 
00364     Inherited()
00365 {
00366 }

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

Warning:
Make sure the array size is at least as large as the vector size.

Definition at line 376 of file OSGVector.inl.

00376                                                                          : 
00377     Inherited()
00378 {
00379     if(pVals == NULL)
00380     {
00381         for(UInt32 i = 0; i < Self::_uiSize; i++)
00382         {
00383             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00384         }
00385     }
00386     else
00387     {
00388         for(UInt32 i = 0; i < Self::_uiSize; i++)
00389         {
00390             Self::_values[i] = pVals[i];
00391         }
00392     }
00393 }

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

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

Definition at line 403 of file OSGVector.inl.

00403                                                                    : 
00404     Inherited()
00405 {
00406     if(pVals == NULL)
00407     {
00408         for(UInt32 i = 0; i < Self::_uiSize; i++)
00409         {
00410             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00411         }
00412     }
00413     else
00414     {
00415         for(UInt32 i = 0; i < Self::_uiSize; i++)
00416         {
00417             Self::_values[i] = pVals[i];
00418         }
00419     }
00420 }

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

Definition at line 426 of file OSGVector.inl.

References OSG::PointInterface< ValueTypeT, StorageInterfaceT >::getValues().

00428 {
00429     typedef PointInterface<ValueType2T, StorageInterface2T> VectorT;
00430 
00431     if(Self::_uiSize <= VectorT::_uiSize)
00432     {
00433         for(UInt32 i = 0; i < Self::_uiSize; i++)
00434         {
00435             Self::_values[i] = vec.getValues()[i];
00436         }
00437     }
00438     else
00439     {
00440         UInt32 i;
00441         for(i = 0; i < VectorT::_uiSize; i++)
00442         {
00443             Self::_values[i] = vec.getValues()[i];
00444         }
00445         for(i = VectorT::_uiSize; i < Self::_uiSize; i++)
00446         {
00447             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00448         }
00449     }
00450 }

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

Definition at line 456 of file OSGVector.inl.

References OSG::PointInterface< ValueTypeT, StorageInterfaceT >::getValues().

00458 {
00459     typedef VectorInterface<ValueType2T, StorageInterface2T> VectorT;
00460 
00461     if(Self::_uiSize <= VectorT::_uiSize)
00462     {
00463         for(UInt32 i = 0; i < Self::_uiSize; i++)
00464         {
00465             Self::_values[i] = vec.getValues()[i];
00466         }
00467     }
00468     else
00469     {
00470         UInt32 i;
00471         for(i = 0; i < VectorT::_uiSize; i++)
00472         {
00473             Self::_values[i] = vec.getValues()[i];
00474         }
00475         for(i = VectorT::_uiSize; i < Self::_uiSize; i++)
00476         {
00477             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00478         }
00479     }
00480 }

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

Definition at line 485 of file OSGVector.inl.

00486                                   : 
00487 
00488     Inherited()
00489 {
00490     for(UInt32 i = 0; i < Self::_uiSize; i++)
00491     {
00492         Self::_values[i] = source._values[i];
00493     }
00494 }

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

Definition at line 500 of file OSGVector.inl.

00502 {
00503     UInt32 i;
00504 
00505     Self::_values[0] = rVal1;
00506 
00507     for(i = 1; i < Self::_uiSize; i++)
00508     {
00509         Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00510     }
00511 }

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

Definition at line 524 of file OSGVector.inl.

00525                                                                           : 
00526     Inherited()
00527 {
00528     Self::_values[0] = rVal1;
00529 
00530     if(Self::_uiSize == 2)
00531     {
00532         Self::_values[1] = rVal2;
00533     }
00534     else if(Self::_uiSize >= 3)
00535     {
00536         Self::_values[1] = rVal2;
00537 
00538         for(UInt32 i = 2; i < Self::_uiSize; i++)
00539         {
00540             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00541         }
00542     }
00543 }

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

Definition at line 556 of file OSGVector.inl.

00558                                                                           : 
00559     Inherited()
00560 {
00561     Self::_values[0] = rVal1;
00562 
00563     if(Self::_uiSize == 2)
00564     {
00565         Self::_values[1] = rVal2;
00566     }
00567     else if(Self::_uiSize == 3)
00568     {
00569         Self::_values[1] = rVal2;
00570         Self::_values[2] = rVal3;
00571     }
00572     else if(Self::_uiSize >= 4)
00573     {
00574         Self::_values[1] = rVal2;
00575         Self::_values[2] = rVal3;
00576 
00577         for(UInt32 i = 3; i < Self::_uiSize; i++)
00578         {
00579             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00580         }
00581     }
00582 }

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

Definition at line 595 of file OSGVector.inl.

00598                                                                           : 
00599     Inherited()
00600 {
00601     Self::_values[0] = rVal1;
00602 
00603     if(Self::_uiSize == 2)
00604     {
00605         Self::_values[1] = rVal2;
00606     }
00607     else if(Self::_uiSize == 3)
00608     {
00609         Self::_values[1] = rVal2;
00610         Self::_values[2] = rVal3;
00611     }
00612     else if(Self::_uiSize == 4)
00613     {
00614         Self::_values[1] = rVal2;
00615         Self::_values[2] = rVal3;
00616         Self::_values[3] = rVal4;
00617     }
00618     else if(Self::_uiSize >= 5)
00619     {
00620         Self::_values[1] = rVal2;
00621         Self::_values[2] = rVal3;
00622         Self::_values[3] = rVal4;
00623 
00624         for(UInt32 i = 4; i < Self::_uiSize; i++)
00625         {
00626             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00627         }
00628     }
00629 }

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

Definition at line 640 of file OSGVector.inl.

00641 {
00642 }


Member Function Documentation

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

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]

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

Definition at line 685 of file OSGVector.inl.

00688 {
00689     typedef PointInterface<ValueType2T, StorageInterface2T> VectorT;
00690 
00691     static const UInt32 nElementsToCopy = 
00692         Self::_uiSize < VectorT::_uiSize ? Self::_uiSize : VectorT::_uiSize;
00693 
00694     for(UInt32 i = 0; i < nElementsToCopy; ++i)
00695     {
00696         Self::_values[i] = vec.getValues()[i];
00697     }
00698 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValue ( const ValueTypeT *  pVals  )  [inline]

Definition at line 703 of file OSGVector.inl.

00704 {
00705     for(UInt32 i = 0; i < Self::_uiSize; i++)
00706     {
00707         Self::_values[i] = pVals[i];
00708     }
00709 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValue ( ValueTypeT *  pVals  )  [inline]

Definition at line 716 of file OSGVector.inl.

References OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValue().

00717 {
00718     setValue(static_cast<const ValueTypeT *>(pVals));
00719 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValueFromCString ( const Char8 *  szString  )  [inline]

Definition at line 728 of file OSGVector.inl.

Referenced by OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValue(), and OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValueFromCString().

00730 {
00731     UInt32 i;
00732     UInt32 numOfToken = Self::_uiSize;
00733 
00734     Char8 *c      = const_cast<Char8 *>(szString);
00735     Char8 *tokenC = 0;
00736 
00737     Char8  token[256];
00738 
00739     if(szString == NULL || (*szString) == '\0')
00740     {
00741         for(i = 0; i < Self::_uiSize; i++)
00742             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00743 
00744         return;
00745     }
00746 
00747     for (i = 0; i < numOfToken; c++)
00748     {
00749         switch (*c)
00750         {
00751             case '\0':
00752                 if(tokenC)
00753                 {
00754                     *tokenC = 0;
00755                     Self::_values[i++] =
00756                         TypeTraits<ValueTypeT>::getFromCString(token);
00757                 }
00758 
00759                 while (i < numOfToken)
00760                 {
00761                     Self::_values[i++] =
00762                         TypeTraits<ValueTypeT>::getZeroElement();
00763                 }
00764                 break;
00765 
00766             case ' ' :
00767             case '\t':
00768             case '\n':
00769             case ',':
00770                 if(tokenC)
00771                 {
00772                     *tokenC = 0;
00773                     Self::_values[i++] =
00774                         TypeTraits<ValueTypeT>::getFromCString(token);
00775                     tokenC = 0;
00776                 }
00777                 break;
00778             default:
00779                 if(!tokenC)
00780                 {
00781                     tokenC = token;
00782                 }
00783                 *tokenC++ = *c;
00784                 break;
00785         }
00786     }
00787 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValueFromCString ( Char8 *  szString  )  [inline]

Definition at line 796 of file OSGVector.inl.

References OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValueFromCString().

00797 {
00798     setValueFromCString(static_cast<const Char8 *>(szString));
00799 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValue ( const Char8 *  szString  )  [inline]

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValue ( Char8 *  szString  )  [inline]

Definition at line 813 of file OSGVector.inl.

References OSG::PointInterface< ValueTypeT, StorageInterfaceT >::setValueFromCString().

00814 {
00815     setValueFromCString(szString);
00816 }

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

template<class ValueTypeT, class StorageInterfaceT>
const ValueTypeT * OSG::PointInterface< ValueTypeT, StorageInterfaceT >::getValues ( void   )  const [inline]

Definition at line 837 of file OSGVector.inl.

00838 {
00839     return Self::_values;
00840 }

template<class ValueTypeT, class StorageInterfaceT>
bool OSG::PointInterface< ValueTypeT, StorageInterfaceT >::isZero ( void   )  const [inline]

Definition at line 850 of file OSGVector.inl.

References OSG::Eps.

Referenced by OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::enclosedAngle(), OSG::Line::getClosestPoints(), and OSG::ProjectionCameraDecorator::updateData().

00851 {
00852     bool returnValue = true;
00853 
00854     for(UInt32 i = 0; i < Self::_uiSize; i++)
00855     {
00856         returnValue &= ((Self::_values[i] <=  Eps) &&
00857                         (Self::_values[i] >= -Eps));
00858     }
00859 
00860     return returnValue;
00861 }

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

Definition at line 867 of file OSGVector.inl.

00868 {
00869     for(UInt32 i = 0; i < Self::_uiSize; i++)
00870     {
00871         Self::_values[i] = -Self::_values[i];
00872     }
00873 }

template<class ValueTypeT, class StorageInterfaceT>
bool OSG::PointInterface< ValueTypeT, StorageInterfaceT >::equals ( const PointInterface< ValueTypeT, StorageInterfaceT > &  vec,
const ValueTypeT  tolerance 
) const [inline]

Definition at line 879 of file OSGVector.inl.

Referenced by OSG::VectorInterface< ValueTypeT, StorageInterfaceT >::operator==(), OSG::PointInterface< ValueTypeT, StorageInterfaceT >::operator==(), OSG::MaterialChunk::operator==(), and OSG::LightChunk::operator==().

00882 {
00883     bool returnValue = true;
00884 
00885     for(UInt32 i = 0; i < Self::_uiSize; i++)
00886     {
00887         returnValue &= 
00888             ( (Self::_values[i] - vec  ._values[i] <= tolerance) &&
00889               (vec  ._values[i] - Self::_values[i] <= tolerance));
00890     }
00891 
00892     return returnValue;
00893 }

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

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

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

Definition at line 926 of file OSGVector.inl.

References OSG::PointInterface< ValueTypeT, StorageInterfaceT >::dist2(), and OSG::osgSqrt().

00928 {
00929     return osgSqrt(dist2(vec));
00930 }

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

Definition at line 938 of file OSGVector.inl.

Referenced by OSG::PointInterface< ValueTypeT, StorageInterfaceT >::dist().

00940 {
00941     RealReturnType returnValue = 0;
00942     RealReturnType tmp;
00943 
00944     for(UInt32 i = 0; i < Self::_uiSize; i++)
00945     {
00946         tmp = Self::_values[i] - vec._values[i];
00947         
00948         returnValue += tmp * tmp;
00949     }
00950 
00951     return returnValue;
00952 }

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

Definition at line 960 of file OSGVector.inl.

Referenced by OSG::Billboard::adjustVolume().

00962 {
00963     RealReturnType returnValue = TypeTraits<RealReturnType>::getMin();
00964 
00965     for(UInt32 i = 0; i < Self::_uiSize; i++)
00966     {
00967         if(Self::_values[i] > returnValue)
00968             returnValue = Self::_values[i];
00969     }
00970 
00971     return returnValue;
00972 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::operator *= ( const ValueTypeT  val  )  [inline]

Definition at line 982 of file OSGVector.inl.

00983 {
00984     for(UInt32 i = 0; i < Self::_uiSize; i++)
00985     {
00986         Self::_values[i] *= val;
00987     }
00988 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::operator/= ( const ValueTypeT  val  )  [inline]

Definition at line 995 of file OSGVector.inl.

00996 {
00997     for(UInt32 i = 0; i < Self::_uiSize; i++)
00998     {
00999         Self::_values[i] /= val;
01000     }
01001 }

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

Definition at line 1009 of file OSGVector.inl.

01011 {
01012     VecInterface returnValue(*this);
01013 
01014     for(UInt32 i = 0; i < Self::_uiSize; i++)
01015     {
01016         returnValue[i] -= vec[i];
01017     }
01018 
01019     return returnValue;
01020 }

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

Definition at line 1027 of file OSGVector.inl.

01029 {
01030     PointInterface<ValueTypeT, StorageInterfaceT> returnValue;
01031 
01032     for(UInt32 i = 0; i < StorageInterfaceT::_uiSize; i++)
01033     {
01034         returnValue[i] = Self::_values[i] + vec[i];
01035     }
01036 
01037     return returnValue;
01038 }

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

Definition at line 1045 of file OSGVector.inl.

01047 {
01048     PointInterface<ValueTypeT, StorageInterfaceT> returnValue;
01049 
01050     for(UInt32 i = 0; i < StorageInterfaceT::_uiSize; i++)
01051     {
01052         returnValue[i] = Self::_values[i] - vec[i];
01053     }
01054 
01055     return returnValue;
01056 }

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

Reimplemented in OSG::VectorInterface< ValueTypeT, StorageInterfaceT >, OSG::VectorInterface< ValueTypeT, VecStorage3< ValueTypeT > >, and OSG::VectorInterface< ValueTypeT, VecStorage4< ValueTypeT > >.

Definition at line 1063 of file OSGVector.inl.

01065 {
01066     PointInterface<ValueTypeT, StorageInterfaceT> returnValue;
01067 
01068     for(UInt32 i = 0; i < StorageInterfaceT::_uiSize; i++)
01069     {
01070         returnValue[i] = Self::_values[i] * rVal;
01071     }
01072 
01073     return returnValue;
01074 }

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

Definition at line 1081 of file OSGVector.inl.

01082 {
01083     PointInterface<ValueTypeT, StorageInterfaceT> returnValue;
01084 
01085     for(UInt32 i = 0; i < Self::_uiSize; i++)
01086     {
01087         returnValue._values[i] = - Self::_values[i];
01088     }
01089 
01090     return returnValue;
01091 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::operator+= ( const VecInterface vec  )  [inline]

Definition at line 1097 of file OSGVector.inl.

01099 {
01100     for(UInt32 i = 0; i < Self::_uiSize; i++)
01101     {
01102         Self::_values[i] += vec._values[i];
01103     }
01104 }

template<class ValueTypeT, class StorageInterfaceT>
void OSG::PointInterface< ValueTypeT, StorageInterfaceT >::operator-= ( const VecInterface vec  )  [inline]

Definition at line 1110 of file OSGVector.inl.

01112 {
01113     for(UInt32 i = 0; i < Self::_uiSize; i++)
01114     {
01115         Self::_values[i] -= vec._values[i];
01116     }
01117 }

template<class ValueTypeT, class StorageInterfaceT>
ValueTypeT & OSG::PointInterface< ValueTypeT, StorageInterfaceT >::operator[] ( const UInt32  uiVal  )  [inline]

Definition at line 1125 of file OSGVector.inl.

01126 {
01127     return Self::_values[uiVal];
01128 }

template<class ValueTypeT, class StorageInterfaceT>
const ValueTypeT & OSG::PointInterface< ValueTypeT, StorageInterfaceT >::operator[] ( const UInt32  uiVal  )  const [inline]

Definition at line 1134 of file OSGVector.inl.

01135 {
01136     return Self::_values[uiVal];
01137 }

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

Definition at line 1163 of file OSGVector.inl.

01165 {
01166     if(this == &source)
01167         return *this;
01168 
01169     for(UInt32 i = 0; i < Self::_uiSize; i++)
01170     {
01171         Self::_values[i] = source._values[i];
01172     }
01173 
01174     return *this;
01175 }

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

Definition at line 1181 of file OSGVector.inl.

01182 {
01183     PointInterface<ValueTypeT, 
01184                    StorageInterfaceT>::error_cannot_assign_vector;
01185 
01186     return *this;
01187 }

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

Definition at line 1194 of file OSGVector.inl.

01196 {
01197     bool ret = false;
01198 
01199     for(UInt32 i = 0; i < Self::_uiSize; i++)
01200     {
01201         if(Self::_values[i] > other._values[i])
01202         {
01203             break;
01204         }
01205 
01206         if(Self::_values[i] < other._values[i])
01207         {
01208             ret = true;
01209             break;
01210         }
01211     }
01212 
01213     return ret;
01214 }

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

Definition at line 1220 of file OSGVector.inl.

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

01222 {
01223     return Self::equals(other, ValueTypeT(Eps));
01224 }

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

Definition at line 1230 of file OSGVector.inl.

01232 {
01233     return ! (*this == other);
01234 }