class MDrawRequest

Jump to documentation

A draw reqeust used in the draw methods of MPxSurfaceShapeUI (OpenMayaUI) (OpenMayaUI.py)

public members:

MDrawRequest ()
MDrawRequest ( const MDrawRequest & in )
~MDrawRequest ()
M3dView view () const
void setView ( M3dView & )
const MDagPath multiPath () const
void setMultiPath ( const MDagPath & )
MObject component () const
void setComponent ( MObject & )
MDrawData drawData () const
void setDrawData ( MDrawData & )
M3dView::DisplayStatus displayStatus () const
void setDisplayStatus ( M3dView::DisplayStatus )
bool displayCulling () const
void setDisplayCulling ( bool )
bool displayCullOpposite () const
void setDisplayCullOpposite ( bool )
M3dView::DisplayStyle displayStyle () const
void setDisplayStyle ( M3dView::DisplayStyle )
int color ( M3dView::ColorTable table ) const
void setColor ( int, M3dView::ColorTable table )
MMaterial material () const
void setMaterial ( MMaterial & )
bool isTransparent () const
void setIsTransparent ( bool )
bool drawLast () const
void setDrawLast ( bool )
int token () const
void setToken ( int )
MDrawRequest & operator = ( const MDrawRequest & other )

Documentation

A draw reqeust used in the draw methods of MPxSurfaceShapeUI (OpenMayaUI) (OpenMayaUI.py)
Description

This class encapsulates all the information needed to fulfill a request to draw an object or part of an object. This class is used by the draw methods of MPxSurfaceShapeUI derived objects.

The draw request should be created in the overridden MPxSurfaceShapeUI::getDrawRequests method. Once created the appropriate "set" methods of this class should be used to define what is being requested. Then the request should be placed on the draw reqeust queue using MDrawRequestQueue::add.

When your request gets processed by maya, your overriden MPxSurfaceShape::draw method will get called with your request. Use the query methods of this class to determine what to draw.

You create a draw request using the method MDrawInfo::getPrototype. A draw request automatically picks up certain information (listed below) upon it's creation. So you don't have to set any of this information unless you want to change it.

Information automatically set by MDrawInfo::getPrototype :

The draw token is an integer value which you can use to specify what is to be drawn. This is object specific and so you should define an enum with the information you require to decide what is being drawn in your MPxSurfaceShapeUI::draw method.

Here is an example of draw token values for a polygonal mesh object as defined in an MPxSurfaceShapeUI derived class.

    // Draw Tokens
    //
    enum {
        kDrawVertices, // component token
        kDrawWireframe,
        kDrawWireframeOnShaded,
        kDrawSmoothShaded,
        kDrawFlatShaded,
        kLastToken
    };

Functions

MDrawRequest:: MDrawRequest ()

Description

Constructor.

MDrawRequest:: MDrawRequest ( const MDrawRequest & other )

Description

Copy constructor.

Arguments

  • other value to copy

MDrawRequest:: ~MDrawRequest ()

Description

Destructor.

M3dView MDrawRequest:: view () const

Description

Returns the view where drawing will be done.

void MDrawRequest:: setView ( M3dView & theView )

Description

Sets the view where drawing will be done.

const MDagPath MDrawRequest:: multiPath () const

Description

Returns the path to the object to be drawn.

void MDrawRequest:: setMultiPath ( const MDagPath & thePath )

Description

Sets the path to the object to be drawn.

MObject MDrawRequest:: component () const

Description

An optional component. If set draw the components that are specified, otherwise draw all components of this type for the object.

void MDrawRequest:: setComponent ( MObject & comp )

Description

Set a component to be drawn.

Arguments

  • comp component to be drawn

MDrawData MDrawRequest:: drawData () const

Description

Returns the object specific draw data.

void MDrawRequest:: setDrawData ( MDrawData & data )

Description

Set the object specific draw data.

Arguments

  • data draw data

M3dView::DisplayStatus MDrawRequest:: displayStatus () const

Description

Return the state of object (active, dormant, etc.).

void MDrawRequest:: setDisplayStatus ( M3dView::DisplayStatus status )

Description

Set the state of object (active, dormant, etc.).

Arguments

  • status display status

bool MDrawRequest:: displayCulling () const

Description

Returns the state of the culling flag for the object.

void MDrawRequest:: setDisplayCulling ( bool value )

Description

Sets the state of the culling flag for the object.

Arguments

  • value culling value to be set

bool MDrawRequest:: displayCullOpposite () const

Description

Returns the state of the culling flag for the object.

void MDrawRequest:: setDisplayCullOpposite ( bool value )

Description

Sets the state of the culling flag for the object.

Arguments

  • value culling value to be set

M3dView::DisplayStyle MDrawRequest:: displayStyle () const

Description

Returns how the object should be drawn (wireframe, shaded, etc.).

void MDrawRequest:: setDisplayStyle ( M3dView::DisplayStyle style )

Description

Sets how the object should be drawn (wireframe, shaded, etc.).

Arguments

  • style display style to set

int MDrawRequest:: color ( M3dView::ColorTable table ) const

Description

Returns the wireframe display color.

The color table specifies which of the 4 color planes to use. This table can be active, dormant, template, or background.

Arguments

  • table color table

void MDrawRequest:: setColor ( int value, M3dView::ColorTable table )

Description

Sets the wireframe display color.

The color table specifies which of the 4 color planes to use. This table can be active, dormant, template, or background.

Arguments

  • value index into the color table
  • table color table

MMaterial MDrawRequest:: material () const

Description

Returns the shaded material.

void MDrawRequest:: setMaterial ( MMaterial & material )

Description

Returns the shaded material.

Arguments

  • material the material to set

bool MDrawRequest:: isTransparent () const

Description

Returns the transparency state of the object.

void MDrawRequest:: setIsTransparent ( bool value )

Description

Sets the transparency state of the object.

Arguments

  • value the transparency value

bool MDrawRequest:: drawLast () const

Description

Returns the order in which this object will be drawn.

void MDrawRequest:: setDrawLast ( bool value )

Description

Specifies the order in which this object will be drawn.

Arguments

  • value draw last flag

int MDrawRequest:: token () const

Description

Returns the user-defined draw token for this request.

The token is used to identify a particular part of an object to draw. It is also used to distinguish draw requests generated by derived UI objects from those generated by base classes. It some cases, it provides a way of indicating that a component should be displayed without creating a component MObject.

void MDrawRequest:: setToken ( int value )

Description

Set the user-defined draw token for this request.

The token is used to identify a particular part of an object to draw. It is also used to distinguish draw requests generated by derived UI objects from those generated by base classes. It some cases, it provides a way of indicating that a component should be displayed without creating a component MObject.

MDrawRequest & MDrawRequest:: operator = ( const MDrawRequest & other )

Description

Assignment operator.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright