MPxToolCommand Class Reference
[OpenMayaUI - API module for user interfaceProxy classes]

#include <MPxToolCommand.h>

Inheritance diagram for MPxToolCommand:

Inheritance graph
[legend]
Collaboration diagram for MPxToolCommand:

Collaboration graph
[legend]

List of all members.


Detailed Description

Base class for interactive tool commands.

This is the base class for interactive tool commands.

An interactive tool command is a command that can be invoked as a MEL command or from within a user defined context (see MPxContext).

Tool commands have the same functionality as MPxCommands, but include several additional methods for use in interactive contexts: setUpInteractive, cancel, finalize, and doFinalize.

Examples:

helixTool.cpp, moveNumericTool.cpp, and moveTool.cpp.


Public Member Functions

 MPxToolCommand ()
virtual ~MPxToolCommand ()
virtual MStatus doIt (const MArgList &args)=0
virtual MStatus cancel ()
virtual MStatus finalize ()

Protected Member Functions

MStatus doFinalize (MArgList &command)
 USE _doFinalize() IN SCRIPT.

Constructor & Destructor Documentation

MPxToolCommand::MPxToolCommand (  ) 

Class constructor. This constructor should only be called from within a user context that uses this tool.

The context is responsible for setting up the internal state variables for the derived tools and for creating a command string for journalling.

MPxToolCommand::~MPxToolCommand (  )  [virtual]

Class Destructor. The user can override this method to free up any allocated data within the derived MPxToolCommand class.


Member Function Documentation

virtual MStatus MPxToolCommand::doIt ( const MArgList args  )  [pure virtual]

This method should perform a command by setting up internal class data and then calling the redoIt method. The actual action performed by the command should be done in the redoIt method. This is a pure virtual method, and must be overridden in derived classes.

Returns:
Status code
Status Codes:

Reimplemented from MPxCommand.

Examples:

MStatus MPxToolCommand::cancel (  )  [virtual]

This method cancels the command. The user should override this method when the original program state needs to be restored.

Returns:
Status code
Status Codes:

MStatus MPxToolCommand::finalize (  )  [virtual]

This method is used to create a string representing the command and its arguments. Users should override this method and contruct an MArgList and then pass it to doFinalize for journalling.

Returns:
Status code
Status Codes:
Examples:

MStatus MPxToolCommand::doFinalize ( MArgList command  )  [protected]

USE _doFinalize() IN SCRIPT.

Call this method with an MArgList representing your command. This method will register the command with the undo manager for journalling.

Parameters:
[in] command An MArgList reference representing an equivalent MEL command
Returns:
Status code
Status Codes:
Examples:


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