- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions

# MFnToggleManip Class Reference

# OpenMayaUI - API module for user interface | FunctionSet classes

Search for all occurrences

## Detailed Description

ToggleManip function set.

The ToggleManip allows the user to switch between two modes or some on/off state. It is drawn as a circle with or without a dot. When the mode is on, the dot is drawn in the circle; when the mode is off, the circle is drawn without the dot. This manipulator generates a boolean value corresponding to whether or not the mode is on or off.

Examples:

  swissArmyManip.cpp.

`#include <MFnToggleManip.h>`

Inheritance diagram for MFnToggleManip:
[legend]

List of all members.

## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnToggleManip ()
| Destructor.
| MFnToggleManip ()
| Default constructor.
| MFnToggleManip (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
| MFnToggleManip (const MDagPath &object, MStatus *ret=NULL)
| Constructor.
MObject | create (MStatus *ReturnStatus=NULL)
| Creates a new ToggleManip.
MObject | create (const MString &manipName, const MString &toggleName, MStatus *ReturnStatus=NULL)
| Creates a new ToggleManip.
MStatus | connectToTogglePlug (MPlug &togglePlug)
| Connect to the toggle plug.
MPoint | startPoint (MStatus *ReturnStatus=NULL) const
| Returns the start point.
MVector | direction (MStatus *ReturnStatus=NULL) const
| Returns the direction.
double | length (MStatus *ReturnStatus=NULL) const
| Returns the length.
bool | toggle (MStatus *ReturnStatus=NULL) const
| Returns the toggle.
unsigned int | startPointIndex (MStatus *ReturnStatus=NULL) const
| Returns the index of the start point of the ToggleManip.
unsigned int | directionIndex (MStatus *ReturnStatus=NULL) const
| Returns the index of the direction.
unsigned int | lengthIndex (MStatus *ReturnStatus=NULL) const
| Returns the index of the length of the ToggleManip.
unsigned int | toggleIndex (MStatus *ReturnStatus=NULL) const
| Returns the index of the toggle of the ToggleManip.
MStatus | setStartPoint (MPoint &startPoint)
| Sets the start point of the ToggleManip.
MStatus | setDirection (MVector &direction)
| Sets the direction of the ToggleManip.
MStatus | setLength (double length)
| Sets the length of the ToggleManip.
MStatus | setToggle (bool toggle)
| Sets the toggle of the ToggleManip.
| MFnToggleManip (const MObject &object, MStatus *ret=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Constructor & Destructor Documentation

~MFnToggleManip | ( |  | ) | `[virtual]`

Destructor.

Class destructor.

MFnToggleManip | ( | MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

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

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnToggleManip | ( | const MDagPath & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

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

Parameters:

  [in] | object | The const MDagPath to attach the function set to
  [out] | ReturnStatus | The return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnToggleManip | ( | const MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

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

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

## Member Function Documentation

MFn::Type type | ( |  | ) | const `[virtual]`

Search for all occurrences

Function set type.

Return the class type : MFn::kToggleManip.

Reimplemented from MFnManip3D.

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

Search for all occurrences

Class name.

Return the class name : "MFnToggleManip".

Reimplemented from MFnManip3D.

MObject create | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Creates a new ToggleManip.

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

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

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

Parameters:

  [out] | ReturnStatus | return status

Returns:
  Newly created ToggleManip

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MObject create | ( | const MString & | manipName,
|  | const MString & | toggleName,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Creates a new ToggleManip.

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

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

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

Parameters:

  [in] | manipName | Name of the manip for UI purposes.
  [in] | toggleName | Label for the toggle value which appears in the feedback line.
  [out] | ReturnStatus | Status code.

Returns:
  Newly created ToggleManip.

Status Codes:
  - MS::kSuccess Operation successful.
  - MS::kFailure Operation failed.

Reimplemented from MFnDependencyNode.

MStatus connectToTogglePlug | ( | MPlug & | togglePlug | ) |

Search for all occurrences

Connect to the toggle plug.

The data type corresponding to the togglePlug is a boolean value.

Parameters:

  [in] | togglePlug | the toggle plug

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MPoint startPoint | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the start point.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The start point

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MVector direction | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the direction.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The direction

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

double length | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the length.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  Length

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

bool toggle | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the toggle.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  Toggle

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

unsigned int startPointIndex | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the index of the start point of the ToggleManip.

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

Parameters:

  [out] | ReturnStatus | return status

Returns:
  Start point index

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

unsigned int directionIndex | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the index of the direction.

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

Parameters:

  [out] | ReturnStatus | return status

Returns:
  Direction index

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

unsigned int lengthIndex | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the index of the length of the ToggleManip.

The data type corresponding to this index is a double.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  Length index

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

unsigned int toggleIndex | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the index of the toggle of the ToggleManip.

The data type corresponding to this index is a boolean.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  Toggle index

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MStatus setStartPoint | ( | MPoint & | startPoint | ) |

Search for all occurrences

Sets the start point of the ToggleManip.

Parameters:

  [in] | startPoint | the start point of the ToggleManip

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MStatus setDirection | ( | MVector & | direction | ) |

Search for all occurrences

Sets the direction of the ToggleManip.

Parameters:

  [in] | direction | the direction of the ToggleManip

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MStatus setLength | ( | double | length | ) |

Search for all occurrences

Sets the length of the ToggleManip.

Parameters:

  [in] | length | the length of the ToggleManip

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MStatus setToggle | ( | bool | toggle | ) |

Search for all occurrences

Sets the toggle of the ToggleManip.

Parameters:

  [in] | toggle | the toggle of the ToggleManip

Returns:
  - MS::kSuccess operation successful
  - MS::kFailure operation failed

MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip
MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip MFnToggleManip