MFnNumericData Class Reference
[OpenMaya - API module for common classesFunctionSet classes]

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

List of all members.


Detailed Description

Numeric data function set.

MFnNumericData allows the creation and manipulation of numeric data objects for use in the dependency graph. Normally, data objects are not required for the transmission of numeric data. The graph supports numeric types directly (see the methods of MDataHandle).

Numeric data objects are useful if you have an attribute that accepts generic data. A generic attribute can accept multiple types of data, so you cannot hardwire it to accept a specific type of numeric data. So, generic attributes can only accept numeric data in the form of actual data objects.

This function set only supports pairs and triples of numeric data.

Examples:

apiMeshShape.cpp, blindDataShader.cpp, cgfxAttrDef.cpp, componentScaleManip.cpp, curvedArrowsNode.cpp, D3DViewportRenderer.cpp, footPrintManip.cpp, genericAttributeNode.cpp, geometrySurfaceConstraint.cpp, GLSLShaderNode.cpp, hwAnisotropicShader_NV20.cpp, hwDecalBumpShader_NV20.cpp, hwReflectBumpShader_NV20.cpp, hwToonShader_NV20.cpp, hwUnlitShader.cpp, pnTrianglesNode.cpp, polyModifierCmd.cpp, renderAccessNode.cpp, rotateManip.cpp, surfaceBumpManip.cpp, and swissArmyManip.cpp.


Public Types

enum   Type {
   kInvalid, kBoolean, kByte, kChar,
   kShort, k2Short, k3Short, kLong,
   kInt = kLong, k2Long, k2Int = k2Long, k3Long,
   k3Int = k3Long, kFloat, k2Float, k3Float,
   kDouble, k2Double, k3Double, k4Double,
   kAddr, kLast
}
  Supported numerical types. More...

Public Member Functions

virtual MFn::Type  type () const
  Function set type.
virtual  ~MFnNumericData ()
  Destructor.
  MFnNumericData ()
  Default constructor.
  MFnNumericData (MObject &object, MStatus *ReturnStatus=NULL)
  Constructor.
MObject  create (Type dataType, MStatus *ReturnStatus=NULL)
Type  numericType (MStatus *ReturnStatus=NULL)
MStatus  getData (short &val1, short &val2)
  NO SCRIPT SUPPORT.
MStatus  getData (int &val1, int &val2)
  NO SCRIPT SUPPORT.
MStatus  getData (float &val1, float &val2)
  NO SCRIPT SUPPORT.
MStatus  getData (double &val1, double &val2)
  NO SCRIPT SUPPORT.
MStatus  getData (short &val1, short &val2, short &val3)
  NO SCRIPT SUPPORT.
MStatus  getData (int &val1, int &val2, int &val3)
  NO SCRIPT SUPPORT.
MStatus  getData (float &val1, float &val2, float &val3)
  NO SCRIPT SUPPORT.
MStatus  getData (double &val1, double &val2, double &val3)
  NO SCRIPT SUPPORT.
MStatus  getData (double &val1, double &val2, double &val3, double &val4)
  NO SCRIPT SUPPORT.
MStatus  setData (short val1, short val2)
  NO SCRIPT SUPPORT.
MStatus  setData (int val1, int val2)
  NO SCRIPT SUPPORT.
MStatus  setData (float val1, float val2)
  NO SCRIPT SUPPORT.
MStatus  setData (double val1, double val2)
  NO SCRIPT SUPPORT.
MStatus  setData (short val1, short val2, short val3)
  NO SCRIPT SUPPORT.
MStatus  setData (int val1, int val2, int val3)
  NO SCRIPT SUPPORT.
MStatus  setData (float val1, float val2, float val3)
  NO SCRIPT SUPPORT.
MStatus  setData (double val1, double val2, double val3)
  NO SCRIPT SUPPORT.
MStatus  setData (double val1, double val2, double val3, double val4)
  NO SCRIPT SUPPORT.
  MFnNumericData (const MObject &object, MStatus *ReturnStatus=NULL)
  NO SCRIPT SUPPORT.
