Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends

MDrawData Class Reference

This reference page is linked to from the following overview topics: Drawing and refresh.


Search for all occurrences

Detailed Description

Draw data used in the draw methods of MPxSurfaceShapeUI.

The MDrawData class holds geometry specific information for user defined shapes which maya does not intrinsicly know about.

This class is used in the draw methods of MPxSurfaceShapeUI For each draw request you must create and add a draw data object which will contain geometry specific information that you will need in the subsequent call to MPxSurfaceShapeUI::draw.

MDrawData contains one void* member which is a pointer to an object that you define. This object is the geometry needed to draw your shape.

To create draw data use the function MPxSurfaceShapeUI::getDrawData. This function takes two arguments, the first is a pointer to your geometry object, the second is the draw data being created. To add the data to a request use MDrawRequest::setDrawData.

Draw data is also used to carry texture information to your draw method. For materials with texture you must call MMaterial::evaluateTexture from your MPxSurfaceShapeUI::getDrawRequests method. Then in your draw method use MMaterial::applyTexture to set up the viewport to draw using the textured material.

Examples:

apiMeshShapeUI.cpp, apiSimpleShapeUI.cpp, pnTrianglesNode.cpp, and quadricShape.cpp.

#include <MDrawData.h>

List of all members.

Public Member Functions

  MDrawData ()
  Constructor.
  MDrawData (const MDrawData &in)
  Copy constructor.
  ~MDrawData ()
  Destructor.
void *  geometry ()
  Returns the geometry associated with this draw data object.

Static Public Member Functions

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

Protected Member Functions

MDrawData operator= (const MDrawData &other)
  Operator =.

Friends

class  MMaterial
class  MPxSurfaceShapeUI
class  MDrawRequest

Constructor & Destructor Documentation

MDrawData ( )

Constructor.

Creates an empty draw data object. Use MPxSurfaceShapeUI::getDrawData to set up this object.

MDrawData ( const MDrawData other )

Copy constructor.

Parameters:
[in] other draw data to copy

Member Function Documentation

void * geometry ( )

Returns the geometry associated with this draw data object.

The geometry is set using the getDrawData method of MPxSurfaceShapeUI.

Returns:
A pointer to the geometry.
Examples:
apiMeshShapeUI.cpp, apiSimpleShapeUI.cpp, and quadricShape.cpp.
const char * className ( ) [static]

Returns the name of this class.

Returns:
Name of this class.
MDrawData & operator= ( const MDrawData other ) [protected]

Operator =.

Parameters:
[in] other draw data input

MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData
MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData MDrawData