class MItMeshEdge

Jump to documentation

Polygon edge iterator. (OpenMaya) (OpenMaya.py)

public members:

MItMeshEdge ( MObject & polyObject, MStatus * ReturnStatus = NULL )
MItMeshEdge ( MObject & polyObject, MObject & component, MStatus * ReturnStatus = NULL )
MItMeshEdge ( const MDagPath &polyObject, MObject & component = MObject::kNullObj , MStatus * ReturnStatus = NULL )
virtual ~MItMeshEdge ()
bool isDone ( MStatus * ReturnStatus = NULL )
MStatus next ()
MStatus reset ()
MStatus reset ( MObject & polyObject, MObject & component = MObject::kNullObj )
MStatus reset ( const MDagPath &polyObject, MObject & component = MObject::kNullObj )
int count ( MStatus * ReturnStatus = NULL )
MPoint center ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL )
MPoint point ( int index , MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL )
MStatus setPoint ( const MPoint & point , unsigned int index , MSpace::Space space = MSpace::kObject )
bool isSmooth ( MStatus * ReturnStatus = NULL ) const
MStatus setSmoothing ( bool smooth = true )
MStatus cleanupSmoothing ()
OBSOLETE
int index ( int index , MStatus * ReturnStatus = NULL )
int index ( MStatus * ReturnStatus = NULL ) const
MObject edge ( MStatus * ReturnStatus = NULL )
OBSOLETE
MObject currentItem ( MStatus * ReturnStatus = NULL )
MStatus updateSurface ()
MStatus geomChanged ()
MStatus setIndex (int index , int &prevIndex )
int getConnectedFaces ( MIntArray & faceList, MStatus * ReturnStatus = NULL ) const
int getConnectedEdges ( MIntArray & edgeList, MStatus * ReturnStatus = NULL ) const
MStatus numConnectedFaces (int &faceCount ) const
MStatus numConnectedEdges (int &edgeCount ) const
bool connectedToFace ( int index , MStatus * ReturnStatus = NULL)
bool connectedToEdge ( int index , MStatus * ReturnStatus = NULL)
bool onBoundary ( MStatus * ReturnStatus = NULL )
MStatus getLength (double &length, MSpace::Space space = MSpace::kObject )

Documentation

Description

This class is the edge iterator for polygonal surfaces.

The iterator functions in two modes depending on whether a component is specified. When a component is not given or is NULL the iteration will be over all edges for the polygon. When a component is given this iterator will iterate over the edges specified in the component. When iterating over components a DAG path to the polygon must also be supplied.

Functions

MItMeshEdge:: MItMeshEdge ( MObject & polyObject, MStatus * ReturnStatus )

Description

Constructor.
Creates an iterator for all edges of the given surface.

Arguments

  • polyObject The surface to iterate over
  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MItMeshEdge:: MItMeshEdge ( MObject & polyObject, MObject & component, MStatus * ReturnStatus )

Description

Constructor.
Creates an iterator for the edges of a given surface. The returned edges are connected to the component object. This component may be a vertex or a face or an edge component. If no component is specified then the iteration will be for all edges of the given polygon.

Arguments

  • polyObject The surface to iterate over
  • component The component that determines which edges to iterate over
  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MItMeshEdge:: MItMeshEdge ( const MDagPath &polyObject, MObject & component, MStatus * ReturnStatus )
Description

Constructor.
Creates an iterator for the edges of a given surface. The returned edges are connected to the component object. This component may be a vertex or a face or an edge component. If no component is specified then the iteration will be for all edges of the given polygon.

Arguments

  • polyObject The surface to iterate over
  • component The edges of the polyObject to iterate over
  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MItMeshEdge:: ~MItMeshEdge ()

Description

Destructor.
Frees up storage used by the iterator.

bool MItMeshEdge:: isDone ( MStatus * ReturnStatus )

Description

Indicates if all of the edges have been traversed yet.

Arguments

  • ReturnStatus Status code

Return Value

  • true All edges have been traversed
  • false There are more edges in the iteration

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshEdge:: next ()

Description

Advance to the next edge in the iteration.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshEdge:: reset ()

Description

Reset the iterator to the first edge.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshEdge:: reset ( MObject & polyObject, MObject & component )

Description

Reset the iterator to the first edge in the supplied mesh. Uses the edges constrained by the given component. If component is null then the iteration will be for all edges in the given polygon.

Arguments

  • polyObject The mesh object for the iteration
  • component The constraint object. May be a vertex, a face or an edge component

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid object given.
  • MS::kInsufficientMemory Memory error.

MStatus MItMeshEdge:: geomChanged ()

Description

Reset the geom pointer in the MItMeshEdge. If you're using MFnMesh to update Normals or Color per vertex while iterating, you must call geomChanged on the iteratior immadiately after the MFnMesh call to make sure that your geometry is up to date. A crash may result if this method is not called.

Arguments

  • polyObject The polygon for the iteration

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshEdge:: reset ( const MDagPath &polyObject, MObject & component )

Description

Reset the iterator to the first edge in the supplied mesh. Uses the edges constrained by the given component. If component is null then the iteration will be for all edges in the given polygon.

Arguments

  • polyObject The surface to iterate over
  • component The constraint object. May be a vertex, a face or an edge component

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid object given.

MPoint MItMeshEdge:: center ( MSpace::Space space, MStatus * ReturnStatus )

Description

Returns the center of the current edge.

Arguments

  • ReturnStatus Status code

Return Value

  • The center of the current edge

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MItMeshEdge:: count ( MStatus * ReturnStatus )

Description

Return the number of edges in this iteration.

