#include
<MPxComponentShape.h>
MPxComponentShape allows the implementation of new user defined shapes using components. User defined shapes are dependency nodes (and DAG nodes) which contain overridable drawing, selection, and component methods. This class provides enhanced functionality for working with components. As a result, it is a better starting point than MPxSurfaceShape for writing surface shape components.
This class provides methods to manipulate and select the components that make up the shape.
The UI dependent aspects of the shape should be implemented in a class derived from MPxSurfaceShapeUI. This includes the drawing and interactive selection of the shape.
Public Member Functions |
|
virtual void | transformUsing (const MMatrix &matrix, const MObjectArray &componentList) |
virtual void | transformUsing (const MMatrix &mat, const MObjectArray &componentList, MPxSurfaceShape::MVertexCachingMode cachingMode, MPointArray *pointCache) |
virtual void | componentToPlugs (MObject &component, MSelectionList &list) const |
virtual bool | match (const MSelectionMask &mask, const MObjectArray &componentList) const |
virtual MObject | createFullVertexGroup () const |
virtual MObject | localShapeInAttr () const |
MVectorArray * | getControlPoints () |
MStatus | setControlPoints (MVectorArray *cps) |
void MPxComponentShape::transformUsing | ( | const MMatrix & | matrix, | |
const MObjectArray & | componentList | |||
) | [virtual] |
Transform the given components using the specified transformation matrix. This method should be overridden if the shape supports components that can be transformed using maya's move, scale, and rotate tools.
[in] | matrix | the matrix representing the transformation that is to be applied to the components |
[in] | componentList | a list of components to be tranformed |
Reimplemented from MPxSurfaceShape.
void MPxComponentShape::transformUsing | ( | const MMatrix & | mat, | |
const MObjectArray & | componentList, | |||
MPxSurfaceShape::MVertexCachingMode | cachingMode, | |||
MPointArray * | pointCache | |||
) | [virtual] |
Transform the given components using the specified transformation matrix. This method should be overridden if the shape supports components that can be transformed using maya's move, scale, and rotate tools.
[in] | mat | the matrix representing the transformation that is to be applied to the components |
[in] | componentList | a list of components to be tranformed. If the list is empty, it indicates that every point in the geometry should be transformed. |
[in] | cachingMode | whether the points should be cached in the pointCache argument, or restored from the pointCache. |
[in] | pointCache | used to store for undo and restore points during undo |
Reimplemented from MPxSurfaceShape.
void MPxComponentShape::componentToPlugs | ( | MObject & | component, | |
MSelectionList & | list | |||
) | const [virtual] |
Converts the given component into a selection list of plugs. This method is used to associate a shapes components into the corresponding attributes (plugs) within the shape.
[in] | component | the component to be converted |
[in] | list | a selection list where the plug should be added |
Reimplemented from MPxSurfaceShape.
bool MPxComponentShape::match | ( | const MSelectionMask & | mask, | |
const MObjectArray & | componentList | |||
) | const [virtual] |
This method is used to check for matches between a selection type (or mask) and a given component. This method is used to match up your components with selection masks.
This is used by sets and deformers to make sure that the selected components fall into the "vertex only" category. This is useful when you want to make sure that only a particular component can be deformed.
[in] | mask | the selection mask to test against |
[in] | componentList | a list of components to be tested |
Reimplemented from MPxSurfaceShape.
MObject MPxComponentShape::createFullVertexGroup | ( | ) | const [virtual] |
This method is used to create a component containing every vertex/CV in the object.
This method is supposed to return non-NULL only if the dag object contains vertices/CVs (control points), so derived classes that do should override this method.
Eg: use MFnSingleIndexedComponent::setCompleteData( numVertices ) to specify that a component represents all the vertices of the shape.
Reimplemented from MPxSurfaceShape.
MObject MPxComponentShape::localShapeInAttr | ( | ) | const [virtual] |
Returns the input attribute of the shape, which are the control points.
Reimplemented from MPxSurfaceShape.
MVectorArray * MPxComponentShape::getControlPoints | ( | ) |
Extract the control points from the data block and store them locally.
MStatus MPxComponentShape::setControlPoints | ( | MVectorArray * | cps | ) |
Push the given control points into the node's data block
[in] | cps | the control points to use |
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |