Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::PointInterface< ValueTypeT, StorageInterfaceT > Class Template Reference
[Objects]

#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 VectorT>
 PointInterface (const VectorT &vec)
 PointInterface (const PointInterface &source)
 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 VectorT>
void setValue (const VectorT &vec)
void setValue (const ValueTypeT *pVals)
 Set value from a given array, be sure to match sizes.
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 Math.

Definition at line 283 of file OSGVector.h.


Member Typedef Documentation

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

Reimplemented in osg::VectorInterface< ValueTypeT, StorageInterfaceT >, osg::VectorInterface< UInt16, VecStorage3 >, osg::VectorInterface< Real128, VecStorage2 >, osg::VectorInterface< UInt8, VecStorage2 >, osg::VectorInterface< Real64, VecStorage4 >, osg::VectorInterface< Real128, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage3 >, osg::VectorInterface< UInt16, VecStorage2 >, osg::VectorInterface< Real128, VecStorage4 >, osg::VectorInterface< Int16, VecStorage4 >, osg::VectorInterface< Real32, VecStorage3 >, osg::VectorInterface< Real32, VecStorage3< Real32 > >, osg::VectorInterface< Real32, VecStorage4< Real32 > >, osg::VectorInterface< Int16, VecStorage2 >, osg::VectorInterface< Real32, VecStorage2 >, osg::VectorInterface< Int8, VecStorage4 >, osg::VectorInterface< Int8, VecStorage3 >, osg::VectorInterface< Int16, VecStorage3 >, osg::VectorInterface< Real32, VecStorage2< Real32 > >, osg::VectorInterface< Int8, VecStorage2 >, osg::VectorInterface< Real32, VecStorage4 >, osg::VectorInterface< ValueTypeT, VecStorage3< ValueTypeT > >, osg::VectorInterface< ValueTypeT, VecStorage4< ValueTypeT > >, osg::VectorInterface< Real64, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage4 >, osg::VectorInterface< Real64, VecStorage2 >, and osg::VectorInterface< UInt16, VecStorage4 >.

Definition at line 289 of file OSGVector.h.

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

Reimplemented in osg::VectorInterface< ValueTypeT, StorageInterfaceT >, osg::VectorInterface< UInt16, VecStorage3 >, osg::VectorInterface< Real128, VecStorage2 >, osg::VectorInterface< UInt8, VecStorage2 >, osg::VectorInterface< Real64, VecStorage4 >, osg::VectorInterface< Real128, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage3 >, osg::VectorInterface< UInt16, VecStorage2 >, osg::VectorInterface< Real128, VecStorage4 >, osg::VectorInterface< Int16, VecStorage4 >, osg::VectorInterface< Real32, VecStorage3 >, osg::VectorInterface< Real32, VecStorage3< Real32 > >, osg::VectorInterface< Real32, VecStorage4< Real32 > >, osg::VectorInterface< Int16, VecStorage2 >, osg::VectorInterface< Real32, VecStorage2 >, osg::VectorInterface< Int8, VecStorage4 >, osg::VectorInterface< Int8, VecStorage3 >, osg::VectorInterface< Int16, VecStorage3 >, osg::VectorInterface< Real32, VecStorage2< Real32 > >, osg::VectorInterface< Int8, VecStorage2 >, osg::VectorInterface< Real32, VecStorage4 >, osg::VectorInterface< ValueTypeT, VecStorage3< ValueTypeT > >, osg::VectorInterface< ValueTypeT, VecStorage4< ValueTypeT > >, osg::VectorInterface< Real64, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage4 >, osg::VectorInterface< Real64, VecStorage2 >, and osg::VectorInterface< UInt16, VecStorage4 >.

Definition at line 291 of file OSGVector.h.

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

