CS::TriangleIndicesStreamRandom< T > Class Template Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
CS::TriangleIndicesStreamRandom< T > Class Template Reference

Extracts triangles like TriangleIndicesStream, but also provides random access to individual triangles and can be resetted. More...

`#include <csgfx/trianglestream.h>`

Inheritance diagram for CS::TriangleIndicesStreamRandom< T >:

List of all members.

## Public Member Functions
void | BeginTriangulate (const uint8 *indexStart, const uint8 *indexEnd, size_t stride, csRenderBufferComponentType compType, csRenderMeshType meshtype)
| Begin triangulation of an index buffer.
void | BeginTriangulate (iRenderBuffer *indices, csRenderMeshType meshtype, size_t indexStart=0, size_t indexEnd=(size_t)~0)
| Begin triangulation of an index buffer.
bool | HasNext () const
| Returns whether a triangle is available.
TriangleT< T > | Next ()
| Fetches the next triangle from the buffer.
TriangleT< T > | operator[] (size_t index)
| Get a specific triangle.
void | Reset ()
| Reset the stream to the start.
| TriangleIndicesStreamRandom ()
| Construct uninitialized triangle stream.
| TriangleIndicesStreamRandom (iRenderBuffer *indices, csRenderMeshType meshtype, size_t indexStart=0, size_t indexEnd=(size_t)~0)
| Construct triangle stream with an index buffer.

## Detailed Description

### template<typename T>
class CS::TriangleIndicesStreamRandom< T >

Extracts triangles like TriangleIndicesStream, but also provides random access to individual triangles and can be resetted.

Remarks:
  There is a slight overhead due to the housekeeping required for the random access. Hence for pure triangle streaming the "plain" TriangleIndicesStream is more appropriate.

Definition at line 320 of file trianglestream.h.

## Constructor & Destructor Documentation

template<typename T >

CS::TriangleIndicesStreamRandom< T >::TriangleIndicesStreamRandom | ( |  | ) | `[inline]`

Construct uninitialized triangle stream.

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

Definition at line 421 of file trianglestream.h.

template<typename T >

CS::TriangleIndicesStreamRandom< T >::TriangleIndicesStreamRandom | ( | 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 430 of file trianglestream.h.

## Member Function Documentation

template<typename T >

void CS::TriangleIndicesStreamRandom< 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 from CS::TriangleIndicesStream< T >.

Definition at line 450 of file trianglestream.h.

template<typename T >

void CS::TriangleIndicesStreamRandom< 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 from CS::TriangleIndicesStream< T >.

Definition at line 468 of file trianglestream.h.

template<typename T >

bool CS::TriangleIndicesStreamRandom< T >::HasNext | ( |  | ) | const`[inline]`

Returns whether a triangle is available.

Reimplemented from CS::TriangleIndicesStream< T >.

Definition at line 488 of file trianglestream.h.

template<typename T >

TriangleT<T> CS::TriangleIndicesStreamRandom< T >::Next | ( |  | ) | `[inline]`

Fetches the next triangle from the buffer.

Reimplemented from CS::TriangleIndicesStream< T >.

Definition at line 494 of file trianglestream.h.

template<typename T >

TriangleT<T> CS::TriangleIndicesStreamRandom< T >::operator[] | ( | size_t | index | ) | `[inline]`

Get a specific triangle.

Definition at line 501 of file trianglestream.h.

template<typename T >

void CS::TriangleIndicesStreamRandom< T >::Reset | ( |  | ) | `[inline]`

Reset the stream to the start.

Definition at line 480 of file trianglestream.h.

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

- csgfx/trianglestream.h