C++ API Reference

Base class for user defined contexts working on uv editor. More...

#include <MPxTexContext.h>

+ Inheritance diagram for MPxTexContext:

Public Member Functions

 MPxTexContext ()
 Class contstructor. More...
 
 ~MPxTexContext () 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 doPtrMoved (MEvent &event, MHWRender::MUIDrawManager &drawMgr, const MHWRender::MFrameContext &context) override
 This method is not available in Python. More...
 
void viewToPort (double xView, double yView, short &xPort, short &yPort) const
 This method is used to convert view coordinates to port (window) coordinates. More...
 
void portToView (short xPort, short yPort, double &xView, double &yView) const
 This method is used to convert port (window) coordinates to view coordinates. More...
 
void viewRect (double &left, double &right, double &bottom, double &top) const
 This method is used to get the current uv viewport dimensions. More...
 
void portSize (double &width, double &height) const
 This method is used to get the window dimension of the current uv viewport. More...
 
MPxToolCommandnewToolCommand () override
 Create a new instance of the tool command associated with this context. More...
 
- Public Member Functions inherited from MPxContext
 MPxContext ()
 Class contstructor. More...
 
virtual ~MPxContext ()
 Default destructor. More...
 
virtual void toolOnSetup (MEvent &event)
 This method is called when the context is activated, i.e when the toolButton for the context is pressed. More...
 
virtual void toolOffCleanup ()
 This method is called when the context is deactivated, i.e when another context is activated. More...
 
virtual MStatus doHold (MEvent &event, MHWRender::MUIDrawManager &drawMgr, const MHWRender::MFrameContext &context)
 This method is not available in Python. More...
 
virtual MStatus drawFeedback (MHWRender::MUIDrawManager &drawMgr, const MHWRender::MFrameContext &context)
 This method is not available in Python. More...
 
virtual MStatus doPress (MEvent &event)
 This method is called when any mouse button is pressed. More...
 
virtual MStatus doRelease (MEvent &event)
 This method is called when any mouse button is released. More...
 
virtual MStatus doDrag (MEvent &event)
 This method is called when a mouse drag event occurs. More...
 
virtual MStatus doHold (MEvent &event)
 This method is called when a mouse button is pressed but before the mouse is dragged. 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 MStatus helpStateHasChanged (MEvent &event)
 This method is called whenever the help state may need to be updated. 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...
 
virtual MStatus addManipulator (const MObject &manipulator)
 This method adds a manipulator to the context. More...
 
virtual MStatus deleteManipulators ()
 This method deletes all the manipulators that belong to the 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...
 
virtual void abortAction ()
 This method is called when the abort key is pressed. More...
 
virtual bool processNumericalInput (const MDoubleArray &values, const MIntArray &flags, bool isAbsolute)
 This method processes the input from the numerical input field. More...
 
virtual bool feedbackNumericalInput () const
 This method is called to update the numerical feedback. More...
 
virtual MSyntax::MArgType argTypeNumericalInput (unsigned int index) const
 This method is used by the feedback line to determine what units to display. 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 bool getMarqueeSelection (double xMin, double yMin, double xMax, double yMax, const MSelectionMask &mask, bool bPickSingle, bool bIgnoreSelectionMode, MSelectionList &selectionList)
 This method is called when the user performs a selection within the uv editor. More...
 
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 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

Base class for user defined contexts working on uv editor.

This is the base class for user defined contexts working on uv editor.

Examples:
grabUVMain.cpp.

Constructor & Destructor Documentation

OPENMAYA_MAJOR_NAMESPACE_OPEN MPxTexContext ( )

Class contstructor.

This constructor will only be called from MPxContextCommand::makeObj. Users must override this method.

~MPxTexContext ( )
override

Default destructor.

Users can override this method to free any user instantiated data when the context is destroyed.

Member Function Documentation

MStatus doPress ( MEvent event,
MHWRender::MUIDrawManager drawMgr,
const MHWRender::MFrameContext context 
)
overridevirtual

This method is not available in Python.

This method is called when any mouse button is pressed.

The base method does nothing and should be overridden if the user needs to do anything on a button press.

MUIDrawManager allows for drawing primitives in the 3D modeling space. Those primitives will then be projected onto a 2D overlay plane before being displayed.

The event can be used to get more explicit information about the press such as the button number. See MEvent for more information.

Parameters
[in]eventThe button press event information.
[in]drawMgrThe UI draw manager, it can be used to draw some simple geometry including text.
[in]contextFrame level context information
Returns
Status code
Status Codes:
  • MS::kSuccess

Reimplemented from MPxContext.

Examples:
grabUVMain.cpp.
MStatus doRelease ( MEvent event,
MHWRender::MUIDrawManager drawMgr,
const MHWRender::MFrameContext context 
)
overridevirtual

This method is not available in Python.

