#include <MItSelectionList.h>
Class for iterating over the items in an MSelection list. A filter can be specified so that only those items of interest on a selection list can be obtained.
If a filter is specified then the children of DAG selection items will be searched if the selection item does not match the filter. For example, if filter = MFn::kNurbsCurve and a transform is selected then the underlying shape for the transform will be in the iteration if it is a nurbs curve.
Example: (of a simple traversal)
MSelectionList & activeList = MGlobal::activeSelectionList(); MItSelectionList iter( activeList ); for ( ; !iter.isDone(); iter.next() ) { MDagPath item; MObject component; iter.getDagPath( item, component ); // do something with it }
Example: (of a traversal to find all active cameras)
MSelectionList & activeList = MGlobal::activeSelectionList(); MItSelectionList iter( activeList, MFn::kCamera ); for ( ; !iter.isDone(); iter.next() ) { MDagPath camera; MObject component; iter.getDagPath( camera, component ); MFnCamera( item ); // ... }
animExportUtil.cpp, blindComplexDataCmd.cpp, blindDoubleDataCmd.cpp, blindShortDataCmd.cpp, cleanPerFaceAssignmentCmd.cpp, closestPointCmd.cpp, componentScaleManip.cpp, convertEdgesToFacesCmd.cpp, convertVerticesToEdgesCmd.cpp, convertVerticesToFacesCmd.cpp, createClipCmd.cpp, customAttrManip.cpp, cvExpandCmd.cpp, cvPosCmd.cpp, dagPoseInfoCmd.cpp, findFileTexturesCmd.cpp, getAttrAffectsCmd.cpp, helix2Cmd.cpp, instancerListCmd.cpp, intersectCmd.cpp, lassoTool.cpp, latticeNoiseCmd.cpp, lepTranslator.cpp, lineManip.cpp, lineManipContainer.cpp, lockEvent.cpp, meshOpCmd.cpp, meshRemapCmd.cpp, meshRemapTool.cpp, meshReorderCmd.cpp, meshReorderTool.cpp, motionPathCmd.cpp, motionTraceCmd.cpp, moveCurveCVsCmd.cpp, moveManip.cpp, moveTool.cpp, narrowPolyViewer.cpp, nodeInfoCmd.cpp, objExport.cpp, polyExporter.cpp, rotateManip.cpp, spiralAnimCurveCmd.cpp, splitUVCmd.cpp, squareScaleManip.cpp, surfaceBumpManip.cpp, surfaceTwist.cpp, surfaceTwistCmd.cpp, translateCmd.cpp, and whatisCmd.cpp.
Public Types | |
enum | selItemType { , kDagSelectionItem, kAnimSelectionItem, kDNselectionItem, kPlugSelectionItem } |
Types of items which can appear on a selection list. More... | |
Public Member Functions | |
bool | isDone (MStatus *ReturnStatus=NULL) |
MStatus | next () |
MStatus | reset () |
MStatus | getDependNode (MObject &depNode) |
MStatus | getDagPath (MDagPath &dagPath, MObject &component) |
MStatus | getDagPath (MDagPath &dagPath) |
MStatus | getPlug (MPlug &plug) |
MStatus | getStrings (MStringArray &array) |
selItemType | itemType (MStatus *ReturnStatus=NULL) |
MStatus | setFilter (MFn::Type filter) |
bool | hasComponents (MStatus *ReturnStatus=NULL) const |
MItSelectionList (const MSelectionList &list, MFn::Type=MFn::kInvalid, MStatus *ReturnStatus=NULL) | |
virtual | ~MItSelectionList () |
MItSelectionList::MItSelectionList | ( | const MSelectionList & | list, | |
MFn::Type | filter = MFn::kInvalid , |
|||
MStatus * | ReturnStatus = NULL | |||
) |
Class constructor. Creates a iterator for the given selection list.
NOTE: this class iterates on a copy of the given list and so any changes to the original list will not be reflected upon in this iterator.
[in] | list | The selection list to iterate over |
[in] | filter | Type filter |
[out] | ReturnStatus | Status code |
MItSelectionList::~MItSelectionList | ( | ) | [virtual] |
Class destructor. Removes internal iterator data.
bool MItSelectionList::isDone | ( | MStatus * | ReturnStatus = NULL |
) |
Specifies whether or not there is anything more to iterator over.
[out] | ReturnStatus | Status code |
MStatus MItSelectionList::next | ( | ) |
Advance to the next item. If components are selected then advance to next component.
If a filter is specified then the next item will be one that matches the filter.
MStatus MItSelectionList::reset | ( | ) |
Reset the iterator. If a filter has been specified then the current item will be the first selected item that matches the filter.
This method retrieves the dependency node of the current selection item
[out] | depNode | a pointer the the dependency node to be retrieved |
This method retrieves the dag path and the components of the current selection item. If components are not selected then NULL is assigned to the component pointer.
[out] | dagPath | The dag path of the current selection item. |
[out] | component | A pointer to the selected components of the current selection item. |
This method retrieves the dag path of the current selection item.
[out] | dagPath | The dag path of the current selection item. |
This method retrieves the plug of the current selection item.
[out] | plug | The plug of the current selection item. |
MStatus MItSelectionList::getStrings | ( | MStringArray & | array | ) |
Get the string representation of the current item in the selection list. It is possible that it will require more than one string to represent the item (the item may contain groups of CVs for example), so a string array is used to pass back the results.
[out] | array | Storage for the returned array. |
MItSelectionList::selItemType MItSelectionList::itemType | ( | MStatus * | ReturnStatus = NULL |
) |
Returns the current selection item type.
[out] | ReturnStatus | Status code |
Apply a filter to the iteration. Selection items not matching the filter type will be excluded from the iteration.
[in] | filter | The MFn::Type that you will be included in the iteration. See MFn.h for possible types. |
bool MItSelectionList::hasComponents | ( | MStatus * | ReturnStatus = NULL |
) | const |
Returns whether or not the current selection item has components.
[out] | ReturnStatus | Status code |
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |