csVertexListWalker< Tbase, Tcomplex > Class Template Reference
Helper class to make it easier to iterate over elements from renderbuffers, with automatic conversion to Tbase. More...
#include <csgfx/vertexlistwalker.h>
Public Member Functions | |
| csVertexListWalker (iRenderBuffer *buffer, size_t desiredComponents=0, const Tbase *defaultComponents=0) | |
| Construct new walker. | |
| size_t | GetSize () const |
| Get number of elements in the iterated buffer. | |
| void | ResetState () |
| Start from the beginning. | |
| void | SetElement (size_t newElement) |
| Set position to a specific element. | |
|
| |
| operator Tcomplex const & () const | |
| Get current element. | |
| const Tcomplex & | operator* () const |
| Get current element. | |
| csVertexListWalker & | operator++ () |
| Set current element to the next. | |
Detailed Description
template<typename Tbase, typename Tcomplex = Tbase[4]>
class csVertexListWalker< Tbase, Tcomplex >
Helper class to make it easier to iterate over elements from renderbuffers, with automatic conversion to Tbase.
Elements can also be queried as Tcomplex, which must consist of multiple Tbase and support left- and right-value operator[].
- Remarks:
- The element actually returned (converted or not) is stored in an array internal to the class. That has the consequence that for a queried element, you will only get what you expect as long as operator++() is not called. If you need to retain an element, you have to copy it! This also means you cannot really manipulate the buffer this way...
Definition at line 43 of file vertexlistwalker.h.
Constructor & Destructor Documentation
| csVertexListWalker< Tbase, Tcomplex >::csVertexListWalker | ( | iRenderBuffer * | buffer, | |
| size_t | desiredComponents = 0, |
|||
| const Tbase * | defaultComponents = 0 | |||
| ) | [inline] |
Construct new walker.
- Parameters:
-
buffer The render buffer to walk over. desiredComponents Number of components to fetch from the buffer. Those can differ from the real number; the components are filled up with default values, if necessary. If 0, the component count as set in the buffer will be returned. defaultComponents The default values for components, if more are requested than available. If 0, the values {0,0,0,1} are used.
Definition at line 56 of file vertexlistwalker.h.
Member Function Documentation
| size_t csVertexListWalker< Tbase, Tcomplex >::GetSize | ( | ) | const [inline] |
Get number of elements in the iterated buffer.
Definition at line 108 of file vertexlistwalker.h.
| csVertexListWalker< Tbase, Tcomplex >::operator Tcomplex const & | ( | ) | const [inline] |
Get current element.
Definition at line 78 of file vertexlistwalker.h.
| const Tcomplex& csVertexListWalker< Tbase, Tcomplex >::operator* | ( | ) | const [inline] |
Get current element.
Definition at line 83 of file vertexlistwalker.h.
| csVertexListWalker& csVertexListWalker< Tbase, Tcomplex >::operator++ | ( | ) | [inline] |
Set current element to the next.
Definition at line 92 of file vertexlistwalker.h.
| void csVertexListWalker< Tbase, Tcomplex >::ResetState | ( | ) | [inline] |
Start from the beginning.
Definition at line 101 of file vertexlistwalker.h.
| void csVertexListWalker< Tbase, Tcomplex >::SetElement | ( | size_t | newElement | ) | [inline] |
Set position to a specific element.
Definition at line 111 of file vertexlistwalker.h.
The documentation for this class was generated from the following file:
- csgfx/vertexlistwalker.h
Generated for Crystal Space 2.0 by doxygen 1.6.1