Reimplemented in osg::VectorInterface< ValueTypeT, StorageInterfaceT >, osg::VectorInterface< UInt16, VecStorage3 >, osg::VectorInterface< Real128, VecStorage2 >, osg::VectorInterface< UInt8, VecStorage2 >, osg::VectorInterface< Real64, VecStorage4 >, osg::VectorInterface< Real128, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage3 >, osg::VectorInterface< UInt16, VecStorage2 >, osg::VectorInterface< Real128, VecStorage4 >, osg::VectorInterface< Int16, VecStorage4 >, osg::VectorInterface< Real32, VecStorage3 >, osg::VectorInterface< Real32, VecStorage3< Real32 > >, osg::VectorInterface< Real32, VecStorage4< Real32 > >, osg::VectorInterface< Int16, VecStorage2 >, osg::VectorInterface< Real32, VecStorage2 >, osg::VectorInterface< Int8, VecStorage4 >, osg::VectorInterface< Int8, VecStorage3 >, osg::VectorInterface< Int16, VecStorage3 >, osg::VectorInterface< Real32, VecStorage2< Real32 > >, osg::VectorInterface< Int8, VecStorage2 >, osg::VectorInterface< Real32, VecStorage4 >, osg::VectorInterface< ValueTypeT, VecStorage3< ValueTypeT > >, osg::VectorInterface< ValueTypeT, VecStorage4< ValueTypeT > >, osg::VectorInterface< Real64, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage4 >, osg::VectorInterface< Real64, VecStorage2 >, and osg::VectorInterface< UInt16, VecStorage4 >.

Definition at line 293 of file OSGVector.h.

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

Definition at line 296 of file OSGVector.h.

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

Reimplemented in osg::VectorInterface< ValueTypeT, StorageInterfaceT >, osg::VectorInterface< UInt16, VecStorage3 >, osg::VectorInterface< Real128, VecStorage2 >, osg::VectorInterface< UInt8, VecStorage2 >, osg::VectorInterface< Real64, VecStorage4 >, osg::VectorInterface< Real128, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage3 >, osg::VectorInterface< UInt16, VecStorage2 >, osg::VectorInterface< Real128, VecStorage4 >, osg::VectorInterface< Int16, VecStorage4 >, osg::VectorInterface< Real32, VecStorage3 >, osg::VectorInterface< Real32, VecStorage3< Real32 > >, osg::VectorInterface< Real32, VecStorage4< Real32 > >, osg::VectorInterface< Int16, VecStorage2 >, osg::VectorInterface< Real32, VecStorage2 >, osg::VectorInterface< Int8, VecStorage4 >, osg::VectorInterface< Int8, VecStorage3 >, osg::VectorInterface< Int16, VecStorage3 >, osg::VectorInterface< Real32, VecStorage2< Real32 > >, osg::VectorInterface< Int8, VecStorage2 >, osg::VectorInterface< Real32, VecStorage4 >, osg::VectorInterface< ValueTypeT, VecStorage3< ValueTypeT > >, osg::VectorInterface< ValueTypeT, VecStorage4< ValueTypeT > >, osg::VectorInterface< Real64, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage4 >, osg::VectorInterface< Real64, VecStorage2 >, and osg::VectorInterface< UInt16, VecStorage4 >.

Definition at line 300 of file OSGVector.h.


Constructor & Destructor Documentation

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

Definition at line 309 of file OSGVector.inl.

00309                                                                   : 
00310     Inherited()
00311 {
00312 }

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

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

Definition at line 322 of file OSGVector.inl.

00322                                                                          : 
00323     Inherited()
00324 {
00325     if(pVals == NULL)
00326     {
00327         for(UInt32 i = 0; i < Self::_iSize; i++)
00328         {
00329             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00330         }
00331     }
00332     else
00333     {
00334         for(UInt32 i = 0; i < Self::_iSize; i++)
00335         {
00336             Self::_values[i] = pVals[i];
00337         }
00338     }
00339 }

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 349 of file OSGVector.inl.

00349                                                                    : 
00350     Inherited()
00351 {
00352     if(pVals == NULL)
00353     {
00354         for(UInt32 i = 0; i < Self::_iSize; i++)
00355         {
00356             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00357         }
00358     }
00359     else
00360     {
00361         for(UInt32 i = 0; i < Self::_iSize; i++)
00362         {
00363             Self::_values[i] = pVals[i];
00364         }
00365     }
00366 }

template<class ValueTypeT, class StorageInterfaceT>
template<class VectorT>
osg::PointInterface< ValueTypeT, StorageInterfaceT >::PointInterface const VectorT &  vec  )  [inline, explicit]
 

Definition at line 319 of file OSGVector.h.

00320     {
00321         if(Self::_iSize <= VectorT::_iSize)
00322         {
00323             for(UInt32 i = 0; i < Self::_iSize; i++)
00324             {
00325                 Self::_values[i] = vec.getValues()[i];
00326             }
00327         }
00328         else
00329         {
00330             UInt32 i;
00331             for(i = 0; i < VectorT::_iSize; i++)
00332             {
00333                 Self::_values[i] = vec.getValues()[i];
00334             }
00335             for(i = VectorT::_iSize; i < Self::_iSize; i++)
00336             {
00337                 Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00338             }
00339         }
00340     }

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

Definition at line 432 of file OSGVector.inl.

00433                                   : 
00434 
00435     Inherited()
00436 {
00437     for(UInt32 i = 0; i < Self::_iSize; i++)
00438     {
00439         Self::_values[i] = source._values[i];
00440     }
00441 }

template<class ValueTypeT, class StorageInterfaceT>
osg::PointInterface< ValueTypeT, StorageInterfaceT >::PointInterface const ValueTypeT  rVal1,
const ValueTypeT  rVal2
[inline]
 

Definition at line 471 of file OSGVector.inl.

00472                                                                           : 
00473     Inherited()
00474 {
00475     Self::_values[0] = rVal1;
00476 
00477     if(Self::_iSize == 2)
00478     {
00479         Self::_values[1] = rVal2;
00480     }
00481     else if(Self::_iSize >= 3)
00482     {
00483         Self::_values[1] = rVal2;
00484 
00485         for(UInt32 i = 2; i < Self::_iSize; i++)
00486         {
00487             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00488         }
00489     }
00490 }

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

Definition at line 503 of file OSGVector.inl.

00505                                                                           : 
00506     Inherited()
00507 {
00508     Self::_values[0] = rVal1;
00509 
00510     if(Self::_iSize == 2)
00511     {
00512         Self::_values[1] = rVal2;
00513     }
00514     else if(Self::_iSize == 3)
00515     {
00516         Self::_values[1] = rVal2;
00517         Self::_values[2] = rVal3;
00518     }
00519     else if(Self::_iSize >= 4)
00520     {
00521         Self::_values[1] = rVal2;
00522         Self::_values[2] = rVal3;
00523 
00524         for(UInt32 i = 3; i < Self::_iSize; i++)
00525         {
00526             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00527         }
00528     }
00529 }

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 542 of file OSGVector.inl.

00545                                                                           : 
00546     Inherited()
00547 {
00548     Self::_values[0] = rVal1;
00549 
00550     if(Self::_iSize == 2)
00551     {
00552         Self::_values[1] = rVal2;
00553     }
00554     else if(Self::_iSize == 3)
00555     {
00556         Self::_values[1] = rVal2;
00557         Self::_values[2] = rVal3;
00558     }
00559     else if(Self::_iSize == 4)
00560     {
00561         Self::_values[1] = rVal2;
00562         Self::_values[2] = rVal3;
00563         Self::_values[3] = rVal4;
00564     }
00565     else if(Self::_iSize >= 5)
00566     {
00567         Self::_values[1] = rVal2;
00568         Self::_values[2] = rVal3;
00569         Self::_values[3] = rVal4;
00570 
00571         for(UInt32 i = 4; i < Self::_iSize; i++)
00572         {
00573             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00574         }
00575     }
00576 }

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

Definition at line 587 of file OSGVector.inl.

00588 {
00589 }


Member Function Documentation

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

Definition at line 596 of file OSGVector.inl.

Referenced by osg::VectorInterface< ValueTypeT, StorageInterfaceT >::projectTo(), and osg::TransformationMatrix< ValueTypeT >::setIdentity().

