#include <MPxSurfaceShapeUI.h>
The base class for the UI portion of all user defined shapes.
Public Types | |
enum | UVSelectionType { kSelectMeshUVs, kSelectMeshVerts, kSelectMeshFaces, kSelectMeshEdges } |
Selection modes for UVs. More... | |
Public Member Functions | |
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 |
virtual bool | canDrawUV () const |
virtual void | drawUV (M3dView &view, const MTextureEditorDrawInfo &) const |
virtual bool | selectUV (M3dView &, UVSelectionType selType, int xmin, int ymin, int xmax, int ymax, bool singleSelect, MSelectionList &selList) const |
MPxSurfaceShape * | surfaceShape () const |
MMaterial | material (MDagPath &path) const |
Friends | |
class | MDrawRequest |
class | MDrawInfo |
MPxSurfaceShapeUI::MPxSurfaceShapeUI | ( | ) |
Class constructor.
MPxSurfaceShapeUI::~MPxSurfaceShapeUI | ( | ) | [virtual] |
Class destructor.
void MPxSurfaceShapeUI::getDrawData | ( | void * | geom, | |
MDrawData & | data | |||
) |
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.
[in] | geom | the geometry necessary to draw the shape |
[out] | data | the draw data to be initialized |
void MPxSurfaceShapeUI::getDrawRequests | ( | const MDrawInfo & | info, | |
bool | objectAndActiveOnly, | |||
MDrawRequestQueue & | queue | |||
) | [virtual] |
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.
[in] | info | the drawing state information |
[in] | 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. |
[in] | queue | the drawing queue to place the draw request on |
void MPxSurfaceShapeUI::draw | ( | const MDrawRequest & | request, | |
M3dView & | view | |||
) | const [virtual] |
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.
[in] | request | the drawing request |
[in] | view | the interactive 3d view in which to draw |
bool MPxSurfaceShapeUI::select | ( | MSelectInfo & | selectInfo, | |
MSelectionList & | selectionList, | |||
MPointArray & | worldSpaceSelectPts | |||
) | const [virtual] |
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.
[in] | selectInfo | the selection state information |
[in] | selectionList | this list does not need to be modified, but it must be passed into the MSelectInfo::addSelection method |
[in] | worldSpaceSelectPts | this list does not need to be modified, but it must be passed into the MSelectInfo::addSelection method |
bool MPxSurfaceShapeUI::canDrawUV | ( | ) | const [virtual] |
Called by Maya to determine if this surface shape supports UV drawing.
void MPxSurfaceShapeUI::drawUV | ( | M3dView & | view, | |
const MTextureEditorDrawInfo & | info | |||
) | const [virtual] |
This method is called when the surface shape is selected and the texture view is open. Users should override this method if their custom shape supports UVs.
[in] | view | the texture drawing view |
[in] | info | the drawing parameters. |
bool MPxSurfaceShapeUI::selectUV | ( | M3dView & | view, | |
MPxSurfaceShapeUI::UVSelectionType | selType, | |||
int | xmin, | |||
int | ymin, | |||
int | xmax, | |||
int | ymax, | |||
bool | singleSelect, | |||
MSelectionList & | selList | |||
) | const [virtual] |
This method is called when the user performs a selection within the texture view. The method is called only when the surface shape is member of the active selection list.
Maya provides the current viewport instance, the type of the selection, the extents of the selection rectangle (in viewport coordinates), and if the selection mode is single selection. The API user is expected to fill the selection list and return a result of true if 'something was selected'.
To properly use this method, you must make sure that you have a valid component type that Maya can recognize. Selection tests can be done using a pick buffer or by spatially determining the selected objects.
Important Currently Maya does not know how to manipulate custom UV components. This method only provides the facilities to visualize what has been selected in the viewport. The API user is responsible for implementing commands that can manipulate the currently selected UVs.
[in] | view | the texture drawing view |
[in] | selType | the selection type |
[in] | xmin | minimum x coordinate value of the selection rectangle. |
[in] | ymin | minimum y coordinate value of the selection rectangle. |
[in] | xmax | maximum x coordinate value of the selection rectangle. |
[in] | ymax | maximum y coordinate value of the selection rectangle. |
[in] | singleSelect | indicates if the user is in single selection mode. |
[in] | selList | the selection list to be populated. |
MPxSurfaceShape * MPxSurfaceShapeUI::surfaceShape | ( | ) | const |
Returns the non-ui shape associated with current instance of this class.
Returns the material associated with this shape. The user must supply a DAG path as a shape can have several materials if instanced.
[in] | path | the path for which to get the material |
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |