class MAttributeSpecArray

Jump to documentation

An attribute specification array. (OpenMaya) (OpenMaya.py)

public members:

MAttributeSpecArray ()
MAttributeSpecArray ( const MAttributeSpecArray & other )
~MAttributeSpecArray ()
MAttributeSpec operator[] ( unsigned int index ) const
MAttributeSpecArray & operator= ( const MAttributeSpecArray & other )
MStatus set ( const MAttributeSpec & element, unsigned int index )
MStatus setLength ( unsigned int length )
unsigned int length () const
MStatus remove ( unsigned int index )
MStatus insert ( const MAttributeSpec & element, unsigned int index )
MStatus append ( const MAttributeSpec & element )
MStatus clear ()
void setSizeIncrement ( unsigned int newIncrement )
unsigned int sizeIncrement () const

Documentation

Implement an array of MAttributeSpecs data type.
Description

Array class for MAttributeSpec.

See MAttributeSpec for more information.

Functions

MAttributeSpecArray:: MAttributeSpecArray ()

Description

Default constructor. The array is set to contain no elements.

MAttributeSpecArray:: MAttributeSpecArray ( const MAttributeSpecArray & other )

Description

Copy Constructor.

Arguments

  • other the array with which to initialize this array

MAttributeSpecArray:: ~MAttributeSpecArray ()

Description

Class Destructor

MAttributeSpec MAttributeSpecArray:: operator[] ( unsigned int index ) const

Description

Index operator. Returns the value of the element at the given index. Valid indices are 0 to length()-1.

Arguments

  • index the index of the element to return

Return Value

  • a reference to the specified element

MAttributeSpecArray & MAttributeSpecArray:: operator= ( const MAttributeSpecArray & other )

Description

Assignment operator.

Arguments

  • other The source object to assign from.

Return Value

  • A reference to the copied MAttributeSpecArray object.

MStatus MAttributeSpecArray:: set ( const MAttributeSpec & element, unsigned int index )

Description

Sets the value of the specified element to the given attribute spec.

Arguments

  • element the new value for the specified element
  • index the index of the element to be set

Return Value

  • MS::kSuccess the value was set successfully
  • MS::kFailure invalid index

MStatus MAttributeSpecArray:: setLength ( unsigned int length )

Description

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).

Arguments

  • length the new size of the array

Return Value

  • MS::kSuccess the method is successful.
  • MS::kFailure the method failed.

unsigned int MAttributeSpecArray:: length () const

Description

Returns the number of elements in the array.

Return Value

  • the number of elements in the array

MStatus MAttributeSpecArray:: remove ( unsigned int index )

Description

Removes the element in the array at the given index.

Arguments

  • index the index of the element to removed

Return Value

  • MS::kSuccess the remove was successful.
  • MS::kInvalidParameter when the specified index is out of range.
  • MS::kFailure the remove failed

MStatus MAttributeSpecArray:: insert ( const MAttributeSpec & element, unsigned int index )

Description

Inserts a new value into the array at the given index. The initial element at that index, and all following elements, are shifted towards the last.

Arguments

  • element the new value to insert into the array
  • index the index of the element to set

Return Value

  • MS::kSuccess the insert was set successfully
  • MS::kFailure the insert failed

MStatus MAttributeSpecArray:: append ( const MAttributeSpec & element )

Description

Adds a new element to the end of the array.

Arguments

  • element the value for the new last element

Return Value

  • MS::kSuccess the append was set successfully
  • MS::kFailure the append failed

MStatus MAttributeSpecArray:: clear ()

Description

Clear the contents of the array. After this operation the length method will return 0. This does not change the amount of memory allocated to the array, only the number of valid elements in it.

Return Value

  • MS::kSuccess the operation was set successfully
  • MS::kFailure the operation failed

void MAttributeSpecArray:: setSizeIncrement ( unsigned int newIncrement )

Description

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

Arguments

  • newIncrement the new increment

unsigned int MAttributeSpecArray:: sizeIncrement () const

Description

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

Return Value

  • true if the array argument is a non-zero pointer and false otherwise

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright