#include <VertexStorage.h>
Public Member Functions | |
bool | appendVertex (T vertex) |
bool | appendVertexIndices (int idx1, int idx2, int idx3) |
bool | appendVertexWithIndices (T vertex, int idx1, int idx2, int idx3) |
int | getIndexCount () |
int | getVertexCount () |
VertexStorage (int maxVertexCount, int maxIndexCount) | |
~VertexStorage () | |
Public Attributes | |
int * | indices |
const int | MAX_INDEX_COUNT |
const int | MAX_VERTEX_COUNT |
T * | vertices |
Private Attributes | |
int | nextIndex |
int | nextVertex |
This class is used to translate OpenInventor triangle models into ODE triangles.
T | type of the vertices to be stored |
Definition at line 73 of file VertexStorage.h.
VertexStorage< T >::VertexStorage | ( | int | maxVertexCount, | |
int | maxIndexCount | |||
) | [inline] |
Initialise the class with the number of verticis and indices it is going to hold. Additionally an array of size maxVertexCount and type T and an array of size maxIndexCount and type int are created.
T | type of the vertices to be stored |
maxVertexCount | maximal number of vertices the class is going to hold. | |
maxIndexCount | maximal number of indicees the class is going to hold. |
Definition at line 104 of file VertexStorage.h.
References VertexStorage< T >::indices, and VertexStorage< T >::vertices.
VertexStorage< T >::~VertexStorage | ( | ) | [inline] |
Delete both vertex and index array and their contents if they aren't NULL.
Definition at line 118 of file VertexStorage.h.
References VertexStorage< T >::indices, VertexStorage< T >::MAX_VERTEX_COUNT, and VertexStorage< T >::vertices.
bool VertexStorage< T >::appendVertex | ( | T | vertex | ) | [inline] |
Append a vertex after the last inserted vertex. Increments nextVertex by one.
vertex | the vertex to append to VertexStorage::vertices. |
vertex
was added. false if VertexStorage::vertices is full.
Definition at line 139 of file VertexStorage.h.
References VertexStorage< T >::MAX_VERTEX_COUNT, VertexStorage< T >::nextVertex, and VertexStorage< T >::vertices.
Referenced by VertexStorage< T >::appendVertexWithIndices(), and TriangleExtractor::getResult().
bool VertexStorage< T >::appendVertexIndices | ( | int | idx1, | |
int | idx2, | |||
int | idx3 | |||
) | [inline] |
Append the index numbers for the last inserted vertex. VertexStorage<T>::appendVertex() should be called before or you must be sure that the added indices match the vertices in the vertex array.
idx1 | first index of vertex | |
idx2 | second index of vertex | |
idx3 | third index of vertex |
false if the indices couldn't be inserted (VertexStorage::indices is full)
Definition at line 163 of file VertexStorage.h.
References VertexStorage< T >::indices, VertexStorage< T >::MAX_INDEX_COUNT, and VertexStorage< T >::nextIndex.
Referenced by VertexStorage< T >::appendVertexWithIndices(), and TriangleExtractor::getResult().
bool VertexStorage< T >::appendVertexWithIndices | ( | T | vertex, | |
int | idx1, | |||
int | idx2, | |||
int | idx3 | |||
) | [inline] |
Insert a vertex and the according indices.
Calls VertexStorage::appendVertex() and afterwards VertexStorage::appendVertexIndices(). If the indices could not be inserted the vertex gets "deleted" from VertexStorage::vertices by decrementing VertexStorage::nextVertex.
vertex | the vertex to append | |
idx1 | first index of vertex | |
idx2 | second index of vertex | |
idx3 | third index of vertex |
true if everything went fine.
Definition at line 188 of file VertexStorage.h.
References VertexStorage< T >::appendVertex(), VertexStorage< T >::appendVertexIndices(), and VertexStorage< T >::nextVertex.
VertexStorage< T >::getIndexCount | ( | ) |
VertexStorage< T >::getVertexCount | ( | ) |
VertexStorage< T >::indices |
The array of size VertexStorage::MAX_INDEX_COUNT where all indices get stored in.
Definition at line 86 of file VertexStorage.h.
Referenced by VertexStorage< T >::appendVertexIndices(), SoCollisionShapeTriMesh::cGeom(), VertexStorage< T >::VertexStorage(), and VertexStorage< T >::~VertexStorage().
VertexStorage< T >::MAX_INDEX_COUNT |
Maximum number of indices which can be stored by VertexStorage.
Definition at line 84 of file VertexStorage.h.
Referenced by VertexStorage< T >::appendVertexIndices(), and SoCollisionShapeTriMesh::cGeom().
VertexStorage< T >::MAX_VERTEX_COUNT |
Maximum number of vertices which can be stored by VertexStorage.
Definition at line 83 of file VertexStorage.h.
Referenced by VertexStorage< T >::appendVertex(), SoCollisionShapeTriMesh::cGeom(), and VertexStorage< T >::~VertexStorage().
VertexStorage< T >::nextIndex [private] |
The next free position in the index array (value is 0 upon creation).
Definition at line 89 of file VertexStorage.h.
Referenced by VertexStorage< T >::appendVertexIndices().
VertexStorage< T >::nextVertex [private] |
The index of the next free position in the vertex array (value is 0 upon creation).
Definition at line 88 of file VertexStorage.h.
Referenced by VertexStorage< T >::appendVertex(), and VertexStorage< T >::appendVertexWithIndices().
VertexStorage< T >::vertices |
The array of size VertexStorage::MAX_VERTEX_COUNT where all vertices get stored in.
Definition at line 85 of file VertexStorage.h.
Referenced by VertexStorage< T >::appendVertex(), SoCollisionShapeTriMesh::cGeom(), VertexStorage< T >::VertexStorage(), and VertexStorage< T >::~VertexStorage().
Generated on Sat Mar 10 20:00:21 2012 for IPSA by 1.5.8 |