#include <vtkVector.h>
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].
Definition at line 34 of file vtkVector.h.
Public Member Functions | |
vtkVector () | |
vtkVector (const T *init) | |
int | GetSize () const |
T | 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 | |
T | Data [Size] |
Definition at line 37 of file vtkVector.h.
vtkVector< T, Size >::vtkVector | ( | const T * | init | ) | [inline, explicit] |
Definition at line 45 of file vtkVector.h.
int vtkVector< T, Size >::GetSize | ( | ) | const [inline] |
Get the size of the vtkVector.
Definition at line 54 of file vtkVector.h.
T* vtkVector< T, Size >::GetData | ( | ) | [inline] |
Get a pointer to the underlying data of the vtkVector.
Definition at line 58 of file vtkVector.h.
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.
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.
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.
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.
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.
The only thing stored in memory!
Definition at line 90 of file vtkVector.h.