C++ API Reference
MPanelCanvasInfo Class Reference

Introduced in 2020.0 More...

#include <MPanelCanvasInfo.h>

+ Inheritance diagram for MPanelCanvasInfo:

Public Member Functions

 MPanelCanvasInfo (const MString &editorName, MStatus *stat=NULL)
 The constructor. More...
 
virtual ~MPanelCanvasInfo ()
 Destructor.
 
MStatus getViewportBounds (double &left, double &right, double &bottom, double &top) const
 Return the viewport bounds. More...
 
MStatus getViewportBounds (MDoubleArray &boundsArray) const
 Get the attached Graph Editor's viewport bounds, using the currently defined animation time units. More...
 
MStatus getViewportSize (int &width, int &height) const
 Return the viewport size. More...
 
MStatus setViewportBounds (double left, double right, double bottom, double top) const
 Set the viewport bounds. More...
 
MStatus setViewportBounds (const MDoubleArray &boundsArray) const
 Set the attached Graph Editor's viewport bounds to those that are supplied using the currently defined animation time units as seen in the viewport. More...
 
bool supportsUIDrawing ()
 Returns whether the attached panel control supports drawing primitives in screen space. More...
 
void reset ()
 Resets all stored state information to be empty, thereby detaching from the currently attached Graph Editor (if any)
 
MString name () const
 Return the name of the currently attached panel. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 

Friends

class MGraphEditorInfo
 

Detailed Description

Introduced in 2020.0

2020.0:
Introduced in this version.

Panel state information setting and retrieval

This class provides methods for setting and retrieving common information for all supported panels. Currently, the Graph Editor is the only supported editor.

Constructor & Destructor Documentation

MPanelCanvasInfo ( const MString editorName,
MStatus ReturnStatus = NULL 
)

The constructor.

Constructor.

A valid panel control name is required. For example, the panel control name of the default Graph Editor is "graphEditor1GraphEd".

Attaches to the Graph Editor corresponding the supplied name.

Parameters
[in]editorNamethe name of the Graph Editor (i.e. graphEditor1GraphEd)
[out]ReturnStatusthe return status
Status Codes:
  • MS::kSuccess The supplied Graph Editor object name is valid
  • MS::kFailure The supplied Graph Editor object name is invalid
  • MS::kNotImplemented The supplied Graph Editor is currently in an unsupported state (stacked curves or normalized display modes)

Member Function Documentation

MStatus getViewportBounds ( double &  left,
double &  right,
double &  bottom,
double &  top 
) const

Return the viewport bounds.

Get the attached Graph Editor's viewport bounds, using the currently defined animation time units.

Note: a viewport that is displaying stacked curves or re-normalized curves uses a different vertical axis scale.

Parameters
[out]leftleft co-ordinate
[out]rightright co-ordinate
[out]bottombottom co-ordinate
[out]toptop co-ordinate
Returns
the return status
Status Codes:
  • MS::kSuccess The viewport bounds were obtained
  • MS::kFailure The viewport bounds could not be obtained
MStatus getViewportBounds ( MDoubleArray boundsArray) const

Get the attached Graph Editor's viewport bounds, using the currently defined animation time units.

Note: a viewport that is displaying stacked curves or re-normalized curves uses a different vertical axis scale.

Parameters
[out]boundsArrayan array of four doubles representing in order: (left, right, bottom, top) bounds co-ordinates
Returns
the return status
Status Codes:
  • MS::kSuccess The viewport bounds were obtained
  • MS::kFailure The viewport bounds could not be obtained
MStatus getViewportSize ( int &  width,
int &  height 
) const

Return the viewport size.

Get the attached Graph Editor's viewport size, excluding the time line.

Parameters
[out]widthwidth of viewport
[out]heightheight of viewport
Returns
the return status
Status Codes:
  • MS::kSuccess The viewport size was obtained
  • MS::kFailure The viewport size could not be obtained (will fail if the attached panel is not a graph editor)
MStatus setViewportBounds ( double  left,
double  right,
double  bottom,
double  top 
) const

Set the viewport bounds.

Set the attached Graph Editor's viewport bounds to those that are supplied using the currently defined animation time units as seen in the viewport.

Note: a viewport that is displaying stacked curves or re-normalized curves is not currently supported.

Parameters
[in]leftleft co-ordinate
[in]rightright co-ordinate
[in]bottombottom co-ordinate
[in]toptop co-ordinate
Returns
the return status
Status Codes:
  • MS::kSuccess The viewport bounds were changed
  • MS::kFailure The viewport bounds could not be changed
  • MS::kNotImplemented The supplied Graph Editor is currently in an unsupported state (stacked curves or normalized display modes)
MStatus setViewportBounds ( const MDoubleArray boundsArray) const

Set the attached Graph Editor's viewport bounds to those that are supplied using the currently defined animation time units as seen in the viewport.

Note: a viewport that is displaying stacked curves or re-normalized curves is not currently supported.

Parameters
[in]boundsArrayan array of exactly four doubles representing in order: (left, right, bottom, top) bounds co-ordinates
Returns
the return status
Status Codes:
  • MS::kSuccess The viewport bounds were changed
  • MS::kFailure The viewport bounds could not be changed
  • MS::kNotImplemented The supplied Graph Editor is currently in an unsupported state (stacked curves or normalized display modes)
bool supportsUIDrawing ( )

Returns whether the attached panel control supports drawing primitives in screen space.

If such drawing is not supported, the registerDrawUICallback () method will return MStatus::kNotImplemented.

Note that for the Graph Editor, if the panel for drawing has not yet been created (e.g., when the default Graph Editor has not yet been opened), this method will return false.

Note that the Graph Editor will return false if it exists, but the panel for drawing has not yet been created (e.g., for the default Graph Editor when it has not yet been opened, but exists by default).

MString name ( ) const

Return the name of the currently attached panel.

Returns the name of the currently attached Graph Editor (if any)

Returns
The name of the currently attached Graph Editor or an empty string if no Graph Editor is attached
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.

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