#include <MPxLocatorNode.h>
MPxLocatorNode allows the creation of user-defined locators. A locator is a DAG shaped that is drawn on the screen, but that has is not rendered. Locators are full dependency nodes and can have attributes and a compute method.
To create a locator, derive off of this class and override the draw method. The draw method can be overridden to draw custom geometry using standard OpenGL calls. The other methods of the parent class MPxNode may also be overridden to perform dependency node capabilities as well.
Public Member Functions | |
MPxLocatorNode () | |
virtual | ~MPxLocatorNode () |
virtual MPxNode::Type | type () const |
virtual void | draw (M3dView &view, const MDagPath &path, M3dView::DisplayStyle style, M3dView::DisplayStatus) |
virtual bool | isBounded () const |
virtual MBoundingBox | boundingBox () const |
unsigned int | color (M3dView::DisplayStatus displayStatus) |
MColor | colorRGB (M3dView::DisplayStatus displayStatus) |
virtual bool | excludeAsLocator () const |
virtual bool | isTransparent () const |
virtual bool | drawLast () const |
Static Public Attributes | |
static MObject | underWorldObject |
under world attribute | |
static MObject | localPosition |
local position attribute | |
static MObject | localPositionX |
X component of localPosition. | |
static MObject | localPositionY |
Y component of localPosition. | |
static MObject | localPositionZ |
Z component of localPosition. | |
static MObject | worldPosition |
world position attribute | |
static MObject | worldPositionX |
X component of worldPosition. | |
static MObject | worldPositionY |
Y component of worldPosition. | |
static MObject | worldPositionZ |
Z component of worldPosition. | |
static MObject | localScale |
local scale attribute | |
static MObject | localScaleX |
X component of localScale. | |
static MObject | localScaleY |
Y component of localScale. | |
static MObject | localScaleZ |
Z component of localScale. | |
static MObject | nodeBoundingBox |
bounding box attribute | |
static MObject | nodeBoundingBoxMin |
bounding box minimum point | |
static MObject | nodeBoundingBoxMinX |
X component of boundingBoxMin. | |
static MObject | nodeBoundingBoxMinY |
Y component of boundingBoxMin. | |
static MObject | nodeBoundingBoxMinZ |
Z component of boundingBoxMin. | |
static MObject | nodeBoundingBoxMax |
bounding box maximum point | |
static MObject | nodeBoundingBoxMaxX |
X component of boundingBoxMax. | |
static MObject | nodeBoundingBoxMaxY |
Y component of boundingBoxMax. | |
static MObject | nodeBoundingBoxMaxZ |
Z component of boundingBoxMax. | |
static MObject | nodeBoundingBoxSize |
bounding box size vector | |
static MObject | nodeBoundingBoxSizeX |
X component of boundingBoxSize. | |
static MObject | nodeBoundingBoxSizeY |
Y component of boundingBoxSize. | |
static MObject | nodeBoundingBoxSizeZ |
Z component of boundingBoxSize. | |
static MObject | center |
object center attribute | |
static MObject | boundingBoxCenterX |
X component of boundingBoxCenter. | |
static MObject | boundingBoxCenterY |
Y component of boundingBoxCenter. | |
static MObject | boundingBoxCenterZ |
Z component of boundingBoxCenter. | |
static MObject | matrix |
matrix attribute | |
static MObject | inverseMatrix |
inverse matrix attribute | |
static MObject | worldMatrix |
world matrix attribute | |
static MObject | worldInverseMatrix |
inverse world matrix attribute | |
static MObject | parentMatrix |
parent matrix attribute | |
static MObject | parentInverseMatrix |
inverse parent matrix attribute | |
static MObject | visibility |
visibility attribute | |
static MObject | intermediateObject |
intermediate object attribute | |
static MObject | isTemplated |
template attribute | |
static MObject | instObjGroups |
instances object group info attribute | |
static MObject | objectGroups |
object groups attributes | |
static MObject | objectGrpCompList |
component in object groups attribute | |
static MObject | objectGroupId |
group id attribute | |
static MObject | objectGroupColor |
group id attribute | |
static MObject | useObjectColor |
controls choice of wireframe dormant object color | |
static MObject | objectColor |
the per object dormant wireframe color |
MPxLocatorNode::MPxLocatorNode | ( | ) |
Constructor
Class constructor.
MPxLocatorNode::~MPxLocatorNode | ( | ) | [virtual] |
Destructor
Class destructor.
MPxNode::Type MPxLocatorNode::type | ( | ) | const [virtual] |
This method returns the type of the node. This method should not be overridden by the user. It will return MPxNode::kLocatorNode.
Reimplemented from MPxNode.
void MPxLocatorNode::draw | ( | M3dView & | view, | |
const MDagPath & | path, | |||
M3dView::DisplayStyle | style, | |||
M3dView::DisplayStatus | status | |||
) | [virtual] |
Overriding this method allows the drawing of custom geometry using standard OpenGL calls. The OpenGL state should be left in the same state that it was in previously. The OpenGL routine glPushAttrib may be used to make this easier.
When this routine is called, the following conditions may be assumed:
[in] | view | 3D view that is being drawn into |
[in] | path | to this locator in the DAG |
[in] | style | style to draw object in |
[in] | status | selection status of object |
bool MPxLocatorNode::isBounded | ( | ) | const [virtual] |
This method should be overridden to return true if the user supplies a bounding box routine. Supplying a bounding box routine makes refresh and selection more efficient.
MBoundingBox MPxLocatorNode::boundingBox | ( | ) | const [virtual] |
This method should be overridden to return a bounding box for the locator. If this method is overridden, then MPxLocatorNode::isBounded should also be overridden to return true.
unsigned int MPxLocatorNode::color | ( | M3dView::DisplayStatus | displayStatus | ) |
This method returns the index of the color that is the default draw color for the given display status. The index should be used with the methods of M3dView. The value is not an index into the OpenGL color table.
The index that is returned will be into the active, dormant, or template color tables depending on the display status passed in.
[in] | displayStatus | display status |
MColor MPxLocatorNode::colorRGB | ( | M3dView::DisplayStatus | displayStatus | ) |
This method returns the RGB values of the default draw color for the given display status.
[in] | displayStatus | display status |
bool MPxLocatorNode::excludeAsLocator | ( | ) | const [virtual] |
When the modelPanel is set to not draw locators, returing true will also not draw the custom locator. If false is returned, the custom locator will also be drawn.
The default return value is true.
bool MPxLocatorNode::isTransparent | ( | ) | const [virtual] |
Indicates that this locator uses transparency during draw method calls. Objects with transparency must be drawn in a special queue, i.e. after all opaque objects are drawn.
The default return value is false.
bool MPxLocatorNode::drawLast | ( | ) | const [virtual] |
Indicates that this locator should be the last item draw in a given refresh cycle. Objects drawn out-of-order will not preserve the proper transparency sorting. Conflicts among multiple objects with the drawLast indicator set to TRUE will be resolved by their order in the Outliner, where they will be drawn top-to-bottom.
The default return value is false.
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |