MPxComponentShape Class Reference
[OpenMaya - API module for common classesProxy classes]

#include <MPxComponentShape.h>

Inheritance diagram for MPxComponentShape:

Inheritance graph
[legend]
Collaboration diagram for MPxComponentShape:

Collaboration graph
[legend]

List of all members.


Detailed Description

Component helper class for surface shapes.

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.

Examples:

apiSimpleShape.h.


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
MVectorArraygetControlPoints ()
MStatus setControlPoints (MVectorArray *cps)

Member Function Documentation

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.

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

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

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

Parameters:
[in] mask the selection mask to test against
[in] componentList a list of components to be tested
Returns:
  • true the match was successfull
  • false the match failed

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.

Returns:
A component containing all of the vertices in the shape.

Reimplemented from MPxSurfaceShape.

MObject MPxComponentShape::localShapeInAttr (  )  const [virtual]

Returns the input attribute of the shape, which are the control points.

Returns:
The input attribute

Reimplemented from MPxSurfaceShape.

MVectorArray * MPxComponentShape::getControlPoints (  ) 

Extract the control points from the data block and store them locally.

Returns:
The contol points

MStatus MPxComponentShape::setControlPoints ( MVectorArray cps  ) 

Push the given control points into the node's data block

Parameters:
[in] cps the control points to use


Autodesk® Maya® 2010 © 1997-2009 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6