MIndexBufferDescriptor Class Reference

This reference page is linked to from the following overview topics: Autodesk Maya 2013, 2.2 Geometric Data (MGeometry), 4.3 Customizing Geometric Data for Shaders.



Detailed Description

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.

Examples:

cgfxShaderNode.cpp, and hwPhongShader.cpp.

#include <MHWGeometry.h>

List of all members.

Public Member Functions

 MIndexBufferDescriptor ()
 Constructor.
 MIndexBufferDescriptor (MIndexBufferDescriptor::IndexType type, const 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.

Constructor & Destructor Documentation

MIndexBufferDescriptor ( MIndexBufferDescriptor::IndexType  type,
const MString name,
MGeometry::Primitive  primitive,
unsigned int  primitiveStride = 0,
MObject  component = MObject::kNullObj,
MGeometry::DataType  dataType = MGeometry::kUnsignedInt32 
)

Constructor with arguments.

Parameters:
[in]typeThe indexing type describing what the buffer is used for.
[in]nameUsed to describe the type when the type argument is kCustom.
[in]primitiveA description of the input layout for each drawable.
[in]primitiveStrideThe number of control points per patch when the primitive type is kPatch.
[in]componentThe components to use when building the index buffer. If this is MObject::kNullObj the index buffer represents the whole object.
[in]dataTypeThe data type the buffer will hold.

Member Function Documentation

MString name ( ) const

Get the name used to describe the type when the type() returns kCustom.

Returns:
The name to use as the custom type.
void setName ( MString val)

Set the name used to describe the type when the type() is set to kCustom.

Parameters:
[in]valThe name to use as the custom type.
MIndexBufferDescriptor::IndexType indexType ( ) const

Get the indexing type describing what the buffer is used for.

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

Parameters:
[in]valThe indexing type describing what the buffer is used for.
MGeometry::Primitive primitive ( ) const

Get the primitive describing the input layout for each drawable.

Returns:
The primitive describing the input layout for each drawable.
void setPrimitive ( MGeometry::Primitive  val)

Set the primitive describing the input layout for each drawable.

Parameters:
[in]valThe primitive describing the input layout for each drawable.
unsigned int primitiveStride ( ) const

Get the number of points per primitive.

Returns:
The stride of the 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.

Parameters:
[in]strideThe 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); } }

Returns:
The component. If this returns MObject::kNullObj the index buffer represents the whole object.
void setComponent ( MObject  component)

Set the components to use when building the index buffer.

Parameters:
[in]componentThe 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.

Returns:
The type of data the buffer is to contain.
void dataType ( MGeometry::DataType  dataType)

Set the type of data expected to be in the index buffer.

Parameters:
[in]dataTypeThe type of data to fill the buffer with.

MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor
MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor MIndexBufferDescriptor