#include
<MDrawRequest.h>
List of all
members.
Detailed Description
A draw reqeust used in the draw methods of
MPxSurfaceShapeUI.
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 its creation. So you don't have to set any of this
information unless you want to change it.
Information automatically set by MDrawInfo::getPrototype
:
- path path to object to be drawn
- view view to draw in
- matrix world matrix for object
- display appearance how object should be drawn
- display status active, dormant etc.
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.
enum {
kDrawVertices,
kDrawWireframe,
kDrawWireframeOnShaded,
kDrawSmoothShaded,
kDrawFlatShaded,
kLastToken
};
-
apiMeshShapeUI.cpp,
apiMeshShapeUI.h,
apiSimpleShapeUI.cpp,
apiSimpleShapeUI.h,
blindDataShader.cpp,
blindDataShader.h,
hwAnisotropicShader_NV20.cpp,
hwAnisotropicShader_NV20.h,
hwColorPerVertexShader.cpp,
hwDecalBumpShader_NV20.cpp,
hwDecalBumpShader_NV20.h,
hwPhongShader.cpp,
hwPhongShader.h,
hwReflectBumpShader_NV20.cpp,
hwReflectBumpShader_NV20.h,
hwRefractReflectShader_NV20.cpp,
hwRefractReflectShader_NV20.h,
hwToonShader_NV20.cpp,
hwToonShader_NV20.h,
hwUnlitShader.cpp,
hwUnlitShader.h,
pnTrianglesNode.cpp,
pnTrianglesNode.h, and
quadricShape.cpp.
Constructor & Destructor Documentation
MDrawRequest::MDrawRequest |
( |
|
) |
|
Copy constructor.
- Parameters:
-
MDrawRequest::~MDrawRequest |
( |
|
) |
|
Member Function Documentation
M3dView MDrawRequest::view |
( |
|
) |
const |
Returns the view where drawing will be done.
void MDrawRequest::setView |
( |
M3dView & |
theView |
) |
|
Sets the view where drawing will be done.
const MDagPath MDrawRequest::multiPath |
( |
|
) |
const |
Returns the path to the object to be drawn.
void MDrawRequest::setMultiPath |
( |
const MDagPath & |
thePath |
) |
|
Sets the path to the object to be drawn.
MObject MDrawRequest::component |
( |
|
) |
const |
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 |
) |
|
Set a component to be drawn.
- Parameters:
-
[in] |
comp |
component to be drawn |
Returns the object specific draw data.
void MDrawRequest::setDrawData |
( |
MDrawData & |
data |
) |
|
Set the object specific draw data.
- Parameters:
-
Return the state of object (active, dormant, etc.).
Set the state of object (active, dormant, etc.).
- Parameters:
-
[in] |
status |
display status |
bool MDrawRequest::displayCulling |
( |
|
) |
const |
Returns the state of the culling flag for the object.
void MDrawRequest::setDisplayCulling |
( |
bool |
value |
) |
|
Sets the state of the culling flag for the object.
- Parameters:
-
[in] |
value |
culling value to be set |
bool MDrawRequest::displayCullOpposite |
( |
|
) |
const |
Returns the state of the culling flag for the object.
void MDrawRequest::setDisplayCullOpposite |
( |
bool |
value |
) |
|
Sets the state of the culling flag for the object.
- Parameters:
-
[in] |
value |
culling value to be set |
Returns how the object should be drawn (wireframe, shaded,
etc.).
Sets how the object should be drawn (wireframe, shaded,
etc.).
- Parameters:
-
[in] |
style |
display style to set |
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.
- Parameters:
-
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.
- Parameters:
-
[in] |
value |
index into the color table |
[in] |
table |
color table |
Returns the shaded material.
void MDrawRequest::setMaterial |
( |
MMaterial & |
material |
) |
|
Returns the shaded material.
- Parameters:
-
[in] |
material |
the material to set |
bool MDrawRequest::isTransparent |
( |
|
) |
const |
Returns the transparency state of the object.
void MDrawRequest::setIsTransparent |
( |
bool |
value |
) |
|
Sets the transparency state of the object.
- Parameters:
-
[in] |
value |
the transparency value |
bool MDrawRequest::drawLast |
( |
|
) |
const |
Returns the order in which this object will be drawn.
void MDrawRequest::setDrawLast |
( |
bool |
value |
) |
|
Specifies the order in which this object will be drawn.
- Parameters:
-
[in] |
value |
draw last flag |
int MDrawRequest::token |
( |
|
) |
const |
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 |
) |
|
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.
Assignment operator.
- Parameters:
-