C++ API Reference
MPxComponentConverter Class Referenceabstract

Base class for user defined component converter. More...

#include <MPxComponentConverter.h>

Public Member Functions

 MPxComponentConverter ()
 Construct a MPxComponentConverter.
 
virtual ~MPxComponentConverter ()
 Destructor.
 
virtual void initialize (const MRenderItem &renderItem)=0
 Maya calls this function to allow the converter to initialize itself for the selection on the given render item. More...
 
virtual void addIntersection (MIntersection &intersection)=0
 Maya calls this function for every selection hit on the render item. More...
 
virtual MObject component ()=0
 Once all of the geometry hits have been passed to the converter through calls to addIntersection(), Maya will call this method to retrieve the components corresponding to those hits. More...
 
virtual MSelectionMask selectionMask () const =0
 Maya calls this function to allow the converter to specify the type of components it can handle. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 

Detailed Description

Base class for user defined component converter.

Implementations of MPxComponentConverter must be registered with Maya through MDrawRegistry.

MPxComponentConverters are registered with a unique render item name. A registered MPxComponentConverter will be used to perform custom viewport 2.0 selection.

They are used to convert selection intersection data to a list of object components (MFnComponent), by matching the index buffer positions (MIntersection::index()) to valid component ids.

The same converter can be registered against different render item name, meaning that different render items can share the same component converter.

Examples:
apiMeshShape/apiMeshGeometryOverride.cpp, and apiMeshShape/apiMeshSubSceneOverride.cpp.

Member Function Documentation

void initialize ( const MRenderItem renderItem)
pure virtual

Maya calls this function to allow the converter to initialize itself for the selection on the given render item.

Parameters
[in]renderItemThe render item.
Examples:
apiMeshShape/apiMeshGeometryOverride.cpp.
void addIntersection ( MIntersection intersection)
pure virtual

Maya calls this function for every selection hit on the render item.

The intersection gives information on the component that was hit.

Parameters
[in]intersectionThe selection intersection.
Examples:
apiMeshShape/apiMeshGeometryOverride.cpp.
MObject component ( )
pure virtual

Once all of the geometry hits have been passed to the converter through calls to addIntersection(), Maya will call this method to retrieve the components corresponding to those hits.

Returns
The component selection.
Examples:
apiMeshShape/apiMeshGeometryOverride.cpp.
MSelectionMask selectionMask ( ) const
pure virtual

Maya calls this function to allow the converter to specify the type of components it can handle.

Returns
The selection mask.
Examples:
apiMeshShape/apiMeshGeometryOverride.cpp.
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.

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