class MItCurveCV

Jump to documentation

Iterator for NURBS curve CVs. (OpenMaya) (OpenMaya.py)

public members:

MItCurveCV ( MObject & curve, MStatus * ReturnStatus = NULL )
MItCurveCV ( const MDagPath & curve, MObject & component = MObject::kNullObj , MStatus * ReturnStatus = NULL )
virtual ~MItCurveCV ()
bool isDone ( MStatus * ReturnStatus = NULL ) const
MStatus next ()
MStatus reset ()
MStatus reset ( MObject & curve )
MStatus reset ( const MDagPath & curve, MObject & component = MObject::kNullObj )
MPoint position ( MSpace::Space space = MSpace::kObject , MStatus * ReturnStatus = NULL ) const
MStatus setPosition ( const MPoint & pt, MSpace::Space space = MSpace::kObject )
MStatus translateBy ( const MVector & vec, MSpace::Space space = MSpace::kObject )
int index ( MStatus * ReturnStatus = NULL ) const
MObject cv ( MStatus * ReturnStatus = NULL ) const
OBSOLETE
MObject currentItem ( MStatus * ReturnStatus = NULL ) const
bool hasHistoryOnCreate ( MStatus * ReturnStatus = NULL ) const
MStatus updateCurve ()

Documentation

Iterate over CVs of a NURBS curve.
Description

This class is the iterator class for NURBS curve control vertices (CVs). The iteration can be for a given curve or for a group of CVs.

Example: Translates the CVs for a curve in the X direction (world space).

    MItCurveCV* cvIter = new MItCurveCV( curve, &stat );
    MVector vector(1.0,0.0,0.0);

    if ( MS::kSuccess == stat ) {
        for ( ; !cvIter->isDone(); cvIter->next() )
        {
            cvIter->translateBy( vector, MSpace::kWorld );
        }
        cvIter->updateCurve();	// Tell curve is has been changed
    }
    else {
        cerr << "Error creating iterator!" << endl;
    }

Functions

MItCurveCV:: MItCurveCV ( MObject & curve, MStatus * ReturnStatus )

Description

Constructor.
This constructor is used when iterating over an entire curve.

Arguments

  • curve The curve for the iteration
  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The iterator was constructed.
  • MS::kInsufficientMemory No memory available.
  • MS::kInvalidParameter An invalid object was given.
  • MS::kFailure An object error has occurred.

MItCurveCV:: MItCurveCV ( const MDagPath & curve, MObject & component, MStatus * ReturnStatus )

Description

Constructor.
This constructor is used when iterating over a group of CVs. If the component is not given then the iteration will be for the whole curve.

Arguments

  • curve Dag path to the curve for the iteration
  • component A group of CVs to be iterated on
  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The iterator was constructed.
  • MS::kInsufficientMemory No memory available.
  • MS::kInvalidParameter An invalid object was given.
  • MS::kFailure An object error has occurred.

MItCurveCV:: ~MItCurveCV ()

Description

Class destructor.
Deallocates memory used by this iterator.

bool MItCurveCV:: isDone ( MStatus * ReturnStatus ) const

Description

Returns true if the iteration is finished, i.e. there are no more CVs to iterate on.

Arguments

  • ReturnStatus Status code

Return Value

  • true There are no more CVs to iterate on.
  • false There are more CVs in the iteration.

Status Codes

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

MStatus MItCurveCV:: next ()

Description

Advance to the next CV in the iteration. If the iterator is already at the last CV then this method has no effect. Use isDone to determine if the iterator is at the last CV.

Arguments

  • ReturnStatus Status code

Return Value

  • Status code

Status Codes

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

MStatus MItCurveCV:: reset ()

Description

Reset the iterator to the first CV.

Arguments

  • ReturnStatus Status code

Return Value

  • Status code

Status Codes

  • MS::kSuccess The iterator was reset.
  • MS::kFailure An object error has occurred.

MStatus MItCurveCV:: reset ( MObject & curve )

Description

Reset the iterator to the specified curve.

Arguments

  • curve The curve for the iteration
  • ReturnStatus Status code

Return Value

  • Status code

Status Codes

  • MS::kSuccess The iterator was reset.
  • MS::kInsufficientMemory No memory available.
  • MS::kInvalidParameter An invalid object was given.
  • MS::kFailure An object error has occurred.

MStatus MItCurveCV:: reset ( const MDagPath & curve, MObject & component )

Description

Reset the iterator to the specified curve and component. The component is a group of CVs belonging to the specified curve. The component defaults to MObject::kNullObj. If a component is not given then the iterator will be reset for the whole curve.

Arguments

  • curve Dag path to the curve for the iteration
  • component A group of CVs to be iterated on
  • ReturnStatus Status code

Return Value

  • Status code

Status Codes

  • MS::kSuccess The iterator was reset.
  • MS::kInsufficientMemory No memory available.
  • MS::kInvalidParameter An invalid object was given.
  • MS::kFailure An object error has occurred.

MPoint MItCurveCV:: position ( MSpace::Space space, MStatus * ReturnStatus ) const

Description

Return the position of the current CV.

Arguments

  • space the co-oordinate system for the returned point
  • ReturnStatus Status code

Return Value

  • Status code

Status Codes

  • MS::kSuccess The position of the current CV was returned.
  • MS::kInvalidParameter Invalid space parameter..
  • MS::kFailure An Object error has occurred.

MStatus MItCurveCV:: setPosition ( const MPoint & pt, MSpace::Space space )

Description

Set the postion of the current CV to the specified point.

Arguments

  • space the co-oordinate system for this transformation.
  • ReturnStatus Status code

Return Value

  • Status code

Status Codes

  • MS::kSuccess The transformation was successful.
  • MS::kInvalidParameter Invalid space for this transformation.
  • MS::kFailure An Object error has occurred.

MStatus MItCurveCV:: translateBy ( const MVector & vec, MSpace::Space space )

Description

Translates the current CV by the amount sepcified in vec.

Arguments

  • ReturnStatus Status code
  • space the co-oordinate system for this transformation.

Return Value

  • Status code

Status Codes

  • MS::kSuccess The transformation was successful.
  • MS::kInvalidParameter Invalid space for this transformation.
  • MS::kFailure An Object error has occurred.

int MItCurveCV:: index ( MStatus * ReturnStatus ) const

Description

This method returns the index of the current CV in the CV array for this curve.

Arguments

  • ReturnStatus Status code

Return Value

  • The index of the current CV

Status Codes

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

MObject MItCurveCV:: cv ( MStatus * ReturnStatus ) const

Description

This method is OBSOLETE, please use the currentItem method.

This method returns the current CV as an MObject.

Arguments

  • ReturnStatus Status code

Return Value

  • A handle to the CV requested

Status Codes

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

MObject MItCurveCV:: currentItem ( MStatus * ReturnStatus ) const

Description

This method returns the current CV as an MObject.

Arguments

  • ReturnStatus Status code

Return Value

  • A handle to the CV requested

Status Codes

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

bool MItCurveCV:: hasHistoryOnCreate ( MStatus * ReturnStatus ) const

Description

This method determines if the shape was created with history.

If the object that this iterator is attached to is not a shape then this method will fail.

Arguments

  • ReturnStatus

Return Value

  • true shape has history
  • false shape does not have history

Status Codes

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

MStatus MItCurveCV:: updateCurve ()

Description

This method is used to signal the curve that it has been changed and needs to redraw itself.

When modifying a large number of CVs, it is most efficient to call this method after all of the CVs have been modified.

  • Status code

Status Codes

  • MS::kSuccess Method was successful.
  • MS::kFailure An Object error has occurred.

This class has no child classes.


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