#include <OSGVector.h>
Inheritance diagram for osg::PointInterface< ValueTypeT, StorageInterfaceT >:

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. | |
| VecInterface & | subZero (void) |
| Returns the corrosponding vector by subtracting zero. | |
| const VecInterface & | subZero (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 | |
| *PointInterface & | operator= (const PointInterface &source) |
| PointInterface & | operator= (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 |
Definition at line 283 of file OSGVector.h.
|
|||||
|
|||||
|
|||||
|
|||||
|
Definition at line 296 of file OSGVector.h. |
|
|||||
|
||||||||||
|
Definition at line 309 of file OSGVector.inl. 00309 : 00310 Inherited() 00311 { 00312 }
|
|
||||||||||
|
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 }
|
|
||||||||||
|
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 }
|
|
||||||||||||||
|
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 }
|
|
||||||||||
|
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 }
|
|
||||||||||||||||
|
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 }
|
|
||||||||||||||||||||
|
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 }
|
|
||||||||||||||||||||||||
|
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 }
|
|
||||||||||
|
Definition at line 587 of file OSGVector.inl.
|
|
||||||||||
|
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 }
|
|
||||||||||
|
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 }
|
|
||||||||||||||
|
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 }
|
|
||||||||||
|
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 }
|
|
||||||||||
|
Definition at line 693 of file OSGVector.inl. 00694 { 00695 setValue(static_cast<const ValueTypeT *>(pVals)); 00696 }
|
|
||||||||||
|
||||||||||
|
Definition at line 773 of file OSGVector.inl. 00774 { 00775 setValueFromCString(static_cast<const Char8 *>(szString)); 00776 }
|
|
||||||||||
|
Definition at line 783 of file OSGVector.inl. 00784 { 00785 setValueFromCString(szString); 00786 }
|
|
||||||||||
|
Definition at line 791 of file OSGVector.inl. 00792 { 00793 setValueFromCString(szString); 00794 }
|
|
||||||||||
|
||||||||||
|
Definition at line 815 of file OSGVector.inl.
|
|
||||||||||
|
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 }
|
|
||||||||||
|
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 }
|
|
||||||||||||||||
|
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 }
|
|
||||||||||
|
||||||||||
|
||||||||||
|
Definition at line 904 of file OSGVector.inl. References osg::PointInterface< ValueTypeT, StorageInterfaceT >::dist2(), and osg::osgsqrt(). Referenced by osg::Surface::getDesiredError().
|
|
||||||||||
|
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( |