Arguments

  • ReturnStatus Status code

Return Value

  • The number of edges in the iteration

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MPoint MItMeshEdge:: point ( int index , MSpace::Space space, MStatus * ReturnStatus )

Description

Return the position of the specified vertex of the current edge.

Arguments

  • index The vertex of the edge we wish to examine (0 or 1)
  • space The coordinate system for this operation
  • ReturnStatus Status code

Return Value

  • The position of the edge vertex for the given index

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshEdge:: setPoint ( const MPoint & point , unsigned int index , MSpace::Space space )

Description

Set the specified vertex of the current edge to the given value.

Arguments

  • point The new value for the edge
  • index The vertex index of the current edge we wish to set (0 or 1)
  • space The coordinate system for this operation

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshEdge:: isSmooth ( MStatus * ReturnStatus ) const

Description

This method determines if the current edge in the iteration is smooth (soft).

Arguments

  • ReturnStatus Status code

Return Value

  • true the edge is smooth (soft)
  • false the edge is hard

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshEdge:: setSmoothing ( bool smooth )

Description

This method sets the current edge to be hard or smooth (soft). The cleanupSmoothing method is no longer required to be called after setSmoothing in Maya3.0 and later versions.

Arguments

  • smooth if true the edge will be smooth (soft), otherwise the edge will be hard.

Return Value

  • status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshEdge:: cleanupSmoothing ()

Description

This method is no longer required in Maya3.0 and later versions. (In previous versions, this method was needed to clean up the geometry after setSmoothing has been done on one or more edges).

Arguments

Return Value

  • status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

int MItMeshEdge:: index ( int index , MStatus * ReturnStatus )

Description

This method returns a vertex index for the current edge based upon the specified index.
The index can be either 0 or 1 since an edge is made up of exactly two vertices.

Arguments

  • index The vertex index in current edge (0 or 1)
  • ReturnStatus Status code

Return Value

  • The index in the vertex list of the edge vertex requested

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

int MItMeshEdge:: index ( MStatus * ReturnStatus ) const

Description

This method returns the index of the current edge in the iteration.

Arguments

  • ReturnStatus Status code

Return Value

  • The index of the current edge in the iteration

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MObject MItMeshEdge:: edge ( MStatus * ReturnStatus )

Description

This method is OBSOLETE, please use the currentItem method.

Get the current edge in the iteration as a component.

Components are used to specify one or more edges and are usefull in operating on groups of non-contiguous edges for a surface. Components do not contain any information about the surface that they refer to so an MDagPath must be specified when dealing with components.

Arguments

  • ReturnStatus Status code

Return Value

  • The current edge in the interation

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInsufficientMemory No memory available.
  • MS::kFailure An object error has occurred.

MObject MItMeshEdge:: currentItem ( MStatus * ReturnStatus )

Description

Get the current edge in the iteration as a component.

Components are used to specify one or more edges and are usefull in operating on groups of non-contiguous edges for a surface. Components do not contain any information about the surface that they refer to so an MDagPath must be specified when dealing with components.

Arguments

  • ReturnStatus Status code

Return Value

  • The current edge in the interation

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInsufficientMemory No memory available.
  • MS::kFailure An object error has occurred.

MStatus MItMeshEdge:: updateSurface ()

Description

Signal that this polygonal surface has changed and needs to redraw itself.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MItMeshEdge:: setIndex ( int index , int &prevIndex)

Description

This method sets the index of the current edge to be accessed. The current edge will no longer be in sync with any previous iteration. two vertices.

Arguments

  • index The index of desired edge to access.
  • ReturnStatus Status code

Return Value

  • The index of the current edge in the iteration

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

int MItMeshEdge:: getConnectedFaces ( MIntArray & faces, MStatus * ReturnStatus) const

Description

This method returns a list of faces (with 1 or 2 faces) connected to teh current edge.

Arguments

  • ReturnStatus Status code

Return Value

  • number of connected faces

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

int MItMeshEdge:: getConnectedEdges ( MIntArray & edges, MStatus * ReturnStatus) const

Description

This method returns a list of edges connected to the current edge.

Arguments

  • ReturnStatus Status code

Return Value

  • number of connected edges

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshEdge:: numConnectedEdges (int &edgeCount) const

Description

This method returns the number of edges connected to the current edge.

Arguments

  • ReturnStatus number of connected edge

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshEdge:: numConnectedFaces (int &faceCount) const

Description

This method returns the number of faces (1 or 2 ) connected to the current edge.

Arguments

  • Status code

Return Value

  • faceCount Number of connected faces

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshEdge:: connectedToFace ( int index , MStatus * ReturnStatus)

Description

This method determines whether the given face contains the current edge

Arguments

  • status Status code

Return Value

  • TRUE if contained, FALSE otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshEdge:: connectedToEdge ( int index , MStatus * ReturnStatus)

Description

This method determines whether the given edge is connected to the current edge

Arguments

  • status Status code

Return Value

  • TRUE if contained, FALSE otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

bool MItMeshEdge:: onBoundary ( MStatus * ReturnStatus )

Description

This method checks to see if the current edge is a border edge.

NOTE: it is possible to turn all edges into boundaries by extracting faces. In this case, onBoundary() will always return true even though it appears that there are internal edges.

Arguments

  • ReturnStatus Status code

Return Value

  • TRUE if it's a border edge, false otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

MStatus MItMeshEdge:: getLength (double &length, MSpace::Space space )

Description

This method returns the length of the current edge.

Arguments

  • length length of edge

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.
  • MS::kInvalidParameter Invalid index given.

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright