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

#include <MTemplateManipulator.h>

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

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

Collaboration graph
[legend]

List of all members.


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.


Public Member Functions

 MTemplateSelectionContext ()
 Constructor.
virtual ~MTemplateSelectionContext ()
 Destructor.
virtual void toolOnSetup (MEvent &event)
virtual void toolOffCleanup ()
 Removes the callback.
virtual void namesOfAttributes (MStringArray &namesOfAttributes)
virtual void setInitialState ()
bool validGeometrySelected ()
 Ensure that valid geometry is selected.

Static Public Member Functions

static void updateManipulators (void *data)

Member Function Documentation

template<const char * ContextNameString, class ContextClass, MFn::Type NodeType, class ManipulatorClass, const char * ManipulatorNodeName>
virtual void MTemplateSelectionContext< ContextNameString, ContextClass, NodeType, ManipulatorClass, ManipulatorNodeName >::toolOnSetup ( MEvent event  )  [inline, virtual]

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.

template<const char * ContextNameString, class ContextClass, MFn::Type NodeType, class ManipulatorClass, const char * ManipulatorNodeName>
virtual void MTemplateSelectionContext< ContextNameString, ContextClass, NodeType, ManipulatorClass, ManipulatorNodeName >::namesOfAttributes ( MStringArray namesOfAttributes  )  [inline, virtual]

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

Parameters:
[in] namesOfAttributes Array of attribute names.
Examples:

template<const char * ContextNameString, class ContextClass, MFn::Type NodeType, class ManipulatorClass, const char * ManipulatorNodeName>
virtual void MTemplateSelectionContext< ContextNameString, ContextClass, NodeType, ManipulatorClass, ManipulatorNodeName >::setInitialState (  )  [inline, virtual]

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:

template<const char * ContextNameString, class ContextClass, MFn::Type NodeType, class ManipulatorClass, const char * ManipulatorNodeName>
static void MTemplateSelectionContext< ContextNameString, ContextClass, NodeType, ManipulatorClass, ManipulatorNodeName >::updateManipulators ( void *  data  )  [inline, static]

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.


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