This method is called when any mouse button is released.

The base method does nothing and should be overridden if the user needs to do anything on a button release.

MUIDrawManager allows for drawing primitives in the 3D modeling space. Those primitives will then be projected onto a 2D overlay plane before being displayed.

The event can be used to get more explicit information about the release such as the button number. See MEvent for more information.

Parameters
[in]eventThe button release event information.
[in]drawMgrThe UI draw manager, it can be used to draw some simple geometry including text.
[in]contextFrame level context information
Returns
Status code
Status Codes:
  • MS::kSuccess

Reimplemented from MPxContext.

Examples:
grabUVMain.cpp.
MStatus doDrag ( MEvent event,
MHWRender::MUIDrawManager drawMgr,
const MHWRender::MFrameContext context 
)
overridevirtual

This method is not available in Python.

This method is called when a mouse drag event occurs.

The base method does nothing and should be overridden if the user needs to do anything during a mouse drag.

MUIDrawManager allows for drawing primitives in the 3D modeling space. Those primitives will then be projected onto a 2D overlay plane before being displayed.

The event can be used to get more explicit information about the drag such as the cursor location. See MEvent for more information.

Parameters
[in]eventThe button drag event information.
[in]drawMgrThe UI draw manager, it can be used to draw some simple geometry including text.
[in]contextFrame level context information
Returns
Status code
Status Codes:
  • MS::kSuccess

Reimplemented from MPxContext.

Examples:
grabUVMain.cpp.
MStatus doPtrMoved ( MEvent event,
MHWRender::MUIDrawManager drawMgr,
const MHWRender::MFrameContext context 
)
overridevirtual

This method is not available in Python.

This method is called when a mouse button is moving.

The base method does nothing and should be overridden if the user needs to do anything on a button hold.

MUIDrawManager allows for drawing primitives in the 3D modeling space. Those primitives will then be projected onto a 2D overlay plane before being displayed.

The event can be used to get more explicit information about the hold such as the button number. See MEvent for more information.

Parameters
[in]eventThe mouse moving event information.
[in]drawMgrThe UI draw manager, it can be used to draw some simple geometry including text.
[in]contextFrame level context information
Returns
Status code
Status Codes:
  • MS::kSuccess

Reimplemented from MPxContext.

Examples:
grabUVMain.cpp.
void viewToPort ( double  xView,
double  yView,
short &  xPort,
short &  yPort 
) const

This method is used to convert view coordinates to port (window) coordinates.

Parameters
[in]xViewthe x position at view coordinate
[in]yViewthe y position at view coordinate
[out]xPortthe x position at window coordinate
[out]yPortthe y position at window coordinate
void portToView ( short  xPort,
short  yPort,
double &  xView,
double &  yView 
) const

This method is used to convert port (window) coordinates to view coordinates.

Parameters
[in]xPortThe x position at window coordinate
[in]yPortThe y position at window coordinate
[out]xViewThe x position at view coordinate
[out]yViewThe y position at view coordinate
void viewRect ( double &  left,
double &  right,
double &  bottom,
double &  top 
) const

This method is used to get the current uv viewport dimensions.

Parameters
[out]leftLeft coordinate of uv viewport.
[out]rightRight coordinate of uv viewport.
[out]bottomBottom coordinate of uv viewport.
[out]topTop coordinate of uv viewport.
void portSize ( double &  width,
double &  height 
) const

This method is used to get the window dimension of the current uv viewport.

Parameters
[out]widthWidth of the window.
[out]heightHeight of the window.
bool getMarqueeSelection ( double  xMin,
double  yMin,
double  xMax,
double  yMax,
const MSelectionMask mask,
bool  bPickSingle,
bool  bIgnoreSelectionMode,
MSelectionList selectionList 
)
static

This method is called when the user performs a selection within the uv editor.

Parameters
[in]xMinMinimum x coordinate value of the selection rectangle.
[in]yMinMinimum y coordinate value of the selection rectangle.
[in]xMaxMaximum x coordinate value of the selection rectangle.
[in]yMaxMaximum y coordinate value of the selection rectangle.
[in]maskThe selection mask.
[in]bPickSingleIndicate if the user is in single selection mode.
[in]bIgnoreSelectionModeIf true, the user can select components even if component selection mode is not on.
[out]selectionListThe selection list to be populated.
Returns
true if something was selected, false otherwise.
Examples:
grabUVMain.cpp.
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.
MPxToolCommand * newToolCommand ( )
overridevirtual

Create a new instance of the tool command associated with this context.

The tool command (derived from MPxToolCommand) is the command that was registered along with the context command in :

MFnPlugin::registerContextCommand( contextCommand, contextCommandCreator,
toolCommand, toolCommandCreator )
Returns
A new instance of the MPxToolCommand.

Reimplemented from MPxContext.


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