C++ API Reference
MIndexBufferDescriptor Class Reference

MIndexBufferDescriptor describes an indexing scheme. More...

#include <MHWGeometry.h>

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. More...
 
 ~MIndexBufferDescriptor ()
 Destructor.
 
MString name () const
 Get the name used to describe the type when the type() returns kCustom. More...
 
void setName (MString &val)
 Set the name used to describe the type when the type() is set to kCustom. More...
 
MIndexBufferDescriptor::IndexType indexType () const
 Get the indexing type describing what the buffer is used for. More...
 
void setIndexType (MIndexBufferDescriptor::IndexType val)
 Set the indexing type describing what the buffer is used for. More...
 
MGeometry::Primitive primitive () const
 Get the primitive describing the input layout for each drawable. More...
 
void setPrimitive (MGeometry::Primitive val)
 Set the primitive describing the input layout for each drawable. More...
 
unsigned int primitiveStride () const
 Get the number of points per primitive. More...
 
void setPrimitiveStride (unsigned int id)
 Set the number of control points used for patch primitives. More...
 
MObject component () const
 Get the components associated with the index buffer. More...
 
void setComponent (MObject component)
 Set the components to use when building the index buffer. More...
 
MGeometry::DataType dataType () const
 Get the type of data expected to be in the index buffer. More...
 
void dataType (MGeometry::DataType dataType)
 Set the type of data expected to be in the index buffer. More...
 

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:
cgFx/cgfxShaderNode.cpp, dx11Shader/dx11Shader.cpp, dx11Shader/dx11ShaderOverride.cpp, geometryReplicator/geometryReplicator.cpp, glslShader/GLSLShaderOverride.cpp, gpuCache/CacheWriter.cpp, and hwPhongShader/hwPhongShader.cpp.

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.

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