Public Member Functions | Protected Member Functions

MFnStateManip Class Reference

This reference page is linked to from the following overview topics: Base Manipulators, Communication Between Manipulators and Nodes.


Search for all occurrences

Detailed Description

StateManip function set.

The StateManip allows the user to switch between multiple states. It is drawn as a circle with a notch. Each click on the circle increments the value of the state (modulo the maximum number of states). This manipulator generates an integer value corresponding to the state of the manip.

Examples:

rotateManip.cpp, and swissArmyManip.cpp.

#include <MFnStateManip.h>

Inheritance diagram for MFnStateManip:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual MFn::Type type () const
 Function set type.
virtual ~MFnStateManip ()
 Destructor.
 MFnStateManip ()
 Default constructor.
 MFnStateManip (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor.
 MFnStateManip (const MDagPath &object, MStatus *ret=NULL)
 Constructor.
MObject create (MStatus *ReturnStatus=NULL)
 Creates a new StateManip.
MObject create (const MString &manipName, const MString &stateName, MStatus *ReturnStatus=NULL)
 Creates a new StateManip.
MStatus connectToStatePlug (MPlug &statePlug)
 Connect to the state plug.
MStatus setInitialState (unsigned int initialState)
 Sets the initial state of the StateManip.
MStatus setMaxStates (unsigned int numStates)
 Sets the maximum number of states that the StateManip will have.
unsigned int maxStates (MStatus *ReturnStatus=NULL) const
 Returns the number of maximum states.
unsigned int state (MStatus *ReturnStatus=NULL) const
 Returns the current state.
unsigned int positionIndex (MStatus *ReturnStatus=NULL) const
 Returns the index of the position of the StateManip.
unsigned int stateIndex (MStatus *ReturnStatus=NULL) const
 Returns the index of the state.
 MFnStateManip (const MObject &object, MStatus *ret=NULL)
 Constructor.

Protected Member Functions

virtual const char * className () const
 Class name.

Constructor & Destructor Documentation

~MFnStateManip ( ) [virtual]

Destructor.

Class destructor.

MFnStateManip ( MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:
MFnStateManip ( const MDagPath object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given constant MDagPath object.

Parameters:
[in]objectThe const MDagPath to attach the function set to
[out]ReturnStatusThe return status
Status Codes:
MFnStateManip ( const MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:

Member Function Documentation

MFn::Type type ( ) const [virtual]

Function set type.

Return the class type : MFn::kStateManip.

Reimplemented from MFnManip3D.

const char * className ( ) const [protected, virtual]

Class name.

Return the class name : "MFnStateManip".

Reimplemented from MFnManip3D.

MObject create ( MStatus ReturnStatus = NULL)

Creates a new StateManip.

This function set's object is set to be the new manipulator.

This method should only be used to create a non-composite StateManip.

The name that appears in the feedback line is "state"

Parameters:
[out]ReturnStatusreturn status
Returns:
Newly created StateManip
Status Codes:
MObject create ( const MString manipName,
const MString stateName,
MStatus ReturnStatus = NULL 
)

Creates a new StateManip.

This function set's object is set to be the new manipulator.

This method should only be used to create a non-composite StateManip.

The name that appears in the feedback line is specified by the stateName argument.

Parameters:
[in]manipNameName of the manip for UI purposes.
[in]stateNameLabel for the state value which appears in the feedback line.
[out]ReturnStatusStatus code.
Returns:
Newly created StateManip
Status Codes:

Reimplemented from MFnDependencyNode.

MStatus connectToStatePlug ( MPlug statePlug)

Connect to the state plug.

The data type corresponding to the statePlug is a int integer.

Parameters:
[in]statePlugthe state plug
Returns:
MStatus setInitialState ( unsigned int  initialState)

Sets the initial state of the StateManip.

Parameters:
[in]initialStateinitial state of the StateManip
Returns:
MStatus setMaxStates ( unsigned int  numStates)

Sets the maximum number of states that the StateManip will have.

The default number of maximum states is 4.

Parameters:
[in]numStatesthe maxiumum number of states
Returns:
unsigned int maxStates ( MStatus ReturnStatus = NULL) const

Returns the number of maximum states.

Parameters:
[out]ReturnStatusreturn status
Returns:
Maximum states
Status Codes:
unsigned int state ( MStatus ReturnStatus = NULL) const

Returns the current state.

Parameters:
[out]ReturnStatusreturn status
Returns:
Current states
Status Codes:
unsigned int positionIndex ( MStatus ReturnStatus = NULL) const

Returns the index of the position of the StateManip.

The data type corresponding to this index is MFnNumericData::k3Double.

Parameters:
[out]ReturnStatusreturn status
Returns:
Position index
Status Codes:
unsigned int stateIndex ( MStatus ReturnStatus = NULL) const

Returns the index of the state.

The data type corresponding to this index is a int integer.

Parameters:
[out]ReturnStatusreturn status
Returns:
State index
Status Codes:

MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip
MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip MFnStateManip