00597 {
00598     for(UInt32 i = 0; i < Self::_iSize; i++)
00599     {
00600         Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00601     }
00602 }

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

Definition at line 619 of file OSGVector.inl.

Referenced by osg::Billboard::calcMatrix(), osg::calcVertexTangents(), osg::calcVertexTexCoords(), osg::DVRVolume::draw(), osg::makeSphereGeo(), osg::TransformationMatrix< ValueTypeT >::setTranslate(), osg::TransformationMatrix< ValueTypeT >::setValue(), and osg::TransformationMatrix< ValueTypeT >::TransformationMatrix().

00620 {
00621     for(UInt32 i = 0; i < Self::_iSize; i++)
00622     {
00623         Self::_values[i] = vec._values[i];
00624     }
00625 }

template<class ValueTypeT, class StorageInterfaceT>
template<class VectorT>
void osg::PointInterface< ValueTypeT, StorageInterfaceT >::setValue const VectorT &  vec  )  [inline]
 

Definition at line 393 of file OSGVector.h.

00394     {
00395         for(UInt32   i = 0;
00396                      i < (Self::_iSize < VectorT::_iSize ? 
00397                           Self::_iSize : VectorT::_iSize);
00398                    ++i)
00399         {
00400             Self::_values[i] = vec.getValues()[i];
00401         }
00402     }

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

Definition at line 680 of file OSGVector.inl.

00681 {
00682     for(UInt32 i = 0; i < Self::_iSize; i++)
00683     {
00684         Self::_values[i] = pVals[i];
00685     }
00686 }

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

Definition at line 693 of file OSGVector.inl.

00694 {
00695     setValue(static_cast<const ValueTypeT *>(pVals));
00696 }

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

Definition at line 705 of file OSGVector.inl.

Referenced by osg::FieldDataTraits< Pnt4ld >::getFromString(), osg::FieldDataTraits< Pnt3ld >::getFromString(), osg::FieldDataTraits< Pnt2ld >::getFromString(), osg::FieldDataTraits< Pnt4d >::getFromString(), osg::FieldDataTraits< Pnt3d >::getFromString(), osg::FieldDataTraits< Pnt2d >::getFromString(), osg::FieldDataTraits< Pnt4f >::getFromString(), osg::FieldDataTraits< Pnt3f >::getFromString(), osg::FieldDataTraits< Pnt2f >::getFromString(), osg::FieldDataTraits< Pnt4s >::getFromString(), osg::FieldDataTraits< Pnt3s >::getFromString(), osg::FieldDataTraits< Pnt2s >::getFromString(), osg::FieldDataTraits< Pnt4us >::getFromString(), osg::FieldDataTraits< Pnt3us >::getFromString(), osg::FieldDataTraits< Pnt2us >::getFromString(), osg::FieldDataTraits< Pnt4b >::getFromString(), osg::FieldDataTraits< Pnt3b >::getFromString(), osg::FieldDataTraits< Pnt2b >::getFromString(), osg::FieldDataTraits< Pnt4ub >::getFromString(), osg::FieldDataTraits< Pnt3ub >::getFromString(), osg::FieldDataTraits< Pnt2ub >::getFromString(), osg::FieldDataTraits< Vec4ld >::getFromString(), osg::FieldDataTraits< Vec3ld >::getFromString(), osg::FieldDataTraits< Vec2ld >::getFromString(), osg::FieldDataTraits< Vec4d >::getFromString(), osg::FieldDataTraits< Vec3d >::getFromString(), osg::FieldDataTraits< Vec2d >::getFromString(), osg::FieldDataTraits< Vec4f >::getFromString(), osg::FieldDataTraits< Vec3f >::getFromString(), osg::FieldDataTraits< Vec2f >::getFromString(), osg::FieldDataTraits< Vec4s >::getFromString(), osg::FieldDataTraits< Vec3s >::getFromString(), osg::FieldDataTraits< Vec2s >::getFromString(), osg::FieldDataTraits< Vec4us >::getFromString(), osg::FieldDataTraits< Vec3us >::getFromString(), osg::FieldDataTraits< Vec2us >::getFromString(), osg::FieldDataTraits< Vec4b >::getFromString(), osg::FieldDataTraits< Vec3b >::getFromString(), osg::FieldDataTraits< Vec2b >::getFromString(), osg::FieldDataTraits< Vec4ub >::getFromString(), osg::FieldDataTraits< Vec3ub >::getFromString(), osg::FieldDataTraits< Vec2ub >::getFromString(), osg::ClusterWindow::loadCalibration(), osg::Color4< ValueTypeT >::setValue(), and osg::Color3< ValueTypeT >::setValue().

00707 {
00708     UInt32 i;
00709     UInt32 numOfToken = Self::_iSize;
00710 
00711     Char8 *c      = const_cast<Char8 *>(szString);
00712     Char8 *tokenC = 0;
00713 
00714     Char8  token[256];
00715 
00716     if(szString == NULL || (*szString) == '\0')
00717     {
00718         for(i = 0; i < Self::_iSize; i++)
00719             Self::_values[i] = TypeTraits<ValueTypeT>::getZeroElement();
00720 
00721         return;
00722     }
00723 
00724     for (i = 0; i < numOfToken; c++)
00725     {
00726         switch (*c)
00727         {
00728             case '\0':
00729                 if(tokenC)
00730                 {
00731                     *tokenC = 0;
00732                     Self::_values[i++] =
00733                         TypeTraits<ValueTypeT>::getFromString(token);
00734                 }
00735 
00736                 while (i < numOfToken)
00737                 {
00738                     Self::_values[i++] =
00739                         TypeTraits<ValueTypeT>::getZeroElement();
00740                 }
00741                 break;
00742 
00743             case ' ' :
00744             case '\t':
00745             case '\n':
00746         case ',':
00747                 if(tokenC)
00748                 {
00749                     *tokenC = 0;
00750                     Self::_values[i++] =
00751                         TypeTraits<ValueTypeT>::getFromString(token);
00752                     tokenC = 0;
00753                 }
00754                 break;
00755             default:
00756                 if(!tokenC)
00757                 {
00758                     tokenC = token;
00759                 }
00760                 *tokenC++ = *c;
00761                 break;
00762         }
00763     }
00764 }

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

Definition at line 773 of file OSGVector.inl.

00774 {
00775     setValueFromCString(static_cast<const Char8 *>(szString));
00776 }

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

Definition at line 783 of file OSGVector.inl.

00784 {
00785     setValueFromCString(szString);
00786 }

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

Definition at line 791 of file OSGVector.inl.

00792 {
00793     setValueFromCString(szString);
00794 }

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

Definition at line 805 of file OSGVector.inl.

Referenced by changeGenFunc(), osg::DVRClipper::clipSlice(), GeoTraitRectangle::draw(), GeoTraitArrow::draw(), osg::SpotLight::drawEnter(), osg::PointLight::drawEnter(), osg::DirectionalLight::drawEnter(), osg::SkyBackground::drawFace(), osg::Slices::drawSlices(), osg::Window::frameInit(), osg::TransformationMatrix< ValueTypeT >::getValues(), osg::ProgramChunk::handleGL(), NormalTraitGeneric3f::normal(), NormalTraitGeneric::normal(), osg::FieldDataTraits< Pnt4ld >::putToString(), osg::FieldDataTraits< Pnt3ld >::putToString(), osg::FieldDataTraits< Pnt2ld >::putToString(), osg::FieldDataTraits< Pnt4d >::putToString(), osg::FieldDataTraits< Pnt3d >::putToString(), osg::FieldDataTraits< Pnt2d >::putToString(), osg::FieldDataTraits< Pnt4f >::putToString(), osg::FieldDataTraits< Pnt3f >::putToString(), osg::FieldDataTraits< Pnt2f >::putToString(), osg::FieldDataTraits< Pnt4s >::putToString(), osg::FieldDataTraits< Pnt3s >::putToString(), osg::FieldDataTraits< Pnt2s >::putToString(), osg::FieldDataTraits< Pnt4us >::putToString(), osg::FieldDataTraits< Pnt3us >::putToString(), osg::FieldDataTraits< Pnt2us >::putToString(), osg::FieldDataTraits< Pnt4b >::putToString(), osg::FieldDataTraits< Pnt3b >::putToString(), osg::FieldDataTraits< Pnt2b >::putToString(), osg::FieldDataTraits< Pnt4ub >::putToString(), osg::FieldDataTraits< Pnt3ub >::putToString(), osg::FieldDataTraits< Pnt2ub >::putToString(), osg::FieldDataTraits< Vec4ld >::putToString(), osg::FieldDataTraits< Vec3ld >::putToString(), osg::FieldDataTraits< Vec2ld >::putToString(), osg::FieldDataTraits< Vec4d >::putToString(), osg::FieldDataTraits< Vec3d >::putToString(), osg::FieldDataTraits< Vec2d >::putToString(), osg::FieldDataTraits< Vec4f >::putToString(), osg::FieldDataTraits< Vec3f >::putToString(), osg::FieldDataTraits< Vec2f >::putToString(), osg::FieldDataTraits< Vec4s >::putToString(), osg::FieldDataTraits< Vec3s >::putToString(), osg::FieldDataTraits< Vec2s >::putToString(), osg::FieldDataTraits< Vec4us >::putToString(), osg::FieldDataTraits< Vec3us >::putToString(), osg::FieldDataTraits< Vec2us >::putToString(), osg::FieldDataTraits< Vec4b >::putToString(), osg::FieldDataTraits< Vec3b >::putToString(), osg::FieldDataTraits< Vec2b >::putToString(), osg::FieldDataTraits< Vec4ub >::putToString(), osg::FieldDataTraits< Vec3ub >::putToString(), osg::FieldDataTraits< Vec2ub >::putToString(), osg::FieldDataTraits< Plane >::putToString(), osg::FieldDataTraits< DynamicVolume >::putToString(), osg::Brick::render3DSlices(), setGenFunc(), osg::SHLChunk::updateCameraPosition(), and PosTraitGeneric::vertex().

00806 {
00807     return Self::_values;
00808 }

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

Definition at line 815 of file OSGVector.inl.

00816 {
00817     return Self::_values;
00818 }

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

Definition at line 828 of file OSGVector.inl.

References osg::Eps.