MStatus  getData2Short (short &val1, short &val2)
MStatus  getData2Int (int &val1, int &val2)
MStatus  getData2Float (float &val1, float &val2)
MStatus  getData2Double (double &val1, double &val2)
MStatus  getData3Short (short &val1, short &val2, short &val3)
MStatus  getData3Int (int &val1, int &val2, int &val3)
MStatus  getData3Float (float &val1, float &val2, float &val3)
MStatus  getData3Double (double &val1, double &val2, double &val3)
MStatus  getData4Double (double &val1, double &val2, double &val3, double &val4)
MStatus  setData2Short (short val1, short val2)
MStatus  setData2Int (int val1, int val2)
MStatus  setData2Float (float val1, float val2)
MStatus  setData2Double (double val1, double val2)
MStatus  setData3Short (short val1, short val2, short val3)
MStatus  setData3Int (int val1, int val2, int val3)
MStatus  setData3Float (float val1, float val2, float val3)
MStatus  setData3Double (double val1, double val2, double val3)
MStatus  setData4Double (double val1, double val2, double val3, double val4)

Protected Member Functions

virtual const char *  className () const
  Class name.

Member Enumeration Documentation

Supported numerical types.

Enumerator:
kInvalid  Invalid data.
kBoolean  Boolean.
kByte  One byte.
kChar  One character.
kShort  One short.
k2Short  Two shorts.
k3Short  Three shorts.
kLong  One long. Same as int since "long" is not platform-consistent.
kInt  One int.
k2Long  Two longs. Same as 2 ints since "long" is not platform-consistent.
k2Int  Two ints.
k3Long  Three longs. Same as 3 ints since "long" is not platform-consistent.
k3Int  Three ints.
kFloat  One float.
k2Float  Two floats.
k3Float  Three floats.
kDouble  One double.
k2Double  Two doubles.
k3Double  Three doubles.
k4Double  Four doubles.
kAddr  An address.
kLast  Last value. Does not represent a real type, but can be used to loop on all possible types.

Reimplemented from MFnData.


Constructor & Destructor Documentation

MFnNumericData::MFnNumericData ( MObject object,
MStatus ReturnStatus = NULL  
)

Constructor.

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

Parameters:
[in]  object  The MObject to attach the function set to
[out]  ReturnStatus  the return status
Status Codes:

MFnNumericData::MFnNumericData ( const MObject object,
MStatus ReturnStatus = NULL  
)

NO SCRIPT SUPPORT.

Constructor

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

Parameters:
[in]  object  The MObject to attach the function set to
[out]  ReturnStatus  the return status
Status Codes:

Member Function Documentation

MFn::Type MFnNumericData::type (  )  const [virtual]

Function set type.

Return the class type : MFn::kNumericData

Reimplemented from MFnData.

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

Class name.

Return the class name : "MFnNumericData"

Reimplemented from MFnData.

MObject MFnNumericData::create ( Type  dataType,
MStatus ReturnStatus = NULL  
)

Creates a new data object of the given type. Only pair and triples of numeric data may be created (eg k3Float).

Parameters:
[in]  dataType  data type of object to create
[out]  ReturnStatus  return status
Returns:
A pointer to the new object
Status Codes:
  • kSuccess operation successful
  • kInvalidParameter cannot create an object of the given type
  • kInsufficientMemory out of memory
Examples:

MFnNumericData::Type MFnNumericData::numericType ( MStatus ReturnStatus = NULL  ) 

Returns the type of the numeric data object.

Parameters:
[out]  ReturnStatus  return status
Returns:
Type of data
Status Codes:
  • kSuccess operation successful
  • kFailure function set has no object

MStatus MFnNumericData::getData ( short &  val1,
short &  val2  
)

NO SCRIPT SUPPORT.

Gets the stored value of this data object as a pair of short integers. The data object must have been created as a pair of short integers for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of short integers, or function set has no object
Examples:

MStatus MFnNumericData::getData ( int &  val1,
int &  val2  
)

NO SCRIPT SUPPORT.

Gets the stored value of this data object as a pair of int integers. The data object must have been created as a pair of int integers for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of int integers, or function set has no object

MStatus MFnNumericData::getData ( float &  val1,
float &  val2  
)

NO SCRIPT SUPPORT.

Gets the stored value of this data object as a pair of floats. The data object must have been created as a pair of floats for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of floats, or function set has no object

