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

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

Vector 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::VectorInterface< ValueTypeT, StorageInterfaceT >:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef PointInterface< ValueTypeT,
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 Inherited PntInterface
typedef VectorInterface< ValueTypeT,
StorageInterfaceT > 
Self

Public Methods

Constructors
 VectorInterface (void)
 VectorInterface (const ValueTypeT *pVals)
 Constructor which takes a const value array.

 VectorInterface (ValueTypeT *pVals)
 Constructor which takes a const value array.

template<class VectorT>  VectorInterface (const VectorT &vec)
 Constructor which take a lot of types as it's argument :-).

 VectorInterface (const VectorInterface &source)
 VectorInterface (const ValueTypeT rVal1, const ValueTypeT rVal2)
 VectorInterface (const ValueTypeT rVal1, const ValueTypeT rVal2, const ValueTypeT rVal3)
 VectorInterface (const ValueTypeT rVal1, const ValueTypeT rVal2, const ValueTypeT rVal3, const ValueTypeT rVal4)
Destructor
 ~VectorInterface (void)
Common Math
RealReturnType length (void) const
 Euclidean length of the vector.

void normalize (void)
 Changes vector to be of unit length.

VectorInterface cross (const VectorInterface &vec) const
 Returns the right handed cross-product for a given vector; This function is implemented for size 3 vectors only.

VectorInterface operator% (const VectorInterface &vec) const
 Euclidean length of the vector.

void crossThis (const VectorInterface &vec)
 Calculates the right handed cross-product with a given vector; This function is implemented for size 3 vectors only.

ValueTypeT dot (const VectorInterface &vec) const
 Return the dot (inner) product for a given vector.

ValueTypeT operator * (const VectorInterface &vec) const
 Euclidean length of the vector.

ValueTypeT dot (const PntInterface &pnt) const
 Euclidean length of the vector.

ValueTypeT operator * (const PntInterface &pnt) const
 Euclidean length of the vector.

RealReturnType enclosedAngle (const VectorInterface &vec) const
 Returns the angle between this and another vector.

RealReturnType projectTo (const VectorInterface &toVec)
 Euclidean length of the vector.

Math
VectorInterface operator- (const VectorInterface &vec) const
 Component wise binary vector subtraction operator.

VectorInterface operator+ (const VectorInterface &vec) const
 Component wise binary vector addition operator.

VectorInterface operator * (const ValueTypeT rVal) const
 Component wise binary scalar multiplication.

VectorInterface operator- (void) const
 Nondestructive unary negation, returns new vector.

Assignment
VectorInterface & operator= (const VectorInterface &source)
Comparison
bool operator< (const VectorInterface &other) const
bool operator== (const VectorInterface &other) const
 Equal operator, using Eps as the tolerance.

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


Static Public Attributes

const VectorInterface Null

Detailed Description

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

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


Member Typedef Documentation

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

Parent type.

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

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

Used type if the returnvalue must be a real value.

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

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

Value type.

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

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

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

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


Constructor & Destructor Documentation

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

template<class ValueTypeT, class StorageInterfaceT>
osg::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface 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::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface 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>
template<class VectorT>
osg::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface 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::VectorInterface< ValueTypeT, StorageInterfaceT >::VectorInterface const VectorInterface< ValueTypeT, StorageInterfaceT > &    source [inline]
 

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

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

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

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


Member Function Documentation

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

Euclidean length of the vector.

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

Changes vector to be of unit length.

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

Returns the right handed cross-product for a given vector; This function is implemented for size 3 vectors only.

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

Euclidean length of the vector.

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

Calculates the right handed cross-product with a given vector; This function is implemented for size 3 vectors only.

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

Return the dot (inner) product for a given vector.

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

Euclidean length of the vector.

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

Euclidean length of the vector.

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

Euclidean length of the vector.

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

Returns the angle between this and another vector.

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

Euclidean length of the vector.

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

Component wise binary vector subtraction operator.

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

Component wise binary vector addition operator.

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

Component wise binary scalar multiplication.

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

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

Nondestructive unary negation, returns new vector.

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

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

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

Equal operator, using Eps as the tolerance.

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

Not eual operator, using Eps as the tolerance.


Member Data Documentation

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

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


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