class MPxSurfaceShapeUI

Jump to documentation

drawing and selection for user defined shapes (OpenMayaUI) (OpenMayaMPx.py)

public members:

MPxSurfaceShapeUI ()
virtual ~MPxSurfaceShapeUI ()
void getDrawData ( void * geom, MDrawData & )
virtual void getDrawRequests ( const MDrawInfo &, bool objectAndActiveOnly, MDrawRequestQueue & requests )
virtual void draw ( const MDrawRequest &, M3dView & view ) const
virtual bool select ( MSelectInfo &selectInfo, MSelectionList &selectionList, MPointArray &worldSpaceSelectPts ) const
MPxSurfaceShape * surfaceShape () const
MMaterial material ( MDagPath & path ) const

Documentation

drawing and selection for user defined shapes (OpenMayaUI) (OpenMayaMPx.py)
Description

The base class for the UI portion of all user defined shapes.

Functions

MPxSurfaceShapeUI:: MPxSurfaceShapeUI ()

Description

Class constructor.

MPxSurfaceShapeUI:: ~MPxSurfaceShapeUI ()

Constructor

Class destructor.

void MPxSurfaceShapeUI:: getDrawData ( void * geom, MDrawData & data )

Description

Sets up draw data for the shape. The draw data is meant to be a light weight class which can be used to pass geometry data through draw requests.

Arguments

  • geom the geometry necessary to draw the shape
  • data the draw data to be initialized

void MPxSurfaceShapeUI:: getDrawRequests ( const MDrawInfo & info, bool objectAndActiveOnly, MDrawRequestQueue & queue )

Description

This routine must be overriden if the shape is to be drawn in the interactive display. This function places drawing requests on maya's drawing queue and is called whenever the view is refreshed and the shape needs to be redrawn.

Arguments

  • info the drawing state information
  • objectAndActiveOnly This parameter is used to determine if draw requests for components need to be supplied. If false, some or all components are active and draw requests must be built for all components.
  • queue the drawing queue to place the draw request on

void MPxSurfaceShapeUI:: draw ( const MDrawRequest & request, M3dView & view ) const

Description

This routine must be overriden if the shape is to be drawn in the interactive display. Maya will call this routine with requests that have been previously added to the drawing queue.

Arguments

  • reqeust the drawing request
  • view the interactive 3d view in which to draw

bool MPxSurfaceShapeUI:: select ( MSelectInfo & selectInfo, MSelectionList & selectionList, MPointArray & worldSpaceSelectPts ) const

Description

This routine must be overriden if the shape is to support interactive object and/or component selection. The implementation of this method should call selectInfo.addSelection with information about the selected item and its selection mask. For single click selection, detected using the selectInfo.singleSection() method, the hit point should also be passed as an argument to selectInfo.addSelection.

Arguments

  • selectInfo the selection state information
  • selectionList this list does not need to be modified, but it must be passed into the MSelectInfo::addSelection method
  • worldSpaceSelectPts this list does not need to be modified, but it must be passed into the MSelectInfo::addSelection method

Return Value

  • true something was selected
  • false nothing was selected

MPxSurfaceShape * MPxSurfaceShapeUI:: surfaceShape () const

Description

Returns the non-ui shape associated with current instance of this class.

Return Value

  • the non ui shape object

MMaterial MPxSurfaceShapeUI:: material ( MDagPath & path ) const

Description

Returns the material associated with this shape. The user must supply a DAG path as a shape can have several materials if instanced.

Arguments

  • path the path for which to get the material

Return Value

  • the material associated with this shape

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright