HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MeshStream Class Reference

#include <Mesh.h>

Public Member Functions

 MeshStream (const string &name, const string &type, unsigned int index)
 
 ~MeshStream ()
 
void reserve (size_t elementCount)
 Reserve memory for a given number of elements. More...
 
void resize (size_t elementCount)
 Resize data to an given number of elements. More...
 
const stringgetName () const
 Get stream name. More...
 
const stringgetType () const
 Get stream attribute name. More...
 
unsigned int getIndex () const
 Get stream index. More...
 
MeshFloatBuffergetData ()
 Return the raw float vector. More...
 
const MeshFloatBuffergetData () const
 Return the raw float vector. More...
 
template<class T >
TgetElement (size_t index)
 
template<class T >
const TgetElement (size_t index) const
 
unsigned int getStride () const
 Get stride between elements. More...
 
void setStride (unsigned int stride)
 Set stride between elements. More...
 
size_t getSize () const
 Get the number of elements. More...
 
void transform (const Matrix44 &matrix)
 Transform elements by a matrix. More...
 

Static Public Member Functions

static MeshStreamPtr create (const string &name, const string &type, unsigned int index=0)
 Create a new mesh stream. More...
 

Static Public Attributes

static const string POSITION_ATTRIBUTE
 
static const string NORMAL_ATTRIBUTE
 
static const string TEXCOORD_ATTRIBUTE
 
static const string TANGENT_ATTRIBUTE
 
static const string BITANGENT_ATTRIBUTE
 
static const string COLOR_ATTRIBUTE
 
static const string GEOMETRY_PROPERTY_ATTRIBUTE
 
static const unsigned int STRIDE_2D = 2
 
static const unsigned int STRIDE_3D = 3
 
static const unsigned int STRIDE_4D = 4
 
static const unsigned int DEFAULT_STRIDE = STRIDE_3D
 

Protected Attributes

string _name
 
string _type
 
unsigned int _index
 
MeshFloatBuffer _data
 
unsigned int _stride
 

Detailed Description

Class to represent a mesh data stream

Definition at line 30 of file Mesh.h.

Constructor & Destructor Documentation

MeshStream::MeshStream ( const string name,
const string type,
unsigned int  index 
)
inline

Definition at line 47 of file Mesh.h.

MeshStream::~MeshStream ( )
inline

Definition at line 54 of file Mesh.h.

Member Function Documentation

static MeshStreamPtr MeshStream::create ( const string name,
const string type,
unsigned int  index = 0 
)
inlinestatic

Create a new mesh stream.

Definition at line 57 of file Mesh.h.

MeshFloatBuffer& MeshStream::getData ( )
inline

Return the raw float vector.

Definition at line 93 of file Mesh.h.

const MeshFloatBuffer& MeshStream::getData ( ) const
inline

Return the raw float vector.

Definition at line 99 of file Mesh.h.

template<class T >
T& MeshStream::getElement ( size_t  index)
inline

Definition at line 105 of file Mesh.h.

template<class T >
const T& MeshStream::getElement ( size_t  index) const
inline

Definition at line 111 of file Mesh.h.

unsigned int MeshStream::getIndex ( ) const
inline

Get stream index.

Definition at line 87 of file Mesh.h.

const string& MeshStream::getName ( ) const
inline

Get stream name.

Definition at line 75 of file Mesh.h.

size_t MeshStream::getSize ( ) const
inline

Get the number of elements.

Definition at line 129 of file Mesh.h.

unsigned int MeshStream::getStride ( ) const
inline

Get stride between elements.

Definition at line 117 of file Mesh.h.

const string& MeshStream::getType ( ) const
inline

Get stream attribute name.

Definition at line 81 of file Mesh.h.

void MeshStream::reserve ( size_t  elementCount)
inline

Reserve memory for a given number of elements.

Definition at line 63 of file Mesh.h.

void MeshStream::resize ( size_t  elementCount)
inline

Resize data to an given number of elements.

Definition at line 69 of file Mesh.h.

void MeshStream::setStride ( unsigned int  stride)
inline

Set stride between elements.

Definition at line 123 of file Mesh.h.

void MeshStream::transform ( const Matrix44 matrix)

Transform elements by a matrix.

Member Data Documentation

MeshFloatBuffer MeshStream::_data
protected

Definition at line 141 of file Mesh.h.

unsigned int MeshStream::_index
protected

Definition at line 140 of file Mesh.h.

string MeshStream::_name
protected

Definition at line 138 of file Mesh.h.

unsigned int MeshStream::_stride
protected

Definition at line 142 of file Mesh.h.

string MeshStream::_type
protected

Definition at line 139 of file Mesh.h.

const string MeshStream::BITANGENT_ATTRIBUTE
static

Definition at line 37 of file Mesh.h.

const string MeshStream::COLOR_ATTRIBUTE
static

Definition at line 38 of file Mesh.h.

const unsigned int MeshStream::DEFAULT_STRIDE = STRIDE_3D
static

Definition at line 44 of file Mesh.h.

const string MeshStream::GEOMETRY_PROPERTY_ATTRIBUTE
static

Definition at line 39 of file Mesh.h.

const string MeshStream::NORMAL_ATTRIBUTE
static

Definition at line 34 of file Mesh.h.

const string MeshStream::POSITION_ATTRIBUTE
static

Definition at line 33 of file Mesh.h.

const unsigned int MeshStream::STRIDE_2D = 2
static

Definition at line 41 of file Mesh.h.

const unsigned int MeshStream::STRIDE_3D = 3
static

Definition at line 42 of file Mesh.h.

const unsigned int MeshStream::STRIDE_4D = 4
static

Definition at line 43 of file Mesh.h.

const string MeshStream::TANGENT_ATTRIBUTE
static

Definition at line 36 of file Mesh.h.

const string MeshStream::TEXCOORD_ATTRIBUTE
static

Definition at line 35 of file Mesh.h.


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