Public Member Functions | Protected Member Functions

MFnDistanceManip Class Reference

This reference page is linked to from the following overview topics: Base Manipulators, Manipulator Containers, Communication Between Manipulators and Nodes.


Search for all occurrences

Detailed Description

DistanceManip function set.

The DistanceManip allows the user to manipulate a point that is constrained to move along a line. This manipulator generates a single floating point value. Scaling factors can be used to determine how int the manipulator appears when it is drawn.

Examples:

footPrintManip.cpp, moveManip.cpp, and swissArmyManip.cpp.

#include <MFnDistanceManip.h>

Inheritance diagram for MFnDistanceManip:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual MFn::Type type () const
 Function set type.
virtual ~MFnDistanceManip ()
 Destructor.
 MFnDistanceManip ()
 Default constructor.
 MFnDistanceManip (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor.
 MFnDistanceManip (const MDagPath &object, MStatus *ret=NULL)
 Constructor.
MObject create (MStatus *ReturnStatus=NULL)
 Creates a new DistanceManip.
MObject create (const MString &manipName, const MString &distanceName, MStatus *ReturnStatus=NULL)
 Creates a new DistanceManip.
MStatus connectToDistancePlug (MPlug &distancePlug)
 Connect to the distance plug.
MStatus setStartPoint (const MPoint &point)
 Sets the start point of the DistanceManip.
MStatus setDirection (const MVector &vector)
 Sets the direction of the DistanceManip.
MStatus setDrawStart (bool state)
 Sets whether or not to draw the start of the DistanceManip.
MStatus setDrawLine (bool state)
 Sets whether or not to draw a line from the start to the end of the DistanceManip.
MStatus setScalingFactor (double scalingFactor)
 Sets the scaling factor.
bool isDrawStartOn (MStatus *ReturnStatus=NULL) const
 Returns whether or not the start of the DistanceManip is being drawn.
bool isDrawLineOn (MStatus *ReturnStatus=NULL) const
 Returns whether or not a line is being drawn from the start to the end of the DistanceManip.
double scalingFactor (MStatus *ReturnStatus=NULL) const
 Returns the scaling factor.
unsigned int distanceIndex (MStatus *ReturnStatus=NULL) const
 Returns the index of the distance.
unsigned int directionIndex (MStatus *ReturnStatus=NULL) const
 Returns the index of the direction.
unsigned int startPointIndex (MStatus *ReturnStatus=NULL) const
 Returns the index of the start point of the DistanceManip.
unsigned int currentPointIndex (MStatus *ReturnStatus=NULL) const
 Returns the index of the current point of the DistanceManip.
 MFnDistanceManip (const MObject &object, MStatus *ret=NULL)
 Constructor.

Protected Member Functions

virtual const char * className () const
 Class name.

Constructor & Destructor Documentation

~MFnDistanceManip ( ) [virtual]

Destructor.

Class destructor.

MFnDistanceManip ( MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:
MFnDistanceManip ( const MDagPath object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given constant MDagPath object.

Parameters:
[in]objectThe const MDagPath to attach the function set to
[out]ReturnStatusThe return status
Status Codes:
MFnDistanceManip ( const MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:

Member Function Documentation

MFn::Type type ( ) const [virtual]

Function set type.

Return the class type : MFn::kDistanceManip.

Reimplemented from MFnManip3D.

const char * className ( ) const [protected, virtual]

Class name.

Return the class name : "MFnDistanceManip".

Reimplemented from MFnManip3D.

MObject create ( MStatus ReturnStatus = NULL)

Creates a new DistanceManip.

This function set's object is set to be the new manipulator.

This method should only be used to create a non-composite DistanceManip.

The name that appears in the feedback line is "Distance"

Parameters:
[out]ReturnStatusreturn status
Returns:
Newly created DistanceManip
Status Codes:
MObject create ( const MString manipName,
const MString distanceName,
MStatus ReturnStatus = NULL 
)

Creates a new DistanceManip.

This function set's object is set to be the new manipulator.

This method should only be used to create a non-composite DistanceManip.

The name that appears in the feedback line is specified by the distanceName argument.

Parameters:
[in]manipNameName of the manip for UI purposes.
[in]distanceNameLabel for the distance value which appears in the feedback line.
[out]ReturnStatusStatus code.
Returns:
Newly created DistanceManip.
Status Codes:

Reimplemented from MFnDependencyNode.

MStatus connectToDistancePlug ( MPlug distancePlug)

Connect to the distance plug.

The data type corresponding to the distancePlug is a double. (Note that MFnUnitAttribute::kDistance is used to specify a distance attribute.)

Parameters:
[in]distancePlugthe distance plug
Returns:
Examples:
swissArmyManip.cpp.
MStatus setStartPoint ( const MPoint startPoint)

Sets the start point of the DistanceManip.

Parameters:
[in]startPointthe start point of the DistanceManip
Returns:
MStatus setDirection ( const MVector direction)

Sets the direction of the DistanceManip.

Parameters:
[in]directionthe direction of the DistanceManip
Returns:
MStatus setDrawStart ( bool  state)

Sets whether or not to draw the start of the DistanceManip.

The start of the DistanceManip is indicated by a grey dot. By default the start is not drawn.

Parameters:
[in]statewhether or not the start should be drawn
Returns:
MStatus setDrawLine ( bool  state)

Sets whether or not to draw a line from the start to the end of the DistanceManip.

By default the line is drawn.

Parameters:
[in]statewhether or not the line should be drawn
Returns:
MStatus setScalingFactor ( double  scalingFactor)

Sets the scaling factor.

The scaling factor is used to determine how int the DistanceManip appears when it is drawn. The default scaling factor is 1.0.

Parameters:
[in]scalingFactorthe scaling factor
Returns:
bool isDrawStartOn ( MStatus ReturnStatus = NULL) const

Returns whether or not the start of the DistanceManip is being drawn.

By default the start is not drawn.

Parameters:
[out]ReturnStatusreturn status
Returns:
  • true the start of the DistanceManip is being drawn
  • false the start of the DistanceManip is not being drawn
Status Codes:
bool isDrawLineOn ( MStatus ReturnStatus = NULL) const

Returns whether or not a line is being drawn from the start to the end of the DistanceManip.

By default the line is drawn.

Parameters:
[out]ReturnStatusreturn status
Returns:
  • true the line of the DistanceManip is being drawn
  • false the line of the DistanceManip is not being drawn
Status Codes:
double scalingFactor ( MStatus ReturnStatus = NULL) const

Returns the scaling factor.

The scaling factor is used to determine how int the DistanceManip appears when it is drawn.

Parameters:
[out]ReturnStatusreturn status
Returns:
Scaling factor
Status Codes:
unsigned int distanceIndex ( MStatus ReturnStatus = NULL) const

Returns the index of the distance.

The data type corresponding to this index is a double.

Parameters:
[out]ReturnStatusreturn status
Returns:
Distance index
Status Codes:
unsigned int directionIndex ( MStatus ReturnStatus = NULL) const

Returns the index of the direction.

The data type corresponding to this index is MFnNumericData::k3Double.

Parameters:
[out]ReturnStatusreturn status
Returns:
Direction index
Status Codes:
unsigned int startPointIndex ( MStatus ReturnStatus = NULL) const

Returns the index of the start point of the DistanceManip.

The data type corresponding to this index is MFnNumericData::k3Double.

Parameters:
[out]ReturnStatusreturn status
Returns:
Start point index
Status Codes:
Examples:
swissArmyManip.cpp.
unsigned int currentPointIndex ( MStatus ReturnStatus = NULL) const

Returns the index of the current point of the DistanceManip.

The data type corresponding to this index is MFnNumericData::k3Double.

Parameters:
[out]ReturnStatusreturn status
Returns:
Current point index
Status Codes:

MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip
MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip MFnDistanceManip