CrystalSpace

Public API Reference

CS::TriangleIndicesStream< T > Class Template Reference

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

#include <csgfx/trianglestream.h>

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 *index, const uint8 *indexEnd, size_t stride, csRenderBufferComponentType compType, csRenderMeshType meshtype)
 Begin triangulation of an index buffer.
bool HasNext () const
 Returns whether a triangle is available.
bool HasNextTri () const
TriangleT< T > Next ()
 Fetches the next triangle from the buffer.
bool NextTriangle (T &a, T &b, T &c)
 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.
 ~TriangleIndicesStream ()


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 38 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 118 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 127 of file trianglestream.h.

References CS::TriangleIndicesStream< T >::BeginTriangulate().


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.

Definition at line 181 of file trianglestream.h.

References CS::TriangleIndicesStream< T >::BeginTriangulate(), CS_BUF_LOCK_READ, iRenderBuffer::GetComponentType(), iRenderBuffer::GetElementCount(), iRenderBuffer::GetElementDistance(), and iRenderBuffer::Lock().

template<typename T>
void CS::TriangleIndicesStream< T >::BeginTriangulate ( const uint8 index,
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.

Definition at line 147 of file trianglestream.h.

References CS_MESHTYPE_TRIANGLEFAN, and CS_MESHTYPE_TRIANGLESTRIP.

Referenced by CS::TriangleIndicesStream< T >::BeginTriangulate(), and CS::TriangleIndicesStream< T >::TriangleIndicesStream().

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

Returns whether a triangle is available.

Definition at line 200 of file trianglestream.h.

Referenced by CS::TriangleIndicesStream< T >::HasNextTri().

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


The documentation for this class was generated from the following file:
Generated for Crystal Space 1.2.1 by doxygen 1.5.3