class MPxGeometryIterator

Jump to documentation

Base class for user defined geometry iterators. (OpenMaya) (OpenMayaMPx.py)

public members:

MPxGeometryIterator ( void * userGeometry, MObjectArray & components )
MPxGeometryIterator ( void * userGeometry, MObject & components )
virtual ~MPxGeometryIterator ()
virtual bool isDone () const
virtual void next ()
virtual void reset ()
virtual void component ( MObject & component )
virtual bool hasPoints () const
virtual int iteratorCount () const
virtual MPoint point () const
virtual void setPoint ( const MPoint & ) const
virtual int setPointGetNext ( MPoint & )
virtual int index () const
virtual bool hasNormals () const
virtual int indexUnsimplified () const
int currentPoint () const
void setCurrentPoint ( int )
int maxPoints () const
void setMaxPoints ( int )
void setObject ( MPxSurfaceShape & )
void* geometry () const

Documentation

Base class for user defined geometry iterators. (OpenMaya) (OpenMayaMPx.py)
Description

This is the base class for user defined geometry iterators. Geometry iterator allow iterating over components in geometry in a geometry independent manner. This base class defines the interface to be used by maya when a generic component iteration is required.

This class is used in conjunction with MPxSurfaceShape to provide an iterator for components in a user defined shape. Also this method can is used by MPxGeometryData to provide an iterator over geometry that is passed through DG connections.

The main methods to override in this class are point and setPoint. The reset, isDone, and next methods have a default implementation and should only be overridden if the component being iterator on is not a single indexed component type.

The iterator works in two modes, over components or over all elements in some geometry. If the components passed into the constructors are null or empty then the iteration is meant to be over the entire object.

Functions

MPxGeometryIterator:: MPxGeometryIterator ( void * userGeometry, MObjectArray & components )

Description

Class constructor.

The components can be NULL if the iteration is to be over all elements in the geometry.

Arguments

  • userGeometry the geometry that will be iterated over
  • components the (optional) list of components to iterate over

MPxGeometryIterator:: MPxGeometryIterator ( void * userGeometry, MObject & components )

Description

Class constructor.

The components can be NULL if the iteration is to be over all elements in the geometry.

Arguments

  • userGeometry the geometry that will be iterated over
  • components the (optional) components to iterate over

MPxGeometryIterator:: ~MPxGeometryIterator ()

Description

Class destructor.

bool MPxGeometryIterator:: isDone () const

Description

Indicates if all the items have been traversed yet.

Return Value

  • true the iterator has no more elements to traverse
  • false the iterator is not finished traversing

void MPxGeometryIterator:: next ()

Description

Advances to the next component.

void MPxGeometryIterator:: reset ()

Description

Resets the iterator to the start of the components so that another pass over them may be made.

void MPxGeometryIterator:: component ( MObject & component )

Description

Returns a component for the current item in the iteration.

Arguments

  • components storage for the returned component

bool MPxGeometryIterator:: hasPoints () const

Description

Indicates whether the underlying geometry has point data.

Return Value

  • true the geometry has point data
  • false the geometry does not have point data

int MPxGeometryIterator:: iteratorCount () const

Description

Returns an estimate of how many items will be iterated over.

Return Value

  • the iterator count

MPoint MPxGeometryIterator:: point () const

Description

Returns the current component's positional data.

Return Value

  • the current point being iterated over

void MPxGeometryIterator:: setPoint ( const MPoint & point ) const

Description

Sets the current component's positional data.

Arguments

  • point the new positional value to set

int MPxGeometryIterator:: setPointGetNext ( MPoint & point )

Description

Sets the current component's positional data, gets the next point.

Arguments

  • point the positional value to set

Return Value

  • the next index value

int MPxGeometryIterator:: index () const

Description

Returns a unique index for the current item in the iteration. If the iteration is over the whole geometry then this index is the same as current point. If the iteration is over some elements of the geometry specified by a component then this index is the index in your geometry.

Return Value

  • the index of the current element

bool MPxGeometryIterator:: hasNormals () const

Description

Indicates whether the underlying geometry has normals.

Return Value

  • true this geometry has normals
  • false this geometry has no normals

int MPxGeometryIterator:: indexUnsimplified () const

Description

Returns a unique index for the current item in the iteration Rather than being the iterator index this is the index for the actual item when simplification is skipping items. This index will be equal to index() if no simplification, otherwise it will be larger.

Return Value

  • the unsimplified index

int MPxGeometryIterator:: currentPoint () const

Description

Returns the index that is being iterated on. This value is used when iterating over all elements of your geometry, i.e. when there are no components specified.

Return Value

  • the current point index

void MPxGeometryIterator:: setCurrentPoint ( int index )

Description

Set the current index of the iteration. This value is used when iterating over all elements of your geometry, i.e. when there are no components specified.

Arguments

  • index the current point in the iteration

int MPxGeometryIterator:: maxPoints () const

Description

Returns the largest index that will be iterated over. This value is used when iterating over all elements of your geometry, i.e. when there are no components specified.

Return Value

  • the max index

void MPxGeometryIterator:: setMaxPoints ( int index )

Description

Sets the largest index that will be iterated over. This value is used when iterating over all elements of your geometry, i.e. when there are no components specified.

Arguments

  • index the maximum index value

void MPxGeometryIterator:: setObject ( MPxSurfaceShape & shape )

Description

Optional method to set a shape object to iterate over to allow tweaking of the shape's history (input geometry).

Arguments

  • shape a user defined shape object

void* MPxGeometryIterator:: geometry () const

Description

Returns a pointer to the geometry that this iterator is iterating over.

This class has no child classes.


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