VTK
Public Member Functions | List of all members
vtkVector< T, Size > Class Template Reference

templated base type for storage of vectors. More...

#include <vtkVector.h>

Inheritance diagram for vtkVector< T, Size >:
[legend]

Public Member Functions

 vtkVector ()
 
 vtkVector (const T *init)
 
int GetSize () const
 
operator() (int i) const
 
T * GetData ()
 
const T * GetData () const
 
T & operator[] (int i)
 
const T & operator[] (int i) const
 
template<typename TR >
vtkVector< TR, Size > Cast () const
 

Protected Attributes

Data [Size]
 

Detailed Description

template<typename T, int Size>
class vtkVector< T, Size >

templated base type for storage of vectors.

This class is a templated data type for storing and manipulating fixed size vectors, which can be used to represent two and three dimensional points. The memory layout is a contiguous array of the specified type, such that a float[2] can be cast to a vtkVector2f and manipulated. Also a float[6] could be cast and used as a vtkVector2f[3].

Tests:
vtkVector (Tests)

Definition at line 34 of file vtkVector.h.

Constructor & Destructor Documentation

template<typename T, int Size>
vtkVector< T, Size >::vtkVector ( )
inline

Definition at line 37 of file vtkVector.h.

template<typename T, int Size>
vtkVector< T, Size >::vtkVector ( const T *  init)
inlineexplicit

Definition at line 45 of file vtkVector.h.

Member Function Documentation

template<typename T, int Size>
int vtkVector< T, Size >::GetSize ( ) const
inline

Get the size of the vtkVector.

Definition at line 54 of file vtkVector.h.

template<typename T, int Size>
T* vtkVector< T, Size >::GetData ( )
inline

Get a pointer to the underlying data of the vtkVector.

Definition at line 58 of file vtkVector.h.

template<typename T, int Size>
const T* vtkVector< T, Size >::GetData ( ) const
inline

Get a pointer to the underlying data of the vtkVector.

Definition at line 59 of file vtkVector.h.

template<typename T, int Size>
T& vtkVector< T, Size >::operator[] ( int  i)
inline

Get a reference to the underlying data element of the vtkVector. Can be used in much the same way as vector[i] is used.

Definition at line 65 of file vtkVector.h.

template<typename T, int Size>
const T& vtkVector< T, Size >::operator[] ( int  i) const
inline

Get a reference to the underlying data element of the vtkVector. Can be used in much the same way as vector[i] is used.

Definition at line 66 of file vtkVector.h.

template<typename T, int Size>
T vtkVector< T, Size >::operator() ( int  i) const
inline

Get the value of the vector at the index speciifed. Does bounds checking, used in much the same way as vector.at(i) is used.

Definition at line 71 of file vtkVector.h.

template<typename T, int Size>
template<typename TR >
vtkVector<TR, Size> vtkVector< T, Size >::Cast ( ) const
inline

Cast the vector to the specified type, returning the result.

Definition at line 76 of file vtkVector.h.

Member Data Documentation

template<typename T, int Size>
T vtkVector< T, Size >::Data[Size]
protected

The only thing stored in memory!

Definition at line 90 of file vtkVector.h.


The documentation for this class was generated from the following file: