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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MTemplateSelectionContext< ContextNameString, ContextClass, NodeType, ManipulatorClass, ManipulatorNodeName > Class Template Reference
OpenMayaUI - API module for user interface

Search for all occurrences

## Detailed Description

### template<const char * ContextNameString, class ContextClass, MFn::Type NodeType, class ManipulatorClass, const char * ManipulatorNodeName>
class MTemplateSelectionContext< ContextNameString, ContextClass, NodeType, ManipulatorClass, ManipulatorNodeName >

Template class for selection context.

Template helper to build selection contexts.

Parameters:
  - ContextNameString : string name of context command
  - ContextClass : context command derived from MPxContextCommand
  - NodeType : MFn type that selection context should operate on
  - ManipulatorClass : derived from MPxManipulatorNode
  - ManipulatorNodeName : name of the manipulator node

Examples:

  lineManipContainer.cpp, and squareScaleManipContext.cpp.

`#include <MTemplateManipulator.h>`

Inheritance diagram for MTemplateSelectionContext< ContextNameString, ContextClass, NodeType, ManipulatorClass, ManipulatorNodeName >:
[legend]

List of all members.

## Public Member Functions
| MTemplateSelectionContext ()
| Constructor.
virtual | ~MTemplateSelectionContext ()
| Destructor.
virtual void | toolOnSetup (MEvent &event)
| Sets up a active list modified message which will trigger manipulator create/delete operations.
virtual void | toolOffCleanup ()
| Removes the callback.
virtual void | namesOfAttributes (MStringArray &namesOfAttributes)
| Override to specify which attributes are required on the selected geometry.
virtual void | setInitialState ()
| Override to set manipulator initial state. Search for all occurrences
bool | validGeometrySelected ()
| Ensure that valid geometry is selected.
## Static Public Member Functions
static void | updateManipulators (void *data)
| Callback that creates the manipulator if valid geometry is selected. Search for all occurrences

## Member Function Documentation

virtual void toolOnSetup | ( | MEvent & | event | ) | `[inline, virtual]`

Search for all occurrences

Sets up a active list modified message which will trigger manipulator create/delete operations.

Parameters:

  [in] | event | The event hat triggered it.

Reimplemented from MPxContext.

virtual void namesOfAttributes | ( | MStringArray & | namesOfAttributes | ) | `[inline, virtual]`

Search for all occurrences

Override to specify which attributes are required on the selected geometry.

Parameters:

  [in] | namesOfAttributes | Array of attribute names.

Examples:
  lineManipContainer.cpp, and squareScaleManipContext.cpp.

virtual void setInitialState | ( |  | ) | `[inline, virtual]`

Search for all occurrences

Override to set manipulator initial state.

Note:
  manipulatorClassPtr and firstObjectSelected will be set on entry. manipulatorClassPtr is the manipulator created and firstObjectSelected can be used to position the manipulator in the correct position.

Examples:
  squareScaleManipContext.cpp.

static void updateManipulators | ( | void * | data | ) | `[inline, static]`

Search for all occurrences

Callback that creates the manipulator if valid geometry is selected.

Also removes the manipulator if no geometry is selected. Handles connecting the manipulator to multiply selected nodes.

Parameters:

  [in] | data | Pointer to the current context class.