CrystalSpace

Public API Reference

CS::TriangleIndicesStream< T > Class Template Reference

Helper class to extract triangles from an index buffer. More...

#include <csgfx/trianglestream.h>

Inheritance diagram for CS::TriangleIndicesStream< T >:

List of all members.

Public Member Functions

void BeginTriangulate (iRenderBuffer *indices, csRenderMeshType meshtype, size_t indexStart=0, size_t indexEnd=(size_t)~0)
 Begin triangulation of an index buffer.
void BeginTriangulate (const uint8 *indexStart, const uint8 *indexEnd, size_t stride, csRenderBufferComponentType compType, csRenderMeshType meshtype)
 Begin triangulation of an index buffer.
size_t GetRemainingComponents () const
 Get the remaining components in the buffer.
bool HasNext () const
 Returns whether a triangle is available.
TriangleT< T > Next ()
 Fetches the next triangle from the buffer.
 TriangleIndicesStream (iRenderBuffer *indices, csRenderMeshType meshtype, size_t indexStart=0, size_t indexEnd=(size_t)~0)
 Construct triangle stream with an index buffer.
 TriangleIndicesStream ()
 Construct uninitialized triangle stream.

Protected Member Functions

GetIndex (size_t idx, const uint8 *index) const
 Get element idx, based on index.
GetNextIndex ()
 Fetch the next index from the index buffer.

Detailed Description

template<typename T>
class CS::TriangleIndicesStream< T >

Helper class to extract triangles from an index buffer.

Automatically handles tristrips, quads etc. as well.

Definition at line 48 of file trianglestream.h.


Constructor & Destructor Documentation

template<typename T>
CS::TriangleIndicesStream< T >::TriangleIndicesStream (  )  [inline]

Construct uninitialized triangle stream.

Remarks:
Don't forget to call BeginTriangulate() before using HasNext() or Next()!

Definition at line 130 of file trianglestream.h.

template<typename T>
CS::TriangleIndicesStream< T >::TriangleIndicesStream ( iRenderBuffer indices,
csRenderMeshType  meshtype,
size_t  indexStart = 0,
size_t  indexEnd = (size_t)~0 
) [inline]

Construct triangle stream with an index buffer.

Parameters:
indices Index buffer to triangulate.
meshtype Mesh type of the index data.
indexStart Element of the index buffer to start iterating at.
indexEnd Element of the index buffer to stop iterating at. (size_t)~0 means last element.

Definition at line 139 of file trianglestream.h.


Member Function Documentation

template<typename T>
void CS::TriangleIndicesStream< T >::BeginTriangulate ( iRenderBuffer indices,
csRenderMeshType  meshtype,
size_t  indexStart = 0,
size_t  indexEnd = (size_t)~0 
) [inline]

Begin triangulation of an index buffer.

Parameters:
indices Index buffer to triangulate.
meshtype Mesh type of the index data.
indexStart Element of the index buffer to start iterating at.
indexEnd Element of the index buffer to stop iterating at. (size_t)~0 means last element.

Reimplemented in CS::TriangleIndicesStreamRandom< T >.

Definition at line 193 of file trianglestream.h.

template<typename T>
void CS::TriangleIndicesStream< T >::BeginTriangulate ( const uint8 *  indexStart,
const uint8 *  indexEnd,
size_t  stride,
csRenderBufferComponentType  compType,
csRenderMeshType  meshtype 
) [inline]

Begin triangulation of an index buffer.

Parameters:
index Pointer to start of the indices.
indexEnd Pointer to end of the indices.
stride Distance between index elements in bytes.
compType Type of component contained in the data.
meshtype Mesh type of the index data.

Reimplemented in CS::TriangleIndicesStreamRandom< T >.

Definition at line 159 of file trianglestream.h.

template<typename T>
T CS::TriangleIndicesStream< T >::GetIndex ( size_t  idx,
const uint8 *  index 
) const [inline, protected]

Get element idx, based on index.

Definition at line 99 of file trianglestream.h.

template<typename T>
T CS::TriangleIndicesStream< T >::GetNextIndex (  )  [inline, protected]

Fetch the next index from the index buffer.

Definition at line 63 of file trianglestream.h.

template<typename T>
size_t CS::TriangleIndicesStream< T >::GetRemainingComponents (  )  const [inline]

Get the remaining components in the buffer.

Note that this number does't have to correspond with the remaining number of triangles, especially when dealing with strips or fans.

Definition at line 292 of file trianglestream.h.

template<typename T>
bool CS::TriangleIndicesStream< T >::HasNext (  )  const [inline]

Returns whether a triangle is available.

Reimplemented in CS::TriangleIndicesStreamRandom< T >.

Definition at line 212 of file trianglestream.h.

template<typename T>
TriangleT<T> CS::TriangleIndicesStream< T >::Next (  )  [inline]

Fetches the next triangle from the buffer.

Reimplemented in CS::TriangleIndicesStreamRandom< T >.

Definition at line 219 of file trianglestream.h.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1