MPxLocatorNode Class Reference
[OpenMayaUI - API module for user interfaceProxy classes]

#include <MPxLocatorNode.h>
Inheritance diagram for MPxLocatorNode:
Inheritance graph
[legend]
Collaboration diagram for MPxLocatorNode:
Collaboration graph
[legend]

List of all members.


Detailed Description

Base class for user defined locators.

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.

Examples:

curvedArrowsNode.cpp, cvColorNode.cpp, footPrintManip.cpp, footPrintNode.cpp, and swissArmyManip.cpp.


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

Constructor & Destructor Documentation

MPxLocatorNode::MPxLocatorNode (  ) 

Constructor

Class constructor.

MPxLocatorNode::~MPxLocatorNode (  )  [virtual]

Destructor

Class destructor.


Member Function Documentation

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.

Returns:
The type of node
Status Codes:

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:

  • the correct transform matrix will be loaded for the locator, so the geometry should be drawn in local space
  • the correct default color will be set for wire frame drawing given the object's state (eg active, dormant, etc.)
  • the object is not invisible or hidden
  • if the object has a bounding box, then the bounding box is at least partially in the frustum
As a convenience, this draw method will also be used by OpenGL's selection mechanism to determine whether this object gets selected by a particular mouse event. The user does not need to write a separate selection routine.
Parameters:
[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
Examples:

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.

Returns:
A boolean value indicating whether a bounding box routine has been supplied
Examples:

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.

Returns:
The bounding box of the locator
Examples:

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.

Parameters:
[in]  displayStatus  display status
Returns:
The index of the color

MColor MPxLocatorNode::colorRGB ( M3dView::DisplayStatus  displayStatus  ) 

This method returns the RGB values of the default draw color for the given display status.

Parameters:
[in]  displayStatus  display status
Returns:
The color

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.

Returns:
true if the custom locator should be treated like a standard maya locator.

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.

Returns:
true if the locator uses transparency while drawing, false otherwise.
Examples:

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.

Returns:
true, the locator will be drawn after all other objects in the scene.
Examples:

Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6