MaterialX 1.38.7
No Matches
MeshStream Class Reference

Class to represent a mesh data stream. More...

#include <Mesh.h>

Public Member Functions

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

Static Public Member Functions

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

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 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.

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