MStatus MFnNumericData::getData ( double &  val1,
double &  val2  
)

NO SCRIPT SUPPORT.

Gets the stored value of this data object as a pair of doubles. The data object must have been created as a pair of doubles for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of doubles, or function set has no object

MStatus MFnNumericData::getData ( short &  val1,
short &  val2,
short &  val3  
)

NO SCRIPT SUPPORT.

Gets the stored value of this data object as a triple of short integers. The data object must have been created as a pair of short integers for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of short integers, or function set has no object

MStatus MFnNumericData::getData ( int &  val1,
int &  val2,
int &  val3  
)

NO SCRIPT SUPPORT.

Gets the stored value of this data object as a triple of int integers. The data object must have been created as a triple of int integers for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of int integers, or function set has no object

MStatus MFnNumericData::getData ( float &  val1,
float &  val2,
float &  val3  
)

NO SCRIPT SUPPORT.

Gets the stored value of this data object as a triple of floats. The data object must have been created as a triple of floats for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of floats, or function set has no object

MStatus MFnNumericData::getData ( double &  val1,
double &  val2,
double &  val3  
)

NO SCRIPT SUPPORT.

Gets the stored value of this data object as a triple of doubles. The data object must have been created as a triple of doubles for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of doubles, or function set has no object

MStatus MFnNumericData::getData ( double &  val1,
double &  val2,
double &  val3,
double &  val4  
)

NO SCRIPT SUPPORT.

Gets the stored value of this data object as a quadruple of doubles. The data object must have been created as a quadruple of doubles for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
[out]  val4  storage for the fourth element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a quadruple of doubles, or function set has no object

MStatus MFnNumericData::setData ( short  val1,
short  val2  
)

NO SCRIPT SUPPORT.

Sets the stored value of this data object as a pair of short integers. The data object must have been created as a pair of short integers for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of short integers, or function set has no object
Examples:

MStatus MFnNumericData::setData ( int  val1,
int  val2  
)

NO SCRIPT SUPPORT.

Sets the stored value of this data object as a pair of int integers. The data object must have been created as a pair of int integers for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of int integers, or function set has no object

MStatus MFnNumericData::setData ( float  val1,
float  val2  
)

NO SCRIPT SUPPORT.

Sets the stored value of this data object as a pair of floats. The data object must have been created as a pair of floats for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of floats, or function set has no object

MStatus MFnNumericData::setData ( double  val1,
double  val2  
)

NO SCRIPT SUPPORT.

Sets the stored value of this data object as a pair of doubles. The data object must have been created as a pair of doubles for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kDataIsNotOfThatType data is not a pair of doubles
  • kObjectDoesNotExist function set has no object

MStatus MFnNumericData::setData ( short  val1,
short  val2,
short  val3  
)

NO SCRIPT SUPPORT.

Sets the stored value of this data object as a triple of short integers. The data object must have been created as a triple of short integers for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of doubles, or function set has no object

MStatus MFnNumericData::setData ( int  val1,
int  val2,
int  val3  
)

NO SCRIPT SUPPORT.

Sets the stored value of this data object as a triple of int integers. The data object must have been created as a triple of int integers for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of int integers, or function set has no object

MStatus MFnNumericData::setData ( float  val1,
float  val2,
float  val3  
)

NO SCRIPT SUPPORT.

Sets the stored value of this data object as a triple of floats. The data object must have been created as a triple of floats for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of floats, or function set has no object

MStatus MFnNumericData::setData ( double  val1,
double  val2,
double  val3  
)

NO SCRIPT SUPPORT.

Sets the stored value of this data object as a triple of doubles. The data object must have been created as a triple of doubles for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of doubles, or function set has no object

MStatus MFnNumericData::setData ( double  val1,
double  val2,
double  val3,
double  val4  
)

NO SCRIPT SUPPORT.

Sets the stored value of this data object as a quadruple of doubles. The data object must have been created as a quadruple of doubles for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
[in]  val4  the fourth element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of doubles, or function set has no object

MStatus MFnNumericData::getData2Short ( short &  val1,
short &  val2  
)

Gets the stored value of this data object as a pair of short integers. The data object must have been created as a pair of short integers for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of short integers, or function set has no object

MStatus MFnNumericData::getData2Int ( int &  val1,
int &  val2  
)

Gets the stored value of this data object as a pair of int integers. The data object must have been created as a pair of int integers for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of int integers, or function set has no object

MStatus MFnNumericData::getData2Float ( float &  val1,
float &  val2  
)

Gets the stored value of this data object as a pair of floats. The data object must have been created as a pair of floats for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of floats, or function set has no object

MStatus MFnNumericData::getData2Double ( double &  val1,
double &  val2  
)

Gets the stored value of this data object as a pair of doubles. The data object must have been created as a pair of doubles for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of doubles, or function set has no object

MStatus MFnNumericData::getData3Short ( short &  val1,
short &  val2,
short &  val3  
)

Gets the stored value of this data object as a triple of short integers. The data object must have been created as a pair of short integers for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of short integers, or function set has no object

MStatus MFnNumericData::getData3Int ( int &  val1,
int &  val2,
int &  val3  
)

Gets the stored value of this data object as a triple of int integers. The data object must have been created as a triple of int integers for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of int integers, or function set has no object

MStatus MFnNumericData::getData3Float ( float &  val1,
float &  val2,
float &  val3  
)

Gets the stored value of this data object as a triple of floats. The data object must have been created as a triple of floats for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of floats, or function set has no object

MStatus MFnNumericData::getData3Double ( double &  val1,
double &  val2,
double &  val3  
)

Gets the stored value of this data object as a triple of doubles. The data object must have been created as a triple of doubles for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of doubles, or function set has no object

MStatus MFnNumericData::getData4Double ( double &  val1,
double &  val2,
double &  val3,
double &  val4  
)

Gets the stored value of this data object as a quadruple of doubles. The data object must have been created as a quadruple of doubles for this to succeed.

Parameters:
[out]  val1  storage for the first element
[out]  val2  storage for the second element
[out]  val3  storage for the third element
[out]  val4  storage for the fourth element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a quadruple of doubles, or function set has no object

MStatus MFnNumericData::setData2Short ( short  val1,
short  val2  
)

Sets the stored value of this data object as a pair of short integers. The data object must have been created as a pair of short integers for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of short integers, or function set has no object

MStatus MFnNumericData::setData2Int ( int  val1,
int  val2  
)

Sets the stored value of this data object as a pair of int integers. The data object must have been created as a pair of int integers for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of int integers, or function set has no object

MStatus MFnNumericData::setData2Float ( float  val1,
float  val2  
)

Sets the stored value of this data object as a pair of floats. The data object must have been created as a pair of floats for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of floats, or function set has no object

MStatus MFnNumericData::setData2Double ( double  val1,
double  val2  
)

Sets the stored value of this data object as a pair of doubles. The data object must have been created as a pair of doubles for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kDataIsNotOfThatType data is not a pair of doubles
  • kObjectDoesNotExist function set has no object

MStatus MFnNumericData::setData3Short ( short  val1,
short  val2,
short  val3  
)

Sets the stored value of this data object as a triple of short integers. The data object must have been created as a triple of short integers for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a pair of doubles, or function set has no object

MStatus MFnNumericData::setData3Int ( int  val1,
int  val2,
int  val3  
)

Sets the stored value of this data object as a triple of int integers. The data object must have been created as a triple of int integers for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of int integers, or function set has no object

MStatus MFnNumericData::setData3Float ( float  val1,
float  val2,
float  val3  
)

Sets the stored value of this data object as a triple of floats. The data object must have been created as a triple of floats for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of floats, or function set has no object

MStatus MFnNumericData::setData3Double ( double  val1,
double  val2,
double  val3  
)

Sets the stored value of this data object as a triple of doubles. The data object must have been created as a triple of doubles for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of doubles, or function set has no object
Examples:

MStatus MFnNumericData::setData4Double ( double  val1,
double  val2,
double  val3,
double  val4  
)

Sets the stored value of this data object as a quadruple of doubles. The data object must have been created as a quadruple of doubles for this to succeed.

Parameters:
[in]  val1  the first element
[in]  val2  the second element
[in]  val3  the third element
[in]  val4  the fourth element
Returns:
Return status
Status Codes:
  • kSuccess operation successful
  • kFailure data is not a triple of doubles, or function set has no object

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