C++ API Reference
MDagPathArray Class Reference

Indexable Array of DAG Paths. More...

#include <MDagPathArray.h>

Public Member Functions

 MDagPathArray ()
 Class Constructor. More...
 
 MDagPathArray (const MDagPathArray &other)
 Copy Constructor. More...
 
 MDagPathArray (unsigned int initializeSize, const MDagPath &initialValue)
 Create a new array of MDagPaths of a specified size and initialize all the elements with the given initial value. More...
 
 ~MDagPathArray ()
 Class Destructor. More...
 
const MDagPathoperator[] (unsigned int index) const
 Retrieves the read-only DAG Path which is at the specified index in the array. More...
 
MDagPathArrayoperator= (const MDagPathArray &other)
 Assignment operator copies all of the elements of the other array into this one. More...
 
MStatus set (const MDagPath &element, unsigned int index)
 Sets an element of the array to the given DAG path. More...
 
MStatus setLength (unsigned int length)
 Set the length of the array. More...
 
unsigned int length () const
 Determines the number of elements in the array. More...
 
MStatus remove (unsigned int index)
 Removes the DAG Path which is at the specified index in the array. More...
 
MStatus insert (const MDagPath &element, unsigned int index)
 Inserts the given DAG Path at the specified index in the array. More...
 
MStatus append (const MDagPath &element)
 Appends the given DAG Path to the end of the array. More...
 
MStatus copy (const MDagPathArray &source)
 Copy the contents of the source array to this array. More...
 
MStatus clear ()
 Clears this array. More...
 
void setSizeIncrement (unsigned int newIncrement)
 Set the size by which the array will be expanded whenever expansion is necessary. More...
 
unsigned int sizeIncrement () const
 Return the size by which the array will be expanded whenever expansion is necessary. More...
 
MDagPathoperator[] (unsigned int index)
 Retrieves the DAG Path which is at the specified index in the array. More...
 
Iterator begin ()
 Returns an iterator object pointed to the beginning of the array. More...
 
Iterator end ()
 Returns an iterator object pointed to the end of the array. More...
 
ConstIterator begin () const
 Returns a const iterator object pointed to the beginning of the array. More...
 
ConstIterator end () const
 Returns a const iterator object pointed to the end of the array. More...
 
ConstIterator cbegin () const
 Returns a const iterator object pointed to the beginning of the array. More...
 
ConstIterator cend () const
 Returns a const iterator object pointed to the end of the array. 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 MDagPathArray &array)
 NO SCRIPT SUPPORT. More...
 

Detailed Description

Indexable Array of DAG Paths.

Provides methods for manipulating arrays of DAG Paths.

Arrays of DAG Paths are useful for storing and manipluating multiple Paths to a particular DAG Node. The DAG Path method MDagPath::getAllPathsTo() and DAG Node Function Set method MFnDagNode::getAllPaths() implicitly return an array of DAG Paths.

These arrays may also be used to manage Paths for a number of different Nodes.

DAG Path arrays are used in conjunction with DAG Paths (MDagPath) and individual elements of the arrays can be parameters to some methods of the DAG Node Function Set (MFnDagNode).

Use this DAG Path Array Class to create and manipulate arrays of DAG Paths, for either a particular DAG Node or a number of different DAG Nodes.

The length of the array adjusts automatically.

Examples:
AbcExport/MayaNurbsCurveWriter.cpp, AbcExport/MayaNurbsCurveWriter.h, apiMeshShape/apiMeshSubSceneOverride.cpp, apiMeshShape/apiMeshSubSceneOverride.h, exampleCameraSetView/exampleCameraSetViewCmd.h, exportSkinClusterDataCmd/exportSkinClusterDataCmd.cpp, footPrintNode_SubSceneOverride/footPrintNode_SubSceneOverride.cpp, gpuCache/gpuCacheSubSceneOverride.cpp, gpuCache/gpuCacheSubSceneOverride.h, instancerListCmd/instancerListCmd.cpp, listLightLinksCmd/listLightLinksCmd.cpp, maTranslator/maTranslator.cpp, narrowPolyViewer/narrowPolyViewer.cpp, narrowPolyViewer/narrowPolyViewer.h, narrowPolyViewer/narrowPolyViewerCmd.h, skinClusterWeights/skinClusterWeights.cpp, and testCameraSetCmd/testCameraSetCmd.cpp.

Constructor & Destructor Documentation

OPENMAYA_MAJOR_NAMESPACE_OPEN MDagPathArray ( )

Class Constructor.

Creates a DAG Path Array

MDagPathArray ( const MDagPathArray other)

Copy Constructor.

Parameters
[in]otherthe array with which to initialize this instance
MDagPathArray ( unsigned int  initialSize,
const MDagPath initialValue 
)

Create a new array of MDagPaths of a specified size and initialize all the elements with the given initial value.

Parameters
[in]initialSizethe initial size of the array
[in]initialValuethe initial value of each element

Class Destructor.

No additional action.

Member Function Documentation

const MDagPath & operator[] ( unsigned int  index) const

Retrieves the read-only DAG Path which is at the specified index in the array.

Parameters
[in]indexZero-based index to the array
Returns
DAG Path at the specified index
MDagPathArray & operator= ( const MDagPathArray other)

Assignment operator copies all of the elements of the other array into this one.

If the other array was returned as a reference to internal data then this array will also become a reference rather than doing a full copy.

Parameters
[in]otherthe array being copied
Returns
A reference to this array
MStatus set ( const MDagPath element,
unsigned int  index 
)

Sets an element of the array to the given DAG path.

Parameters
[in]elementNew DAG path to be set on the indicated element
[in]indexZero-based index to the array
Returns
MS::kSuccess on success, otherwise MS::kFailure
MStatus setLength ( unsigned int  length)

Set the length of the array.

This will grow and shrink the array as desired. Elements that are grown have uninitialized values, while those which are shrunk will lose the data contained in the deleted elements (ie. it will release the memory).

Parameters
[in]lengththe new size of the array
unsigned int length ( ) const
MStatus remove ( unsigned int  index)

Removes the DAG Path which is at the specified index in the array.

Parameters
[in]indexZero-based index to the array
Returns
MS::kSuccess on success, otherwise MS::kFailure
MStatus insert ( const MDagPath element,
unsigned int  index 
)

Inserts the given DAG Path at the specified index in the array.

Parameters
[in]elementDAG Path to be inserted
[in]indexZero-based index to the array
Returns
MS::kSuccess on success, otherwise MS::kFailure
MStatus append ( const MDagPath element)

Appends the given DAG Path to the end of the array.

Parameters
[in]elementDAG Path to be appended
Returns
MS::kSuccess on success, otherwise MS::kFailure
Examples:
AbcExport/MayaNurbsCurveWriter.cpp, narrowPolyViewer/narrowPolyViewer.cpp, and testCameraSetCmd/testCameraSetCmd.cpp.
MStatus copy ( const MDagPathArray source)

Copy the contents of the source array to this array.

Parameters
[in]sourcearray to copy from
Returns
MS::kSuccess if the copy was successful and MS::kFailure otherwise
MStatus clear ( )

Clears this array.

Length of the array becomes zero.

Returns
MS::kSuccess on success, otherwise MS::kFailure
Examples:
listLightLinksCmd/listLightLinksCmd.cpp, and narrowPolyViewer/narrowPolyViewer.cpp.
void setSizeIncrement ( unsigned int  newIncrement)

Set the size by which the array will be expanded whenever expansion is necessary.

Parameters
[in]newIncrementthe new increment
unsigned int sizeIncrement ( ) const

Return the size by which the array will be expanded whenever expansion is necessary.

Returns
The size increment.
MDagPath & operator[] ( unsigned int  index)

Retrieves the DAG Path which is at the specified index in the array.

Parameters
[in]indexZero-based index to the array
Returns
DAG Path at the specified index
MDagPathArray::Iterator begin ( )

Returns an iterator object pointed to the beginning of the array.

Returns
Iterator object pointed to the beginning of the array.
MDagPathArray::Iterator end ( )

Returns an iterator object pointed to the end of the array.

Returns
Iterator object pointed to the end of the array.
MDagPathArray::ConstIterator begin ( ) const

Returns a const iterator object pointed to the beginning of the array.

Returns
Iterator object pointed to the beginning of the array.
MDagPathArray::ConstIterator end ( ) const

Returns a const iterator object pointed to the end of the array.

Returns
Iterator object pointed to the end of the array.
MDagPathArray::ConstIterator cbegin ( ) const

Returns a const iterator object pointed to the beginning of the array.

Returns
Iterator object pointed to the beginning of the array.
MDagPathArray::ConstIterator cend ( ) const

Returns a const iterator object pointed to the end of the array.

Returns
Iterator object pointed to the end of the array.
const char * className ( )
static

Returns the name of this class.

Returns
The name of this class.

Friends And Related Function Documentation

OPENMAYA_EXPORT std::ostream& operator<< ( std::ostream &  os,
const MDagPathArray array 
)
friend

NO SCRIPT SUPPORT.

The format used is [fullPathName, fullPathName, fullPathName, ... fullPathName].

Parameters
[in]osthe ostream to print to
[in]arraythe MDagPathArray whose value is to be printed
Returns
The ostream reference, s, provided as the first parameter.

The documentation for this class was generated from the following files: