MPxFieldNode Class Reference
[OpenMayaFX - API module for effectsProxy classes]

#include <MPxFieldNode.h>

Inheritance diagram for MPxFieldNode:

Inheritance graph
[legend]
Collaboration diagram for MPxFieldNode:

Collaboration graph
[legend]

List of all members.


Detailed Description

Base class for user defined fields.

MPxFieldNode allows the creation and manipulation of dependency graph nodes representing fields. This is the top level of a hierarchy of field node function sets. It permits manipulation of the attributes common to all types of fields.

Examples:

dynExprField.h, and torusField.h.


Public Member Functions

 MPxFieldNode ()
virtual ~MPxFieldNode ()
virtual MPxNode::Type type () const
virtual MStatus compute (const MPlug &plug, MDataBlock &dataBlock)
virtual MStatus getForceAtPoint (const MVectorArray &point, const MVectorArray &velocity, const MDoubleArray &mass, MVectorArray &force, double deltaTime)
virtual MStatus iconSizeAndOrigin (GLuint &width, GLuint &height, GLuint &xbo, GLuint &ybo)
virtual MStatus iconBitmap (GLubyte *bitmap)
virtual void draw (M3dView &view, const MDagPath &path, M3dView::DisplayStyle style, M3dView::DisplayStatus)
virtual double falloffCurve (const double param, MStatus *ReturnStatus=NULL)
virtual bool isFalloffCurveConstantOne (MStatus *ReturnStatus=NULL)

Static Public Attributes

static MObject mMagnitude
 magnitude attribute
static MObject mAttenuation
 attenuation attribute
static MObject mMaxDistance
 maximum distance attribute
static MObject mUseMaxDistance
 flag for maximum distance attribute
static MObject mApplyPerVertex
 flag for per vertex attribute
static MObject mInputData
 input attribute compound, multi
static MObject mInputPositions
 child attribute, multi
static MObject mInputVelocities
 child attribute, multi
static MObject mInputMass
 child attribute, multi
static MObject mDeltaTime
 child attribute
static MObject mInputForce
 forces input attribute, multi
static MObject mOutputForce
 forces output attribute, multi
static MObject mOwnerCentroidX
 X component of mOwnerCentroid.
static MObject mOwnerCentroidY
 Y component of mOwnerCentroid.
static MObject mOwnerCentroidZ
 Z component of mOwnerCentroid.
static MObject mOwnerCentroid
 owner centroid attribute
static MObject mOwnerPosData
 owner position attribute, multi
static MObject mOwnerVelData
 owner velocity attribute, multi
static MObject mWorldMatrix
 world matrix attribute
static MObject mInputPPData
 Attribute for input pp data from particleShape.
static MObject mOwnerPPData
 Attribute for input pp data from owner particleShape.

Constructor & Destructor Documentation

MPxFieldNode::MPxFieldNode (  ) 

Class constructor.

MPxFieldNode::~MPxFieldNode (  )  [virtual]

The class destructor.


Member Function Documentation

MPxNode::Type MPxFieldNode::type (  )  const [virtual]

This method returns the type of the node. This method should not be overridden by the user. It will return MPxNode::kFieldNode.

Returns:
The type of node
Status Codes:

Reimplemented from MPxNode.

MStatus MPxFieldNode::compute ( const MPlug plug,
MDataBlock dataBlock 
) [virtual]

This method should be overridden in user defined nodes.

Recompute the given output based on the nodes inputs. The plug represents the data value that needs to be recomputed, and the data block holds the storage for all of the node's attributes.

The MDataBlock will provide smart handles for reading and writing this node's attribute values. Only these values should be used when performing computations.

When evaluating the dependency graph, Maya will first call the compute method for this node. If the plug that is provided to the compute indicates that that the attribute was defined by the Maya parent node, the compute method should return MS::kUnknownParameter. When this occurs, Maya will call the internal Maya node from which the user-defined node is derived to compute the plug's value.

This means that a user defined node does not need to be concerned with computing inherited output attributes. However, if desired, these can be safely recomputed by this method to change the behaviour of the node.

Parameters:
[in] plug plug representing the attribute that needs to be recomputed
[in] dataBlock data block containing storage for the node's attributes
Returns:
Status code
Status Codes:

Reimplemented from MPxNode.

Examples:

MStatus MPxFieldNode::getForceAtPoint ( const MVectorArray point,
const MVectorArray velocity,
const MDoubleArray mass,
MVectorArray force,
double  deltaTime 
) [virtual]

This method is not required to be overridden, it is only necessary for compatibility with the MFnField function set.

Compute the force of a field on an array of points, given their position, velocity, and mass.

This method uses MVectorArray to represent the positions of a point.

Parameters:
[in] point array of positions for each point.
[in] velocity array of velocities for each point. If the length of the velocity array is 0, a velocity of 0.0 is assumed for all the points. Note the velocity array is a requirement for the Air and Drag fields to compute forces.
[in] mass array of mass values for each point. If the length of the mass array is 0, a mass of 1.0 is assumed for all the points.
[out] force output array of forces applied to each point. If the length of the force array supplied is 0, the array is automatically resized. If the contents of the force array contains data, the computed force is added to the supplied data. This can be useful to accumulate forces of multiple fields.
[in] deltaTime time increment in seconds
Returns:
Status code
Status Codes:
Examples:

MStatus MPxFieldNode::iconSizeAndOrigin ( GLuint &  width,
GLuint &  height,
GLuint &  xbo,
GLuint &  ybo 
) [virtual]

This method is not required to be overridden. The arguments have the same meaning as defined in OpenGL's glBitmap method.

Define the size and the origin for the icon.

Parameters:
[in] width the width of the icon in pixels. It needs to be a multiple of 32 on windows and a multiple of 16 on any other platform.
[in] height the height of the icon in pixels. It needs to be a multiple of 32 on windows and a multiple of 16 on any other platform.
[in] xbo the origin of the icon in x direction.
[in] ybo the origin of the icon in y direction.
Returns:
Status code
Status Codes:
Examples:

MStatus MPxFieldNode::iconBitmap ( GLubyte *  bitmap  )  [virtual]

This method is not required to be overridden. The arguments have the same meaning as defined in OpenGL's glBitmap method.

Define the bitmap for the icon. The memory in bitmap has been allocated according to the width and height in iconSizeAndOrigin().

Parameters:
[in] bitmap bits used to define the bitmap.
Returns:
Status code
Status Codes:
Examples:

void MPxFieldNode::draw ( M3dView view,
const MDagPath path,
M3dView::DisplayStyle  style,
M3dView::DisplayStatus   
) [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 node, 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 node in the DAG
[in] style style to draw object in
Examples:

double MPxFieldNode::falloffCurve ( const double  param,
MStatus ReturnStatus = NULL 
) [virtual]

Returns the falloff at the given parameter value.

Parameters:
[in] param Parameter value in the range [0.0, 1.0]
[out] ReturnStatus Status code
Returns:
The falloff value at the given the param.
Status Codes:

bool MPxFieldNode::isFalloffCurveConstantOne ( MStatus ReturnStatus = NULL  )  [virtual]

Returns true if the falloffCurve is a constant one (default) or false if not.

Parameters:
[out] ReturnStatus Status code
Returns:
true if the falloff curve is a constant one, false otherwise
Status Codes:


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