#include <VecBase.h>
Inheritance diagram for gmtl::VecBase:
Public Types | |
typedef DATA_TYPE | DataType |
The datatype used for the components of this VecBase. More... | |
enum | Params { Size = SIZE } |
The number of components this VecBase has. More... | |
Public Methods | |
VecBase () | |
Default constructor. More... | |
VecBase (const VecBase< DATA_TYPE, SIZE > &rVec) | |
Makes an exact copy of the given VecBase object. More... | |
void | set (const DATA_TYPE *dataPtr) |
Sets the components in this VecBase using the given array. More... | |
VecBase (const DATA_TYPE &val0, const DATA_TYPE &val1) | |
Creates a new VecBase initialized to the given values. More... | |
VecBase (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2) | |
Creates a new VecBase initialized to the given values. More... | |
VecBase (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2, const DATA_TYPE &val3) | |
Creates a new VecBase initialized to the given values. More... | |
void | set (const DATA_TYPE &val0) |
Sets the components in this VecBase to the given values. More... | |
void | set (const DATA_TYPE &val0, const DATA_TYPE &val1) |
Sets the components in this VecBase to the given values. More... | |
void | set (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2) |
Sets the components in this VecBase to the given values. More... | |
void | set (const DATA_TYPE &val0, const DATA_TYPE &val1, const DATA_TYPE &val2, const DATA_TYPE &val3) |
Sets the components in this VecBase to the given values. More... | |
DATA_TYPE & | operator[] (const unsigned i) |
Gets the ith component in this VecBase. More... | |
const DATA_TYPE & | operator[] (const unsigned i) const |
Gets the ith component in this VecBase. More... | |
DATA_TYPE * | getData () |
Gets the internal array of the components. More... | |
const DATA_TYPE * | getData () const |
Gets the internal array of the components. More... | |
Public Attributes | |
DATA_TYPE | mData [SIZE] |
The array of components. More... |
It is templated on the component datatype as well as the number of components that make it up.
DATA_TYPE | the datatype to use for the components |
SIZE | the number of components this VecBase has |
Definition at line 52 of file VecBase.h.
|
The datatype used for the components of this VecBase.
Reimplemented in gmtl::Point. |
|
The number of components this VecBase has.
Reimplemented in gmtl::Point. Definition at line 59 of file VecBase.h.
00059 { Size = SIZE }; |
|
Default constructor. Does nothing, leaves data alone. This is for performance because this constructor is called by derived class constructors Even when they just want to set the data directly Definition at line 68 of file VecBase.h.
00068 {} |
|
Makes an exact copy of the given VecBase object.
Definition at line 144 of file VecBase.h. References mData.
00145 { 00146 for(unsigned i=0;i<SIZE;++i) 00147 mData[i] = rVec.mData[i]; 00148 } |
|
Creates a new VecBase initialized to the given values.
Definition at line 151 of file VecBase.h. References gmtlASSERT, and mData.
00152 { 00153 // @todo need compile time assert 00154 gmtlASSERT( SIZE == 2 && "out of bounds element access in VecBase" ); 00155 mData[0] = val0; 00156 mData[1] = val1; 00157 } |
|
Creates a new VecBase initialized to the given values.
Definition at line 160 of file VecBase.h. References gmtlASSERT, and mData.
00161 { 00162 // @todo need compile time assert 00163 gmtlASSERT( SIZE == 3 && "out of bounds element access in VecBase" ); 00164 mData[0] = val0; 00165 mData[1] = val1; 00166 mData[2] = val2; 00167 } |
|
Creates a new VecBase initialized to the given values.
Definition at line 170 of file VecBase.h. References gmtlASSERT, and mData.
00171 { 00172 // @todo need compile time assert 00173 gmtlASSERT( SIZE == 4 && "out of bounds element access in VecBase" ); 00174 mData[0] = val0; 00175 mData[1] = val1; 00176 mData[2] = val2; 00177 mData[3] = val3; 00178 } |
|
Gets the internal array of the components.
Definition at line 133 of file VecBase.h.
00134 { return mData; } |
|
Gets the internal array of the components.
Definition at line 131 of file VecBase.h.
00132 { return mData; } |
|
Gets the ith component in this VecBase.
Definition at line 118 of file VecBase.h.
00119 { 00120 gmtlASSERT(i < SIZE); 00121 return mData[i]; 00122 } |
|
Gets the ith component in this VecBase.
Definition at line 113 of file VecBase.h.
00114 { 00115 gmtlASSERT(i < SIZE); 00116 return mData[i]; 00117 } |
|
Sets the components in this VecBase to the given values.
Reimplemented in gmtl::AxisAngle. Definition at line 210 of file VecBase.h. References gmtlASSERT, and mData.
00211 { 00212 gmtlASSERT( SIZE >= 4 && "out of bounds element access in VecBase" ); 00213 mData[0] = val0; 00214 mData[1] = val1; 00215 mData[2] = val2; 00216 mData[3] = val3; 00217 } |
|
Sets the components in this VecBase to the given values.
Definition at line 202 of file VecBase.h. References gmtlASSERT, and mData.
00203 { 00204 gmtlASSERT( SIZE >= 3 && "out of bounds element access in VecBase" ); 00205 mData[0] = val0; 00206 mData[1] = val1; 00207 mData[2] = val2; 00208 } |
|
Sets the components in this VecBase to the given values.
Definition at line 195 of file VecBase.h. References gmtlASSERT, and mData.
00196 { 00197 gmtlASSERT( SIZE >= 2 && "out of bounds element access in VecBase" ); 00198 mData[0] = val0; 00199 mData[1] = val1; 00200 } |
|
Sets the components in this VecBase to the given values.
Definition at line 189 of file VecBase.h. References gmtlASSERT, and mData.
00190 { 00191 gmtlASSERT( SIZE >= 1 && "out of bounds element access in VecBase" ); 00192 mData[0] = val0; 00193 } |
|
Sets the components in this VecBase using the given array.
Definition at line 183 of file VecBase.h. References mData.
00184 { 00185 for(unsigned i=0;i<SIZE;++i) 00186 mData[i] = dataPtr[i]; 00187 } |
|
The array of components.
Definition at line 139 of file VecBase.h. Referenced by gmtl::VecBase< DATA_TYPE, 4 >::getData, gmtl::VecBase< DATA_TYPE, 4 >::operator[], gmtl::Point< DATA_TYPE, 3 >::Point, set, gmtl::Vec< DATA_TYPE, 4 >::Vec, and VecBase. |