MIndexBufferDescriptor describes an indexing scheme.
This class represents a description of an indexing scheme. It provides the indexing type (including custom named types), primitive type, primitive stride (for use with patch primitives), and component information.
#include <MHWGeometry.h>
Public Member Functions | |
MIndexBufferDescriptor () | |
Constructor. | |
MIndexBufferDescriptor (MIndexBufferDescriptor::IndexType type, MString &name, MGeometry::Primitive primitive, unsigned int primitiveStride=0, MObject component=MObject::kNullObj, MGeometry::DataType dataType=MGeometry::kUnsignedInt32) | |
Constructor with arguments. | |
~MIndexBufferDescriptor () | |
Destructor. | |
MString | name () const |
Get the name used to describe the type when the type() returns kCustom. | |
void | setName (MString &val) |
Set the name used to describe the type when the type() is set to kCustom. | |
MIndexBufferDescriptor::IndexType | indexType () const |
Get the indexing type describing what the buffer is used for. | |
void | setIndexType (MIndexBufferDescriptor::IndexType val) |
Set the indexing type describing what the buffer is used for. | |
MGeometry::Primitive | primitive () const |
Get the primitive describing the input layout for each drawable. | |
void | setPrimitive (MGeometry::Primitive val) |
Set the primitive describing the input layout for each drawable. | |
unsigned int | primitiveStride () const |
Get the number of points per primitive. | |
void | setPrimitiveStride (unsigned int id) |
Set the number of control points used for patch primitives. | |
MObject | component () const |
Get the components associated with the index buffer. | |
void | setComponent (MObject component) |
Set the components to use when building the index buffer. | |
MGeometry::DataType | dataType () const |
Get the type of data expected to be in the index buffer. | |
void | dataType (MGeometry::DataType dataType) |
Set the type of data expected to be in the index buffer. |
MIndexBufferDescriptor | ( | MIndexBufferDescriptor::IndexType | type, |
MString & | name, | ||
MGeometry::Primitive | primitive, | ||
unsigned int | primitiveStride = 0 , |
||
MObject | component = MObject::kNullObj , |
||
MGeometry::DataType | dataType = MGeometry::kUnsignedInt32 |
||
) |
Constructor with arguments.
[in] | type | The indexing type describing what the buffer is used for. |
[in] | name | Used to describe the type when the type argument is kCustom. |
[in] | primitive | A description of the input layout for each drawable. |
[in] | primitiveStride | The number of control points per patch when the primitive type is kPatch. |
[in] | component | The components to use when building the index buffer. If this is MObject::kNullObj the index buffer represents the whole object. |
[in] | dataType | The data type the buffer will hold. |
MString name | ( | ) | const |
Get the name used to describe the type when the type() returns kCustom.
void setName | ( | MString & | val | ) |
Set the name used to describe the type when the type() is set to kCustom.
[in] | val | The name to use as the custom type. |
MIndexBufferDescriptor::IndexType indexType | ( | ) | const |
Get the indexing type describing what the buffer is used for.
void setIndexType | ( | MIndexBufferDescriptor::IndexType | val | ) |
Set the indexing type describing what the buffer is used for.
[in] | val | The indexing type describing what the buffer is used for. |
MGeometry::Primitive primitive | ( | ) | const |
Get the primitive describing the input layout for each drawable.
void setPrimitive | ( | MGeometry::Primitive | val | ) |
Set the primitive describing the input layout for each drawable.
[in] | val | The primitive describing the input layout for each drawable. |
unsigned int primitiveStride | ( | ) | const |
Get the number of points per primitive.
void setPrimitiveStride | ( | unsigned int | stride | ) |
Set the number of control points used for patch primitives.
Setting this value is only meaningful when primitive() is set to kPatch.
[in] | stride | The stride of the patch primitive; |
MObject component | ( | ) | const |
Get the components associated with the index buffer.
Note that only one type of component (edge, face, etc) can be associated with a given index buffer.
if ( component.hasFn(MFn::kSingleIndexedComponent) ) { MFnSingleIndexedComponent fnVtxComp( component ); int len = fnVtxComp.elementCount(); for ( int i = 0; i < len; i++ ) { int idx = fnVtxComp.element(i); } }
void setComponent | ( | MObject | component | ) |
Set the components to use when building the index buffer.
[in] | component | The component. If this is MObject::kNullObj the index buffer represents the whole object. |
MGeometry::DataType dataType | ( | ) | const |
Get the type of data expected to be in the index buffer.
void dataType | ( | MGeometry::DataType | dataType | ) |
Set the type of data expected to be in the index buffer.
[in] | dataType | The type of data to fill the buffer with. |