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

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

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

#include <OSGVector.h>

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

Inheritance graph
[legend]
Collaboration diagram for osg::PointInterface< ValueTypeT, StorageInterfaceT >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef StorageInterfaceT Inherited
 Parent type.

typedef TypeConstants< 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

Public Methods

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)
 Constructor which take a lot of types as it's argument :-).

 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)
 Set function which take a lot of types as it's argument :-).

void setValue (const ValueTypeT *pVals)
 Set value from a given array, be sure to match sizes.

void setValue (const Char8 *szString)
 Extract values from given string, where both (const and not const) must be present, otherwise the compiler strikes back :-) (GV).

void setValue (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.

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 scalar multiplication.

void operator-= (const VecInterface &vec)
 Component wise scalar multiplication.

Element Access
ValueTypeT & operator[] (const UInt32 uiVal)
const ValueTypeT & operator[] (const UInt32 uiVal) const
Assignment
PointInterface & operator= (const PointInterface &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

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 Vector, Point and Matrix Design.


Member Typedef Documentation

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

Parent type.

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

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

Used type if the returnvalue must be a real value.

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

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

Value type.

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

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

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

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


Constructor & Destructor Documentation

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

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

Constructor which takes a const value array.

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

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

Constructor which takes a value array.

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

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

Constructor which take a lot of types as it's argument :-).

The argument type must provide a _iSize enum entry, a *getValueRef(void) function and the value types must be convertable to the current one. The main problem is that through the constructor VecBase(const ValueTypeT *pVals); and the following cast operator const ValueTypeT *(void); you are able to to the following :

       void foo(void)
       {
           ClassWithValueTypeT_*_Cast v2f;
           Vec4f v4f(v2f);
       }
This will at least give you some array read out of bounds erros; So this constructor make the things a little bit more save, but you will get nasty error messages from the compiler if the argument does not satisfy the requirements given above.

Thanks to that ****** MS Compiler the code must be included within the header file, but at least it seems work ;-) (GV)

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

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

Constructor which takes two values, remaining entries will be zero.

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

Constructor which takes three values, remaining entries will be zero.

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

Constructor which takes four values, remaining entries will be zero.

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


Member Function Documentation

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

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

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

Set function which take a lot of types as it's argument :-).

The argument type must provide a _iSize enum entry, a *getValues(void) function and the value types must be convertable to the current one. The main problem is that through the set function void setValue(const ValueTypeT *pVals); and the following cast operator const ValueTypeT *(void); you are able to to the following :

       void foo(void)
       {
           ClassWithValueTypeT_*_Cast v2f;
           Vec4f v4f;
     
           v4f.setValue(v2f);
       }
This will at least give you some array read out of bounds erros; So this function make the things a little bit more save, but you will get nasty error messages from the compiler if the argument does not satisfy the requirements given above.

Thanks to that ****** MS Compiler the code must be included within the header file, but at least it seems to work ;-) (GV)

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

Set value from a given array, be sure to match sizes.

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

Extract values from given string, where both (const and not const) must be present, otherwise the compiler strikes back :-) (GV).

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

Extract values from given string, where both (const and not const) must be present, otherwise the compiler strikes back :-) (GV).

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

Get a pointer to the value storage.

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

Get a const pointer to the value storage.

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

Returns true iff the norm of each value is less than Eps.

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

Negates each value of the point in place.

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

Returns true iff the two points are eual within a given tolerance.

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

Returns the corrosponding vector by subtracting zero.

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

Returns the corrosponding vector by subtracting zero.

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

Returns the distance between the two points.

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

Returns the distance between the two points, squared.

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

Returns the maximum value of the vector.

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

Component wise scalar multiplication.

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

Component wise scalar division.

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

Point substraction, returns a new vector.

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

Component wise binary vector addition operator.

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

Component wise binary vector addition operator.

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

Component wise binary scalar multiplication.

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

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

Nondestructive unary negation, returns new point.

template<class ValueTypeT, class StorageInterfaceT>
void osg::PointInterface< ValueTypeT, StorageInterfaceT >::operator+= const VecInterface   vec
 

Component wise scalar multiplication.

template<class ValueTypeT, class StorageInterfaceT>
void osg::PointInterface< ValueTypeT, StorageInterfaceT >::operator-= const VecInterface   vec
 

Component wise scalar multiplication.

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

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

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

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

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

Equal operator, using Eps as the tolerance.

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

Not equal operator, using Eps as the tolerance.


Member Data Documentation

template<class ValueTypeT, class StorageInterfaceT>
const PointInterface< ValueTypeT, StorageInterfaceT > osg::PointInterface< ValueTypeT, StorageInterfaceT >::Null [static]
 

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


The documentation for this class was generated from the following files:
Generated on Wed Jul 3 16:24:04 2002 for OpenSG by doxygen1.2.16