C++ API Reference
|
Create and retrieve argument lists. More...
#include <MArgList.h>
Public Member Functions | |
MArgList () | |
The default class constructor. | |
MArgList (const MArgList &other) | |
The copy constructor. More... | |
~MArgList () | |
The class destructor. | |
unsigned int | length (MStatus *ReturnStatus=NULL) const |
Returns the number of arguments in the arglist. More... | |
bool | asBool (unsigned int index, MStatus *ret=NULL) const |
Return the value of the argument at a given position in the arglist as an bool. More... | |
int | asInt (unsigned int index, MStatus *ret=NULL) const |
Return the value of the argument at a given position in the arglist as an integer. More... | |
double | asDouble (unsigned int index, MStatus *ret=NULL) const |
Return the value of the argument at a given position in the arglist as a double. More... | |
MString | asString (unsigned int index, MStatus *ret=NULL) const |
Return the value of the argument at a given position in the arglist as an MString. More... | |
MDistance | asDistance (unsigned int index, MStatus *ret=NULL) const |
Return the value of the argument at a given position in the arglist as an MDistance. More... | |
MAngle | asAngle (unsigned int index, MStatus *ret=NULL) const |
Return the value of the argument at a given position in the arglist as an MAngle. More... | |
MTime | asTime (unsigned int index, MStatus *ret=NULL) const |
Return the value of the argument at a given position in the arglist as an MTime. More... | |
MVector | asVector (unsigned int &index, unsigned int numElements=3, MStatus *ReturnStatus=NULL) const |
Return the value of the argument at a given position in the arglist as an MVector. More... | |
MPoint | asPoint (unsigned int &index, unsigned int numElements=3, MStatus *ReturnStatus=NULL) const |
Return the value of the argument at a given position in the arglist as an MPoint. More... | |
MMatrix | asMatrix (unsigned int &index, MStatus *ret=NULL) const |
Get the value of the MMatrix argument at a given position in the arglist. More... | |
MIntArray | asIntArray (unsigned int &index, MStatus *ReturnStatus=NULL) const |
Get the value of the MIntArray argument at a given position in the arglist. More... | |
MDoubleArray | asDoubleArray (unsigned int &index, MStatus *ReturnStatus=NULL) const |
Get the value of the MDoubleArray argument at a given position in the arglist. More... | |
const MStringArray | asStringArray (unsigned int &index, MStatus *ReturnStatus=NULL) const |
Get the value of the MStringArray argument at a given position in the arglist. More... | |
MArgList & | operator= (const MArgList &other) |
The assignment operator. More... | |
unsigned int | flagIndex (const char *shortFlag, const char *longFlag=NULL) const |
Return the index entry of the requested flag, if it has been set. More... | |
MStatus | addArg (bool arg) |
Add a new bool argument to the arglist. More... | |
MStatus | addArg (int arg) |
Add a new integer argument to the arglist. More... | |
MStatus | addArg (double arg) |
Add a new double argument to the arglist. More... | |
MStatus | addArg (const MString &arg) |
Add a new MString argument to the arglist. More... | |
MStatus | addArg (const MDistance &arg) |
Add a new MDistance argument to the arglist. More... | |
MStatus | addArg (const MAngle &arg) |
Add a new MAngle argument to the arglist. More... | |
MStatus | addArg (const MTime &arg) |
Add a new MTime argument to the arglist. More... | |
MStatus | addArg (const MVector &arg) |
Add a new MVector argument to the arglist. More... | |
MStatus | addArg (const MPoint &arg) |
Add a new MPoint argument to the arglist. More... | |
MStatus | get (unsigned int index, bool &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int index, int &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int index, double &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int index, MString &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int index, MDistance &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int index, MAngle &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int index, MTime &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int &index, MVector &ret, unsigned int numElements=3) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int &index, MPoint &ret, unsigned int numElements=3) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int &index, MMatrix &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int &index, MIntArray &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int &index, MDoubleArray &ret) const |
This method is not available in Python. More... | |
MStatus | get (unsigned int &index, MStringArray &ret) const |
This method is not available in Python. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
Friends | |
OPENMAYA_EXPORT std::ostream & | operator<< (std::ostream &os, const MArgList &args) |
This method is not available in Python. More... | |
Create and retrieve argument lists.
This class is used to create and retrieve argument lists that can be passed to API class methods that require arglists.
Do not use MArgList to parse flags for a plug-in command as the flags will not work if the command is called from Python. Use MArgParser or MArgDatabase instead.
The copy constructor.
Initialize a new arglist with the values from another arglist.
[in] | other | the arglist to copy from. |
unsigned int length | ( | MStatus * | ReturnStatus = NULL | ) | const |
Returns the number of arguments in the arglist.
[out] | ReturnStatus | the return status |
bool asBool | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Return the value of the argument at a given position in the arglist as an bool.
[in] | index | the index of the desired argument |
[out] | ReturnStatus | the return status |
int asInt | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Return the value of the argument at a given position in the arglist as an integer.
[in] | index | the index of the desired argument |
[out] | ReturnStatus | the return status |
double asDouble | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Return the value of the argument at a given position in the arglist as a double.
[in] | index | the index of the desired argument |
[out] | ReturnStatus | the return status |
Return the value of the argument at a given position in the arglist as an MString.
[in] | index | the index of the desired argument |
[out] | ReturnStatus | the return status |
Return the value of the argument at a given position in the arglist as an MDistance.
[in] | index | the index of the desired argument |
[out] | ReturnStatus | the return status |
MVector asVector | ( | unsigned int & | index, |
unsigned int | numElements = 3 , |
||
MStatus * | ReturnStatus = NULL |
||
) | const |
Return the value of the argument at a given position in the arglist as an MVector.
[in,out] | index | index of the first argument to be used as an element of the vector. On success it will be updated to point to the last argument used to build the vector (i.e. incremented by numElements-1). On failure it will be updated to point to the argument where the failure occurred. |
[in] | numElements | dimension of the vector to be returned. This should not exceed 3, which is the maximum number of dimensions that an MVector can hold. |
[out] | ReturnStatus | the return status |
MPoint asPoint | ( | unsigned int & | index, |
unsigned int | numElements = 3 , |
||
MStatus * | ReturnStatus = NULL |
||
) | const |
Return the value of the argument at a given position in the arglist as an MPoint.
[in,out] | index | index of the first argument to be used as an element of the point. On success it will be updated to point to the last argument used to build the point (i.e. incremented by numElements-1). On failure it will be updated to point to the argument where the failure occurred. |
[in] | numElements | dimension of the point to be returned. This should not exceed 4, which is the maximum number of dimensions that an MPoint can hold. |
[out] | ReturnStatus | the return status |
Get the value of the MMatrix argument at a given position in the arglist.
[in,out] | index | index of the first argument to be used in building the matrix. On success it will be updated to point to the last argument used to build the matrix (i.e. it will be incremented by 15). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ret | the return status |
Get the value of the MIntArray argument at a given position in the arglist.
[in,out] | index | index of the first argument to be used in building the array. That argument will be taken as an integer count of the number of array elements which follow it. On success the index will be updated to point to the argument for the last array element (i.e. incremented by the number of elements). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ReturnStatus | API status code |
MDoubleArray asDoubleArray | ( | unsigned int & | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Get the value of the MDoubleArray argument at a given position in the arglist.
[in,out] | index | index of the first argument to be used in building the array. That argument will be taken as an integer count of the number of array elements which follow it. On success the index will be updated to point to the argument for the last array element (i.e. incremented by the number of elements). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ReturnStatus | API status code |
const MStringArray asStringArray | ( | unsigned int & | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Get the value of the MStringArray argument at a given position in the arglist.
[in,out] | index | index of the first argument to be used in building the array. That argument will be taken as an integer count of the number of array elements which follow it. On success the index will be updated to point to the argument for the last array element (i.e. incremented by the number of elements). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ReturnStatus | API status code |
The assignment operator.
Allows assignment between MArgList instances.
[in] | other | The object to copy from. |
unsigned int flagIndex | ( | const char * | shortFlag, |
const char * | longFlag = NULL |
||
) | const |
Return the index entry of the requested flag, if it has been set.
[in] | shortFlag | the short version of the flag |
[in] | longFlag | the int version of the flag (if any) |
MStatus addArg | ( | bool | arg | ) |
Add a new bool argument to the arglist.
[in] | arg | the new bool argument |
MStatus addArg | ( | int | arg | ) |
Add a new integer argument to the arglist.
[in] | arg | the new integer argument |
MStatus addArg | ( | double | arg | ) |
Add a new double argument to the arglist.
[in] | arg | the new double argument |
MStatus get | ( | unsigned int | index, |
bool & | ret | ||
) | const |
This method is not available in Python.
Get the value of the bool argument at a given position in the arglist.
Python Notes
Use asBool() instead.
[in] | index | the index of the desired argument |
[out] | ret | the bool value is returned in this argument. |
MStatus get | ( | unsigned int | index, |
int & | ret | ||
) | const |
This method is not available in Python.
Get the value of the integer argument at a given position in the arglist.
Python Notes
Use asInt() instead.
[in] | index | the index of the desired argument |
[out] | ret | the integer value is returned in this argument. |
MStatus get | ( | unsigned int | index, |
double & | ret | ||
) | const |
This method is not available in Python.
Get the value of the double argument at a given position in the arglist.
Python Notes
Use asDouble() instead.
[in] | index | the index of the desired argument |
[out] | ret | the double value is returned in this argument. |
This method is not available in Python.
Get the value of the MString argument at a given position in the arglist.
Python Notes
Use asString() instead.
[in] | index | the index of the desired argument |
[out] | ret | the MString value is returned in this argument. |
This method is not available in Python.
Get the value of the MDistance argument at a given position in the arglist.
Python Notes
Use asDistance() instead.
[in] | index | the index of the desired argument |
[out] | ret | the MDistance value is returned in this argument. |
This method is not available in Python.
Get the value of the MAngle argument at a given position in the arglist.
Python Notes
Use asAngle() instead.
[in] | index | the index of the desired argument |
[out] | ret | the MAngle value is returned in this argument. |
This method is not available in Python.
Get the value of the MTime argument at a given position in the arglist.
Python Notes
Use asTime() instead.
[in] | index | the index of the desired argument |
[out] | ret | the MTime value is returned in this argument. |
This method is not available in Python.
Get the value of the MVector argument at a given position in the arglist.
Python Notes
Use asVector() instead.
[in,out] | index | index of the first argument to be used as an element of the vector. On success it will be updated to point to the last argument used to build the vector (i.e. incremented by numElements-1). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ret | the MVector value is returned in this argument. |
[in] | numElements | dimension of the vector to be returned. This should not exceed 3, which is the maximum number of dimensions that an MVector can hold. |
This method is not available in Python.
Get the value of the MPoint argument at a given position in the arglist.
Python Notes
Use asPoint() instead.
[in,out] | index | index of the first argument to be used as an element of the point. On success it will be updated to point to the last argument used to build the point (i.e. incremented by numElements-1). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ret | the MPoint value is returned in this argument. |
[in] | numElements | dimension of the point to be returned. This should not exceed 4, which is the maximum number of dimensions that an MPoint can hold. |
This method is not available in Python.
Get the value of the MMatrix argument at a given position in the arglist.
Python Notes
Use asMatrix() instead.
[in,out] | index | index of the first argument to be used in building the matrix. On success it will be updated to point to the last argument used to build the matrix (i.e. it will be incremented by 15). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ret | the MMatrix value is returned in this argument. |
This method is not available in Python.
Get the value of the MIntArray argument at a given position in the arglist.
Python Notes
Use asIntArray() instead.
[in,out] | index | index of the first argument to be used in building the array. That argument will be taken as an integer count of the number of array elements which follow it. On success the index will be updated to point to the argument for the last array element (i.e. incremented by the number of elements). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ret | the MIntArray value is returned in this argument. |
MStatus get | ( | unsigned int & | index, |
MDoubleArray & | ret | ||
) | const |
This method is not available in Python.
Get the value of the MDoubleArray argument at a given position in the arglist.
Python Notes
Use asDoubleArray() instead.
[in,out] | index | index of the first argument to be used in building the array. That argument will be taken as an integer count of the number of array elements which follow it. On success the index will be updated to point to the argument for the last array element (i.e. incremented by the number of elements). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ret | the MDoubleArray value is returned in this argument. |
MStatus get | ( | unsigned int & | index, |
MStringArray & | ret | ||
) | const |
This method is not available in Python.
Get the value of the MStringArray argument at a given position in the arglist.
Python Notes
Use asStringArray() instead.
[in,out] | index | index of the first argument to be used in building the array. That argument will be taken as an integer count of the number of array elements which follow it. On success the index will be updated to point to the argument for the last array element (i.e. incremented by the number of elements). On failure it will be updated to point to the argument where the failure occurred. |
[out] | ret | the MStringArray value is returned in this argument. |
|
static |
Returns the name of this class.
|
friend |
This method is not available in Python.
The output is each string in the list, separated by spaces (and unquoted).
[in] | os | the ostream to print to |
[in] | args | the MArgList whose contents are to be printed |