class MIteratorType

Jump to documentation

MIteratorType class (OpenMaya) (OpenMaya.py)

public members:

enum objFilterType
Type of object the iterator deals with.
kMObject
This is to indicate that the root of the iterator has to be reset to an MObject
kMDagPathObject
This is to indicate that the root of the iterator has to be reset to an MDagPath object.
kMPlugObject
This is to indicate that the root of the iterator has to be reset to an MPlug object.
MIteratorType ( MStatus * ReturnStatus = NULL)
MIteratorType ( const MIteratorType &, MStatus * ReturnStatus = NULL)
~MIteratorType ()
void setFilterType ( MFn::Type type, MStatus * ReturnStatus = NULL)
void setFilterList ( MIntArray & listOfFilters, MStatus * ReturnStatus = NULL)
void setObjectType ( objFilterType objType, MStatus * ReturnStatus = NULL)
MFn::Type getFilterType ( MStatus * ReturnStatus = NULL)
MStatus getFilterList ( MIntArray & listOfFilters)
MIteratorType::objFilterType getObjectType ( MStatus * ReturnStatus = NULL)
bool filterListEnabled ()

Documentation

This class can be used on iterators when more than one type of filters needs to be specified.
Description

The MIteratorType class is used on iterators where more than one type of filters can be specified. It also provides functionalities to set and get the filter list or individual types of filter. This class should be used in conjunction with DAG/DG/DependencyNodes iterators for using filter list (list of MFn::Type objects) on them, thus enabling faster traversal thro' iterators.

Also, the class has functionalities for specifying the type of object the iterator will be reset to. This could be an MObject, an MPlug or an MDagPath.

Functions

MIteratorType:: MIteratorType ( MStatus * ReturnStatus)

Description

Class Constructor

Initializes the filter type and object type.

Arguments

  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess Success
  • MS::kInvlaidParameter Invalid parameter passed for mode or type
  • MS::kFailure Failure creating iterator

MIteratorType:: MIteratorType (const MIteratorType &src, MStatus * ReturnStatus)

Description

Copy Constructor

Constructs the object from an object of the same type.

Arguments

  • src Source object.
  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess Success
  • MS::kInvlaidParameter Invalid parameter passed for mode or type
  • MS::kFailure Failure creating iterator

void MIteratorType:: setFilterType ( MFn::Type type, MStatus * ReturnStatus)

Description

Sets the filter type to be used in the iterator. See MFn::Type for the list of filter types that can be set.

Arguments

  • type An object of type MFn::Type.
  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess Success
  • MS::kInvlaidParameter Invalid parameter passed for mode or type
  • MS::kFailure Failure creating iterator

MFn::Type MIteratorType:: getFilterType ( MStatus * ReturnStatus)

Description

Returns the type of filter.

Arguments

  • ReturnStatus Status Code (see below)

Return Value

  • MFn::Type object, indicating the filter type.

Status Codes

  • MS::kSuccess Success
  • MS::kInvlaidParameter Invalid parameter passed for mode or type
  • MS::kFailure Failure creating iterator

void MIteratorType:: setFilterList ( MIntArray & listOfFilters, MStatus * ReturnStatus)

Description

Sets the filter list. The types of filters to be traversed in the iterator is added to an array and then passed in to this function. This also enables filter list usage on iterators, as opposed to single filter.

Arguments

  • listOfFilters List of MFn::Type filters.
  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess Success
  • MS::kInvlaidParameter Invalid parameter passed for mode or type
  • MS::kFailure Failure creating iterator

void MIteratorType:: setObjectType ( objFilterType objFilterType , MStatus * ReturnStatus)

Description

Sets the object type. This function should be used only when we want to reset the iterator root. Iterator root can be reset to either an MObject, an MDagPath or to an MPlug. For each of this, there is a corresponding enum value, which has to be used as an argument to this function.

During creation of the iterator, this function has no effect.

Arguments

  • objFilterType Type specifying the type of object.
  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess Success
  • MS::kInvlaidParameter Invalid parameter passed for mode or type
  • MS::kFailure Failure creating iterator

MIteratorType::objFilterType MIteratorType:: getObjectType ( MStatus * ReturnStatus)

Description

Returns the object type.

Arguments

  • objFilterType Type specifying the type of object.
  • ReturnStatus Status Code (see below)

Return Value

  • MIteratorType::objFilterType object, indicating the object type.

Status Codes

  • MS::kSuccess Success
  • MS::kInvalidParameter Invalid parameter passed for mode or type
  • MS::kFailure Failure creating iterator

MIteratorType:: ~MIteratorType ()

Description

Destructor.

Arguments

Status Codes

bool MIteratorType:: filterListEnabled ()

Description

Returns whether the we are using a single filter on the iterator or a filter list.

Arguments

Return Value

  • Boolean object.

MStatus MIteratorType:: getFilterList ( MIntArray & listOfFilters)

Description

Gets the list of filters.

Arguments

  • listOfFilters This will be filled with the list of filters.
  • ReturnStatus Status Code (see below)

Return Value

  • ReturnStatus, indicating the status code.

Status Codes

  • MS::kSuccess Success
  • MS::kInvalidParameter Invalid parameter passed for mode or type
  • MS::kFailure Failure creating iterator

This class has no child classes.


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