- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# MIteratorType Class Reference
OpenMaya - API module for common classes

Search for all occurrences

## Detailed Description

MIteratorType class.

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.

`#include <MIteratorType.h>`

List of all members.

## Public Types
enum | objFilterType { kMObject, kMDagPathObject, kMPlugObject }
| Type of object the iterator deals with. More...
## Public Member Functions
| MIteratorType (MStatus *ReturnStatus=NULL)
| Class Constructor.
| MIteratorType (const MIteratorType &, MStatus *ReturnStatus=NULL)
| Copy Constructor.
| ~MIteratorType ()
| Destructor.
void | setFilterType (MFn::Type type, MStatus *ReturnStatus=NULL)
| Sets the filter type to be used in the iterator.
void | setFilterList (MIntArray &listOfFilters, MStatus *ReturnStatus=NULL)
| Sets the filter list.
void | setObjectType (objFilterType objType, MStatus *ReturnStatus=NULL)
| Sets the object type.
MFn::Type | getFilterType (MStatus *ReturnStatus=NULL)
| Returns the type of filter.
MStatus | getFilterList (MIntArray &listOfFilters)
| Gets the list of filters.
MIteratorType::objFilterType | getObjectType (MStatus *ReturnStatus=NULL)
| Returns the object type.
bool | filterListEnabled ()
| Returns whether the we are using a single filter on the iterator or a filter list.

## Member Enumeration Documentation

enum objFilterType

Search for all occurrences

Type of object the iterator deals with.

Enumerator:

  kMObject | This is to indicate that the root of the iterator has to be reset to an MObject. Search for all occurrences
  kMDagPathObject | This is to indicate that the root of the iterator has to be reset to an MDagPath object. Search for all occurrences
  kMPlugObject | This is to indicate that the root of the iterator has to be reset to an MPlug object. Search for all occurrences

## Constructor & Destructor Documentation

MIteratorType | ( | MStatus * | ReturnStatus = `NULL` | ) |

Class Constructor.

Initializes the filter type and object type.

Parameters:

  [out] | 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 | ( | const MIteratorType & | src,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Copy Constructor.

Constructs the object from an object of the same type.

Parameters:

  [in] | src | Source object.
  [out] | ReturnStatus | Status Code (see below)

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

## Member Function Documentation

void setFilterType | ( | MFn::Type | type,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Sets the filter type to be used in the iterator.

See MFn::Type for the list of filter types that can be set.

Parameters:

  [in] | type | An object of type MFn::Type.
  [out] | 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 setFilterList | ( | MIntArray & | listOfFilters,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

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.

Parameters:

  [in] | listOfFilters | List of MFn::Type filters.
  [out] | 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 setObjectType | ( | objFilterType | objFilterType,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

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.

Parameters:

  [in] | objFilterType | Type specifying the type of object.
  [out] | 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 getFilterType | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the type of filter.

Parameters:

  [out] | ReturnStatus | Status Code (see below)

Returns:
  The filter type.

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

MStatus getFilterList | ( | MIntArray & | listOfFilters | ) |

Search for all occurrences

Gets the list of filters.

Parameters:

  [out] | listOfFilters | Array of filters.

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

MIteratorType::objFilterType getObjectType | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the object type.

Parameters:

  [out] | ReturnStatus | Status Code (see below)

Returns:
  The object type.

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

bool filterListEnabled | ( |  | ) |

Search for all occurrences

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

Returns:
  true if a filter list is being used, false otherwise

MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType
MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType MIteratorType