Referenced by 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(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::enclosedAngle(), osg::Line::getClosestPoints(), and osg::ProjectionCameraDecorator::updateData().

00829 {
00830     bool returnValue = true;
00831 
00832     for(UInt32 i = 0; i < Self::_iSize; i++)
00833     {
00834         returnValue &= ((Self::_values[i] <=  Eps) &&
00835                         (Self::_values[i] >= -Eps));
00836     }
00837 
00838     return returnValue;
00839 }

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

Definition at line 845 of file OSGVector.inl.

Referenced by osg::Slices::adjustVolume(), osg::DVRClipGeometry::buildTriangledGeometry(), and osg::ExtrusionSurface::calcZAxes().

00846 {
00847     for(UInt32 i = 0; i < Self::_iSize; i++)
00848     {
00849         Self::_values[i] = -Self::_values[i];
00850     }
00851 }

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

Definition at line 857 of file OSGVector.inl.

Referenced by osg::TransformationMatrix< ValueTypeT >::equals(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::operator==(), osg::PointInterface< ValueTypeT, StorageInterfaceT >::operator==(), and osg::LightChunk::operator==().

00860 {
00861     bool returnValue = true;
00862 
00863     for(UInt32 i = 0; i < Self::_iSize; i++)
00864     {
00865         returnValue &= 
00866             ( (Self::_values[i] - vec  ._values[i] <= tolerance) &&
00867               (vec  ._values[i] - Self::_values[i] <= tolerance));
00868     }
00869 
00870     return returnValue;
00871 }

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

Reimplemented in osg::VectorInterface< ValueTypeT, StorageInterfaceT >, osg::VectorInterface< UInt16, VecStorage3 >, osg::VectorInterface< Real128, VecStorage2 >, osg::VectorInterface< UInt8, VecStorage2 >, osg::VectorInterface< Real64, VecStorage4 >, osg::VectorInterface< Real128, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage3 >, osg::VectorInterface< UInt16, VecStorage2 >, osg::VectorInterface< Real128, VecStorage4 >, osg::VectorInterface< Int16, VecStorage4 >, osg::VectorInterface< Real32, VecStorage3 >, osg::VectorInterface< Real32, VecStorage3< Real32 > >, osg::VectorInterface< Real32, VecStorage4< Real32 > >, osg::VectorInterface< Int16, VecStorage2 >, osg::VectorInterface< Real32, VecStorage2 >, osg::VectorInterface< Int8, VecStorage4 >, osg::VectorInterface< Int8, VecStorage3 >, osg::VectorInterface< Int16, VecStorage3 >, osg::VectorInterface< Real32, VecStorage2< Real32 > >, osg::VectorInterface< Int8, VecStorage2 >, osg::VectorInterface< Real32, VecStorage4 >, osg::VectorInterface< ValueTypeT, VecStorage3< ValueTypeT > >, osg::VectorInterface< ValueTypeT, VecStorage4< ValueTypeT > >, osg::VectorInterface< Real64, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage4 >, osg::VectorInterface< Real64, VecStorage2 >, and osg::VectorInterface< UInt16, VecStorage4 >.

Definition at line 880 of file OSGVector.inl.

Referenced by osg::FrustumVolume::getCenter(), osg::FrustumVolume::getScalarVolume(), and osg::DVRClipGeometry::interpolate().

00881 {
00882     return *(static_cast<VecInterface *>(this));
00883 }

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

Reimplemented in osg::VectorInterface< ValueTypeT, StorageInterfaceT >, osg::VectorInterface< UInt16, VecStorage3 >, osg::VectorInterface< Real128, VecStorage2 >, osg::VectorInterface< UInt8, VecStorage2 >, osg::VectorInterface< Real64, VecStorage4 >, osg::VectorInterface< Real128, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage3 >, osg::VectorInterface< UInt16, VecStorage2 >, osg::VectorInterface< Real128, VecStorage4 >, osg::VectorInterface< Int16, VecStorage4 >, osg::VectorInterface< Real32, VecStorage3 >, osg::VectorInterface< Real32, VecStorage3< Real32 > >, osg::VectorInterface< Real32, VecStorage4< Real32 > >, osg::VectorInterface< Int16, VecStorage2 >, osg::VectorInterface< Real32, VecStorage2 >, osg::VectorInterface< Int8, VecStorage4 >, osg::VectorInterface< Int8, VecStorage3 >, osg::VectorInterface< Int16, VecStorage3 >, osg::VectorInterface< Real32, VecStorage2< Real32 > >, osg::VectorInterface< Int8, VecStorage2 >, osg::VectorInterface< Real32, VecStorage4 >, osg::VectorInterface< ValueTypeT, VecStorage3< ValueTypeT > >, osg::VectorInterface< ValueTypeT, VecStorage4< ValueTypeT > >, osg::VectorInterface< Real64, VecStorage3 >, osg::VectorInterface< UInt8, VecStorage4 >, osg::VectorInterface< Real64, VecStorage2 >, and osg::VectorInterface< UInt16, VecStorage4 >.

Definition at line 892 of file OSGVector.inl.

00893 {
00894     return *(static_cast<const VecInterface *>(this));
00895 }

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

Definition at line 904 of file OSGVector.inl.

References osg::PointInterface< ValueTypeT, StorageInterfaceT >::dist2(), and osg::osgsqrt().

Referenced by osg::Surface::getDesiredError().

00906 {
00907     return osgsqrt(dist2(vec));
00908 }

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

Definition at line 916 of file OSGVector.inl.

Referenced by osg::Particles::calcIndex(), and osg::PointInterface< ValueTypeT, StorageInterfaceT >::dist().

00918 {
00919     RealReturnType returnValue = 0;
00920     RealReturnType tmp;
00921 
00922     for(