Public Member Functions | Static Public Member Functions | Static Public Attributes

MPxLocatorNode Class Reference

This reference page is linked to from the following overview topics: Parent class descriptions.


Search for all occurrences

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.

#include <MPxLocatorNode.h>

Inheritance diagram for MPxLocatorNode:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MPxLocatorNode ()
  Constructor
virtual  ~MPxLocatorNode ()
  Destructor
virtual MPxNode::Type  type () const
  This method returns the type of the node.
virtual void  draw (M3dView &view, const MDagPath &path, M3dView::DisplayStyle style, M3dView::DisplayStatus)
  Overriding this method allows the drawing of custom geometry using standard OpenGL calls.
virtual bool  isBounded () const
  This method should be overridden to return true if the user supplies a bounding box routine.
virtual MBoundingBox  boundingBox () const
  This method should be overridden to return a bounding box for the locator.
unsigned int  color (M3dView::DisplayStatus displayStatus)
  This method returns the index of the color that is the default draw color for the given display status.
MColor  colorRGB (M3dView::DisplayStatus displayStatus)
  This method returns the RGB values of the default draw color for the given display status.
virtual bool  excludeAsLocator () const
  When the modelPanel is set to not draw locators, returing true will also not draw the custom locator.
virtual bool  isTransparent () const
  Indicates that this locator uses transparency during ::draw method calls.
virtual bool  drawLast () const
  Indicates that this locator should be the last item draw in a given refresh cycle.

Static Public Member Functions

static const char *  className ()
  Returns the name of this class.

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

Constructor

Class constructor.

~MPxLocatorNode ( ) [virtual]

Destructor

Class destructor.


Member Function Documentation

MPxNode::Type 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 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:
curvedArrowsNode.cpp, cvColorNode.cpp, footPrintManip.cpp, footPrintNode.cpp, and swissArmyManip.cpp.
bool 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:
curvedArrowsNode.cpp, cvColorNode.cpp, footPrintManip.cpp, footPrintNode.cpp, and swissArmyManip.cpp.
MBoundingBox 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:
curvedArrowsNode.cpp, footPrintManip.cpp, footPrintNode.cpp, and swissArmyManip.cpp.
unsigned int 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 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 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 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:
curvedArrowsNode.cpp.
bool 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:
curvedArrowsNode.cpp.
const char * className ( ) [static]

Returns the name of this class.

Returns:
The name of this class.

Reimplemented from MPxNode.


MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode
MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode MPxLocatorNode