C++ API Reference
MTemplateSelectionContext< ContextNameString, ContextClass, NodeType, ManipulatorClass, ManipulatorNodeName > Class Template Reference

Template class for selection context. More...

#include <MTemplateManipulator.h>

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

Public Member Functions

 MTemplateSelectionContext ()
 Constructor.
 
 ~MTemplateSelectionContext () override
 Destructor.
 
void toolOnSetup (MEvent &event) override
 Sets up a active list modified message which will trigger manipulator create/delete operations. More...
 
void toolOffCleanup () override
 Removes the callback.
 
virtual void namesOfAttributes (MStringArray &namesOfAttributes)
 Override to specify which attributes are required on the selected geometry. More...
 
virtual void setInitialState ()
 Override to set manipulator initial state. More...
 
bool validGeometrySelected ()
 Ensure that valid geometry is selected.
 
- Public Member Functions inherited from MPxSelectionContext
 MPxSelectionContext ()
 Class contstructor. More...
 
 ~MPxSelectionContext () override
 Default destructor. More...
 
MStatus doPress (MEvent &event, MHWRender::MUIDrawManager &drawMgr, const MHWRender::MFrameContext &context) override
 This method is not available in Python. More...
 
MStatus doRelease (MEvent &event, MHWRender::MUIDrawManager &drawMgr, const MHWRender::MFrameContext &context) override
 This method is not available in Python. More...
 
MStatus doDrag (MEvent &event, MHWRender::MUIDrawManager &drawMgr, const MHWRender::MFrameContext &context) override
 This method is not available in Python. More...
 
MStatus doHold (MEvent &event, MHWRender::MUIDrawManager &drawMgr, const MHWRender::MFrameContext &context) override
 This method is not available in Python. More...
 
MStatus doPress (MEvent &event) override
 This method is called when any mouse button is pressed. More...
 
MStatus doRelease (MEvent &event) override
 This method is called when any mouse button is released. More...
 
MStatus doDrag (MEvent &event) override
 This method is called when a mouse drag event occurs. More...
 
MStatus doHold (MEvent &event) override
 This method is called when after a mouse button is pressed but before the mouse is dragged. More...
 
MStatus helpStateHasChanged (MEvent &) override
 This method is called whenever the help state may need to be updated. More...
 
MStatus addManipulator (const MObject &manipulator) override
 This method adds a manipulator to the context, and also adds the manipulator to the DAG. More...
 
MStatus deleteManipulators () override
 This method deletes all the manipulators that belong to the context. More...
 
MStatus setAllowPreSelectHilight ()
 This method enables the support of pre-selection highlight for this context. More...
 
MStatus setAllowSoftSelect ()
 This method enables the support of soft selection for this context. More...
 
MStatus setAllowSymmetry ()
 This method enables the support of symmetrical selection for this context. More...
 
MStatus setAllowDoubleClickAction ()
 This method enables the support of double click smart selection for this context. More...
 
MStatus setImage (const MString &image, ImageIndex index)
 This method is used to set an XPM icon image that is to be used to represent this tool context in various places including the tool bar and can be queried from mel using the contextInfo command. More...
 
MString image (ImageIndex index, MStatus *ReturnStatus=NULL) const
 This method is used to retrieve an XPM icon image that has previously been set for this tool context. More...
 
MStatus getImage (MString &image, ImageIndex index) const
 NO SCRIPT SUPPORT. More...
 
void abortAction () override
 This method is called when the abort key is pressed. More...
 
bool processNumericalInput (const MDoubleArray &values, const MIntArray &flags, bool isAbsolute) override
 This method processes the input from the numerical input field. More...
 
bool feedbackNumericalInput () const override
 This method is called to update the numerical feedback. More...
 
MSyntax::MArgType argTypeNumericalInput (unsigned int index) const override
 This method is used by the feedback line to determine what units to display. More...
 
- Public Member Functions inherited from MPxContext
 MPxContext ()
 Class contstructor. More...
 
virtual ~MPxContext ()
 Default destructor. More...
 
virtual MStatus drawFeedback (MHWRender::MUIDrawManager &drawMgr, const MHWRender::MFrameContext &context)
 This method is not available in Python. More...
 
virtual MStatus doPtrMoved (MEvent &event, MHWRender::MUIDrawManager &drawMgr, const MHWRender::MFrameContext &context)
 This method is called when a mouse move event occurs. More...
 
virtual MStatus doPtrMoved (MEvent &event)
 This method is called when a mouse move event occurs. More...
 
virtual MStatus doEnterRegion (MEvent &event)
 This method is called when the mouse pointer enters a screen panel region. More...
 
virtual void deleteAction ()
 This method is called when the delete or backspace key is pressed. More...
 
virtual void completeAction ()
 This method is called when the complete key is pressed. More...
 
MStatus setImage (const MString &image, ImageIndex index)
 This method is used to set an XPM icon image that is to be used to represent this tool context in various places including the tool bar and can be queried from mel using the contextInfo command. More...
 
MString image (ImageIndex index, MStatus *ReturnStatus=NULL) const
 This method is used to retrieve an XPM icon image that has previously been set for this tool context. More...
 
virtual MString stringClassName () const
 This method is called to determine the name that uniquely identifies the context. More...
 
virtual void getClassName (MString &name) const
 NO SCRIPT SUPPORT. More...
 
MStatus getImage (MString &image, ImageIndex index) const
 NO SCRIPT SUPPORT. More...
 

Static Public Member Functions

static void updateManipulators (void *data)
 Callback that creates the manipulator if valid geometry is selected. More...
 
- Static Public Member Functions inherited from MPxSelectionContext
static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MPxContext
static const char * className ()
 Returns the name of this class. More...
 

Additional Inherited Members

- Public Types inherited from MPxContext
enum  ImageIndex { kImage1, kImage2, kImage3 }
 Used to select between the three possible images associated with the context. More...
 
- Protected Member Functions inherited from MPxSelectionContext
bool isSelecting ()
 USE _isSelecting() IN SCRIPT. More...
 
MPoint startPoint ()
 USE _startPoint() IN SCRIPT. More...
 
MPoint lastDragPoint ()
 USE _lastDragPoint() IN SCRIPT. More...
 
MPxToolCommandnewToolCommand () override
 CALL _newToolCommand() IN SCRIPT. More...
 
- Protected Member Functions inherited from MPxContext
MStatus setHelpString (const MString &str)
 USE _setHelpString() IN SCRIPT. More...
 
MStatus setTitleString (const MString &str)
 USE _setTitleString() IN SCRIPT. More...
 
MStatus setCursor (const MCursor &newCursor)
 USE _setCursor() IN SCRIPT. More...
 
MStatus beginMarquee (MEvent &event)
 USE _beginMarquee() IN SCRIPT. More...
 
MStatus dragMarquee (MEvent &event)
 USE _dragMarquee() IN SCRIPT. More...
 
MStatus releaseMarquee (MEvent &event, short &top, short &left, short &bottom, short &right)
 USE _releaseMarquee() IN SCRIPT. More...
 
- Static Protected Member Functions inherited from MPxContext
static bool ignoreEntry (const MIntArray &flags, unsigned int entry)
 USE _ignoreEntry() IN SCRIPT. More...
 

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/lineManipContainer.cpp, and squareScaleManipContext/squareScaleManipContext.cpp.

Member Function Documentation

void toolOnSetup ( MEvent event)
inlineoverridevirtual

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

Parameters
[in]eventThe event hat triggered it.

Reimplemented from MPxContext.

virtual void namesOfAttributes ( MStringArray namesOfAttributes)
inlinevirtual

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

Parameters
[in]namesOfAttributesArray of attribute names.
Examples:
lineManipContainer/lineManipContainer.cpp, and squareScaleManipContext/squareScaleManipContext.cpp.
virtual void setInitialState ( )
inlinevirtual

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.
static void updateManipulators ( void *  data)
inlinestatic

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]dataPointer to the current context class.

The documentation for this class was generated from the following file: