class MPxToolCommand

Jump to documentation

: public MPxCommand Base class for interactive tool commands (OpenMayaUI) (OpenMayaMPx.py)

Inheritance:

MPxToolCommand < MPxCommand

public members:

MPxToolCommand ()
virtual ~MPxToolCommand ()
virtual MStatus cancel ()
virtual MStatus finalize ()

protected members:

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

Inherited from MPxCommand:

public members:

virtual MStatus doIt ( const MArgList & args )
virtual MStatus undoIt ( )
virtual MStatus redoIt ( )
virtual bool isUndoable () const
virtual bool hasSyntax () const
MSyntax syntax () const
bool isHistoryOn () const
MString commandString () const
MStatus setHistoryOn ( bool state )
MStatus setCommandString ( const MString & )
static void displayInfo ( const MString & theInfo )
static void displayWarning ( const MString & theWarning )
static void displayError ( const MString & theError )
static void displayWarning ( const MString & theWarning, bool wantDisplayLineNumber )
static void displayError ( const MString & theError, bool wantDisplayLineNumber )
enum MResultType
kLong
kDouble
kString
kNoArg
static void clearResult ()
static void setResult ( int val )
static void setResult ( double val )
static void setResult ( bool val )
static void setResult ( const char* val )
static void setResult ( const MString & val )
static void setResult ( const MIntArray & val )
static void setResult ( const MDoubleArray & val )
static void setResult ( const MStringArray & val )
static void appendToResult ( int val )
static void appendToResult ( double val )
static void appendToResult ( bool val )
static void appendToResult ( const char* val )
static void appendToResult ( const MString & val )
static void appendToResult ( const MStringArray & val )
static MResultType currentResultType ()
static MStatus getCurrentResult ( int& val )
static MStatus getCurrentResult ( double& val )
static MStatus getCurrentResult ( MString & val )
static MStatus getCurrentResult ( MIntArray & val )
static MStatus getCurrentResult ( MDoubleArray & val )
static MStatus getCurrentResult ( MStringArray & val )
static int currentIntResult ( MStatus * ReturnStatus = NULL )
static double currentDoubleResult ( MStatus * ReturnStatus = NULL )
static MString currentStringResult ( MStatus * ReturnStatus = NULL )
MStatus setUndoable ( bool state )

Documentation

The base class for interactive tool commands
Description

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.

Functions

MPxToolCommand:: MPxToolCommand ()

Description

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 ()

Desctription

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

MStatus MPxToolCommand:: cancel ()

Description

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

Return Value

  • Status code

Status Codes

  • MS::kSuccess The cancel was successfull.
  • MS::kFailure Object error.

MStatus MPxToolCommand:: finalize ()

Description

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.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The finalize was successfull.
  • MS::kFailure Object error.

MStatus MPxToolCommand:: doFinalize ( MArgList & command )

Description

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

Arguments

  • command An MArgList reference representing an equivalent MEL command

Return Value

  • Status code

Status Codes

  • MS::kSuccess The doFinalize was successfull.
  • MS::kFailure Object error.

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright