#include <MPxManipContainer.h>
MPxManipContainer is the base class for user-defined container manipulators. This class is derived from MPxNode since manipulators in Maya are dependency nodes.
MPxManipContainer is a container manipulator that has at least one base manipulator. MPxManipContainer has methods for adding the following base manipulators types to the container: FreePointTriadManip, DirectionManip, DistanceManip, PointOnCurveManip, PointOnSurfaceManip, DiscManip, CircleSweepManip, ToggleManip, StateManip, and CurveSegmentManip.
A container manipulator has one converter which is the interface between the container's children manipulators and the node plugs they affect. The values on the converter that are related to children manipulators are called converterManipValues, and the values on the converter that are related to the node plugs are called converterPlugValues.
The conversion between converterManipValues and converterPlugValues are performed through conversion callback methods, except when there is a one-to-one connection between a converterManipValue and a converterPlugValue.
There are two kinds of conversion callback methods: manipToPlug and plugToManip. A plugToManipConversionCallback is used to calculate a converterManipValue from various converterPlugValues. This callback has access to all the converterPlugValues and returns the value of a converterManipValue. A manipToPlugConversionCallback is used to calculate a converterPlugValue from various converterManipValues. This callback has access to all the converterManipValues and returns the value of a converterPlugValue.
In order for an MPxManipContainer to be able to run, the manipulator needs to know that the initialization is finished through the finishAddingManips method.
Public Member Functions | |
MPxManipContainer () | |
virtual | ~MPxManipContainer () |
virtual MPxNode::Type | type () const |
virtual void | draw (M3dView &view, const MDagPath &path, M3dView::DisplayStyle style, M3dView::DisplayStatus status) |
virtual MStatus | connectToDependNode (const MObject &dependNode) |
virtual MStatus | createChildren () |
MDagPath | addFreePointTriadManip (const MString &manipName, const MString &pointName) |
MDagPath | addDirectionManip (const MString &manipName, const MString &directionName) |
MDagPath | addDistanceManip (const MString &manipName, const MString &distanceName) |
MDagPath | addPointOnCurveManip (const MString &manipName, const MString ¶mName) |
MDagPath | addPointOnSurfaceManip (const MString &manipName, const MString ¶mName) |
MDagPath | addDiscManip (const MString &manipName, const MString &angleName) |
MDagPath | addCircleSweepManip (const MString &manipName, const MString &angleName) |
MDagPath | addToggleManip (const MString &manipName, const MString &toggleName) |
MDagPath | addStateManip (const MString &manipName, const MString &stateName) |
MDagPath | addCurveSegmentManip (const MString &manipName, const MString &startParamName, const MString &endParamName) |
MDagPath | addRotateManip (const MString &manipName, const MString &rotationName) |
MDagPath | addScaleManip (const MString &manipName, const MString &scaleName) |
MStatus | addMPxManipulatorNode (const MString &manipTypeName, const MString &manipName, MPxManipulatorNode *&proxyManip) |
bool | isManipActive (const MFn::Type &manipType, MObject &manipObject) |
MStatus | finishAddingManips () |
virtual MManipData | plugToManipConversion (unsigned int manipIndex) |
virtual MManipData | manipToPlugConversion (unsigned int manipIndex) |
void | addPlugToManipConversion (unsigned int manipIndex) |
unsigned int | addManipToPlugConversion (MPlug &plug) |
void | addPlugToManipConversionCallback (unsigned int manipIndex, plugToManipConversionCallback callback) |
NO SCRIPT SUPPORT. | |
unsigned int | addManipToPlugConversionCallback (MPlug &plug, manipToPlugConversionCallback callback) |
NO SCRIPT SUPPORT. | |
MStatus | getConverterManipValue (unsigned int manipIndex, unsigned int &value) |
MStatus | getConverterManipValue (unsigned int manipIndex, double &value) |
MStatus | getConverterManipValue (unsigned int manipIndex, double &x, double &y) |
MStatus | getConverterManipValue (unsigned int manipIndex, MPoint &point) |
MStatus | getConverterManipValue (unsigned int manipIndex, MVector &vector) |
MStatus | getConverterManipValue (unsigned int manipIndex, MMatrix &matrix) |
MStatus | getConverterManipValue (unsigned int manipIndex, MEulerRotation &rotation) |
MStatus | getConverterManipValue (unsigned int manipIndex, MTransformationMatrix &xform) |
MStatus | getConverterPlugValue (unsigned int plugIndex, double &value) |
MStatus | getConverterPlugValue (unsigned int plugIndex, double &x, double &y) |
MStatus | getConverterPlugValue (unsigned int plugIndex, MPoint &point) |
MStatus | getConverterPlugValue (unsigned int plugIndex, MVector &vector) |
MStatus | getConverterPlugValue (unsigned int plugIndex, MMatrix &matrix) |
MStatus | getConverterPlugValue (unsigned int plugIndex, MEulerRotation &rotation) |
virtual MStatus | doPress () |
virtual MStatus | doDrag () |
virtual MStatus | doRelease () |
Static Public Member Functions | |
static MStatus | initialize () |
static MPxManipContainer * | newManipulator (const MString &manipName, MObject &manipObject, MStatus *ReturnStatus=NULL) |
static MStatus | addToManipConnectTable (MTypeId &) |
static MStatus | removeFromManipConnectTable (MTypeId &) |
Friends | |
class | MFnPlugin |
MPxManipContainer::MPxManipContainer | ( | ) |
Constructor.
MPxManipContainer::~MPxManipContainer | ( | ) | [virtual] |
Destructor.
MPxNode::Type MPxManipContainer::type | ( | ) | const [virtual] |
This method returns the type of the node.
Reimplemented from MPxNode.
MStatus MPxManipContainer::initialize | ( | ) | [static] |
This method initializes the manipulator, and should be overriden in user-defined manipulators.
MPxManipContainer * MPxManipContainer::newManipulator | ( | const MString & | manipName, | |
MObject & | manipObject, | |||
MStatus * | ReturnStatus = NULL | |||
) | [static] |
This static function is used to create a user-defined manipulator. The manipObject argument is set to the new manipulator node. Note that the manipName argument must be the name of a manipulator derived from MPxManipContainer. Also note that this method creates the newManipulator, but doesn't add it to the DAG. The primary use of this method is in conjunction with MPxSelectionContext::addManipulator, to add user-defined manipulators to a context.
[in] | manipName | manipulator name |
[in] | manipObject | manipulator object |
void MPxManipContainer::draw | ( | M3dView & | view, | |
const MDagPath & | path, | |||
M3dView::DisplayStyle | style, | |||
M3dView::DisplayStatus | status | |||
) | [virtual] |
This method can be overloaded to customize the drawing of the child manipulators. If the default draw is also required, this method should be called from the derived method.
[in] | view | the view in which to draw |
[in] | path | the current path |
[in] | style | the display appearance |
[in] | status | the display status |
This method connects the manipulator to the dependency node. This is a virtual method and needs to be overridden from the plug-in.
[in] | node | the node to which the manipulator should be connected |
MStatus MPxManipContainer::createChildren | ( | ) | [virtual] |
This method should be overridden in user defined manipulators. This method is called after the user node derived from MPxManipContainer is set up.
MDagPath MPxManipContainer::addFreePointTriadManip | ( | const MString & | manipName, | |
const MString & | pointName | |||
) |
This method creates a FreePointTriadManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | pointName | point name |
MDagPath MPxManipContainer::addDirectionManip | ( | const MString & | manipName, | |
const MString & | directionName | |||
) |
This method creates a DirectionManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | directionName | direction name |
MDagPath MPxManipContainer::addDistanceManip | ( | const MString & | manipName, | |
const MString & | distanceName | |||
) |
This method creates a DistanceManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | distanceName | distance name |
MDagPath MPxManipContainer::addPointOnCurveManip | ( | const MString & | manipName, | |
const MString & | paramName | |||
) |
This method creates a PointOnCurveManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | paramName | parameter name |
MDagPath MPxManipContainer::addPointOnSurfaceManip | ( | const MString & | manipName, | |
const MString & | paramName | |||
) |
This method creates a PointOnSurfaceManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | paramName | parameter name |
This method creates a DiscManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | angleName | angle name |
MDagPath MPxManipContainer::addCircleSweepManip | ( | const MString & | manipName, | |
const MString & | angleName | |||
) |
This method creates a CircleSweepManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | angleName | angle name |
MDagPath MPxManipContainer::addToggleManip | ( | const MString & | manipName, | |
const MString & | toggleName | |||
) |
This method creates a ToggleManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | toggleName | toggle name |
This method creates a StateManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | stateName | state name |
MDagPath MPxManipContainer::addCurveSegmentManip | ( | const MString & | manipName, | |
const MString & | startParamName, | |||
const MString & | endParamName | |||
) |
This method creates a CurveSegmentManip and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | startParamName | start parameter name |
[in] | endParamName | end parameter name |
MDagPath MPxManipContainer::addRotateManip | ( | const MString & | manipName, | |
const MString & | rotationName | |||
) |
This method creates a rotate manipulator and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | rotationName | name of the rotation vector |
This method creates a scale manipulator and adds it to the MPxManipContainer container.
[in] | manipName | manipulator name |
[in] | scaleName | name of the scale vector |
MStatus MPxManipContainer::addMPxManipulatorNode | ( | const MString & | manipTypeName, | |
const MString & | manipName, | |||
MPxManipulatorNode *& | proxyManip | |||
) |
This method creates a custom MPxManipulatorNode and adds it to the MPxManipContainer container.
[in] | manipTypeName | manipulator name |
[in] | manipName | name of the manip |
[out] | proxyManip | returns a pointer to the new manipulator |
This method determines if custom manip is active & gets the current manip object.
[in] | manipType | the type of the custom manip |
[in] | manipObject | manipulator object |
MStatus MPxManipContainer::finishAddingManips | ( | ) |
This method should be called from the user-defined manipulator plug-in near the end of the connectToDependNode method so that the converter in the manipulator can be initialized. The converter cannot be initialized until all the connections from the manip values to the plug values have been specified.
This method adds the user defined node as an entry in the manipConnectTable so that when this node is selected the user can use the show manip tool to get the user defined manipulator associated with this node. Note that the name of the manipulator node has to be the name of the plug-in node appended with "Manip".
[in] | mid | id of the user defined node |
This method removes the user defined node entry from the manipConnectTable.
[in] | id | id of the user defined node |
MManipData MPxManipContainer::plugToManipConversion | ( | unsigned int | manipIndex | ) | [virtual] |
This virtual method works in conjunction with the addPlugToManipConversion() method. If addPlugToManipConversion() is called successfully, then this method or handler will be invoked to handle the conversion.
Implement this method to handle the the plug to manipulator conversions.
[in] | manipIndex | the index of the manipulator component that is being converted. For example scaleCenterIndex of the MFnScaleManip function set. |
MManipData MPxManipContainer::manipToPlugConversion | ( | unsigned int | manipIndex | ) | [virtual] |
This virtual method works in conjunction with the addManipToPlugConversion() method. If addManipToPlugConversion() is called successfully, then this method or handler will be invoked to handle the conversion.
Implement this method to handle the the plug to manipulator conversions.
[in] | manipIndex | the index of the plug to be converted. |
void MPxManipContainer::addPlugToManipConversion | ( | unsigned int | manipIndex | ) |
This method adds a plug to manipulator converter. The converter must be implemented in the plugToManipConversion() virtual method of this class.
NOTE: The conversion methods and callback methods of this class should not be mixed. The conversion methods are: addManipToPlugConversion(), addManipToPlugConversion() The callback methods are: addPlugToManipConversionCallback() addManipToPlugConversionCallback()
[in] | manipIndex | the index of the manipulator component that will be converted |
unsigned int MPxManipContainer::addManipToPlugConversion | ( | MPlug & | plug | ) |
This method adds a manipulator to plug converter. The converter must be implemented in the manipToPlugConversion() virtual method of this class.
NOTE: The conversion methods and callback methods of this class should not be mixed. The conversion methods are: addManipToPlugConversion(), addManipToPlugConversion() The callback methods are: addPlugToManipConversionCallback() addManipToPlugConversionCallback()
[in] | plug | the plug that is to be converted |
void MPxManipContainer::addPlugToManipConversionCallback | ( | unsigned int | manipIndex, | |
plugToManipConversionCallback | callback | |||
) |
NO SCRIPT SUPPORT.
This method adds a callback that calculates a converterManipValue from converterPlugValues. The callback accesses converterPlugValues and returns the value of a converterManipValue.
NOTE: The conversion methods and callback methods of this class should not be mixed. The conversion methods are: addManipToPlugConversion(), addManipToPlugConversion() The callback methods are: addPlugToManipConversionCallback() addManipToPlugConversionCallback()
[in] | manipIndex | the index of the converterManipValue for which the callback will be registered |
[in] | callback | the callback that calculates a converterManipValue at the specified index from converterPlugValues |
unsigned int MPxManipContainer::addManipToPlugConversionCallback | ( | MPlug & | plug, | |
manipToPlugConversionCallback | callback | |||
) |
NO SCRIPT SUPPORT.
This method adds a callback that calculates a converterPlugValue from converterManipValues. The callback accesses converterManipValues and returns the value of a converterPlugValue.
NOTE: The conversion methods and callback methods of this class should not be mixed. The conversion methods are: addManipToPlugConversion(), addManipToPlugConversion() The callback methods are: addPlugToManipConversionCallback() addManipToPlugConversionCallback()
[in] | plug | the plug for which the callback will be registered |
[in] | callback | the callback that calculates a converterPlugValue for the specified plug from converterManipValues |
MStatus MPxManipContainer::getConverterManipValue | ( | unsigned int | manipIndex, | |
unsigned int & | value | |||
) |
This method retrieves the value of a converterManipValue of type unsigned int at a given index from the converter.
[in] | manipIndex | the index of the converterManipValue |
[out] | value | the value at the specified index |
MStatus MPxManipContainer::getConverterManipValue | ( | unsigned int | manipIndex, | |
double & | value | |||
) |
This method retrieves the value of a converterManipValue of type double at a given index from the converter.
[in] | manipIndex | the index of the converterManipValue |
[out] | value | the value at the specified index |
MStatus MPxManipContainer::getConverterManipValue | ( | unsigned int | manipIndex, | |
double & | x, | |||
double & | y | |||
) |
This method retrieves the x and y values of a converterManipValue of type double at a given index from the converter.
[in] | manipIndex | the index of the converterManipValue |
[out] | x | the x value at the specified index |
[out] | y | the y value at the specified index |
This method retrieves the value of a converterManipValue of type MPoint at a given index from the converter.
[in] | manipIndex | the index of the converterManipValue |
[out] | point | the value at the specified index |
This method retrieves the value of a converterManipValue of type MVector at a given index from the converter.
[in] | manipIndex | the index of the converterManipValue |
[out] | vector | the value at the specified index |
This method retrieves the value of a converterManipValue of type MMatrix at a given index from the converter.
[in] | manipIndex | the index of the converterManipValue |
[out] | matrix | the value at the specified index |
MStatus MPxManipContainer::getConverterManipValue | ( | unsigned int | manipIndex, | |
MEulerRotation & | rotation | |||
) |
This method retrieves the value of a converterManipValue of type MEulerRotation at a given index from the converter.
[in] | manipIndex | the index of the converterManipValue |
[out] | rotation | the value at the specified index |
MStatus MPxManipContainer::getConverterManipValue | ( | unsigned int | manipIndex, | |
MTransformationMatrix & | xform | |||
) |
This method retrieves the value of a converterManipValue of type MTransformationMatrix at a given index from the converter.
[in] | manipIndex | the index of the converterManipValue |
[out] | xform | the value at the specified index |
MStatus MPxManipContainer::getConverterPlugValue | ( | unsigned int | plugIndex, | |
double & | value | |||
) |
This method retrieves the value of a converterPlugValue of type double at a given index from the converter.
[in] | plugIndex | the index of the converterPlugValue |
[out] | value | the value at the specified index |
MStatus MPxManipContainer::getConverterPlugValue | ( | unsigned int | plugIndex, | |
double & | x, | |||
double & | y | |||
) |
This method retrieves the x and y values of a converterPlugValue of type double at a given index from the converter.
[in] | plugIndex | the index of the converterPlugValue |
[out] | x | the x value at the specified index |
[out] | y | the y value at the specified index |
This method retrieves the value of a converterPlugValue of type MPoint at a given index from the converter.
[in] | plugIndex | the index of the converterPlugValue |
[out] | point | the value at the specified index |
This method retrieves the value of a converterPlugValue of type MVector at a given index from the converter.
[in] | plugIndex | the index of the converterPlugValue |
[out] | vector | the value at the specified index |
This method retrieves the value of a converterPlugValue of type MMatrix at a given index from the converter.
[in] | plugIndex | the index of the converterPlugValue |
[out] | matrix | the value at the specified index |
MStatus MPxManipContainer::getConverterPlugValue | ( | unsigned int | plugIndex, | |
MEulerRotation & | rotation | |||
) |
This method retrieves the value of a converterPlugValue of type MEulerRotation at a given index from the converter.
[in] | plugIndex | the index of the converterPlugValue |
[out] | rotation | the value at the specified index |
MStatus MPxManipContainer::doPress | ( | ) | [virtual] |
This method gets called when the manipulator recieves a mouse down event.
You should return kUnknownParameter to specify that maya should handle this connection or if you want maya to process the connection as well.
MStatus MPxManipContainer::doDrag | ( | ) | [virtual] |
This method gets called when the manipulator recieves a mouse drag event.
You should return kUnknownParameter to specify that maya should handle this connection or if you want maya to process the connection as well.
MStatus MPxManipContainer::doRelease | ( | ) | [virtual] |
This method gets called when the manipulator recieves a mouse release event.
You should return kUnknownParameter to specify that maya should handle this connection or if you want maya to process the connection as well.
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |