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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MItCurveCV Class Reference
OpenMaya - API module for common classes

This reference page is linked to from the following overview topics: Naming Conventions, Using the Maya Python API, Appendix C: Frequently asked questions.

Search for all occurrences

## Detailed Description

Iterator for NURBS curve CVs.

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 ( MStatus::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;
        }

Examples:

  cvPosCmd.cpp, lassoTool.cpp, moveCurveCVsCmd.cpp, moveTool.cpp, and translateCmd.cpp.

`#include <MItCurveCV.h>`

List of all members.

## Public Member Functions
| MItCurveCV (MObject &curve, MStatus *ReturnStatus=NULL)
| Constructor.
| MItCurveCV (const MDagPath &curve, MObject &component=MObject::kNullObj, MStatus *ReturnStatus=NULL)
| Constructor.
virtual | ~MItCurveCV ()
| Class destructor.
bool | isDone (MStatus *ReturnStatus=NULL) const
| Returns true if the iteration is finished, i.e.
MStatus | next ()
| Advance to the next CV in the iteration.
MStatus | reset ()
| Reset the iterator to the first CV.
MStatus | reset (MObject &curve)
| Reset the iterator to the specified curve.
MStatus | reset (const MDagPath &curve, MObject &component=MObject::kNullObj)
| Reset the iterator to the specified curve and component.
MPoint | position (MSpace::Space space=MSpace::kObject, MStatus *ReturnStatus=NULL) const
| Return the position of the current CV.
MStatus | setPosition (const MPoint &pt, MSpace::Space space=MSpace::kObject)
| Set the position of the current CV to the specified point.
MStatus | translateBy (const MVector &vec, MSpace::Space space=MSpace::kObject)
| Translates the current CV by the amount specified in vec.
int | index (MStatus *ReturnStatus=NULL) const
| This method returns the index of the current CV in the CV array for this curve.
MObject | cv (MStatus *ReturnStatus=NULL) const
| This method is obsolete.
MObject | currentItem (MStatus *ReturnStatus=NULL) const
| This method returns the current CV as an MObject.
bool | hasHistoryOnCreate (MStatus *ReturnStatus=NULL) const
| This method determines if the shape was created with history.
MStatus | updateCurve ()
| This method is used to signal the curve that it has been changed and needs to redraw itself.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Constructor & Destructor Documentation

MItCurveCV | ( | MObject & | curve,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

This constructor is used when iterating over an entire curve.

Parameters:

  [in] | curve | The curve for the iteration
  [out] | 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 | ( | const MDagPath & | curve,
|  | MObject & | component = `MObject::kNullObj`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

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.

Parameters:

  [in] | curve | Dag path to the curve for the iteration
  [in] | component | A group of CVs to be iterated on
  [out] | 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 | ( |  | ) | `[virtual]`

Class destructor.

Deallocates memory used by this iterator.

## Member Function Documentation

bool isDone | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns true if the iteration is finished, i.e.

there are no more CVs to iterate on.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  Boolean value: true if there are no more CVs to iterate on, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus next | ( |  | ) |

Search for all occurrences

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.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus reset | ( |  | ) |

Search for all occurrences

Reset the iterator to the first CV.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The iterator was reset.
  - MS::kFailure An object error has occurred.

MStatus reset | ( | MObject & | curve | ) |

Search for all occurrences

Reset the iterator to the specified curve.

Parameters:

  [in] | curve | The curve for the iteration

Returns:
  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 reset | ( | const MDagPath & | curve,
|  | MObject & | component = `MObject::kNullObj`
| ) |  |

Search for all occurrences

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.

Parameters:

  [in] | curve | Dag path to the curve for the iteration
  [in] | component | A group of CVs to be iterated on

Returns:
  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 position | ( | MSpace::Space | space = `MSpace::kObject`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Return the position of the current CV.

Parameters:

  [in] | space | the co-oordinate system for the returned point
  [out] | ReturnStatus | Status code

Returns:
  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 setPosition | ( | const MPoint & | pt,
|  | MSpace::Space | space = `MSpace::kObject`
| ) |  |

Search for all occurrences

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

Parameters:

  [in] | pt | new position of CV
  [in] | space | the co-ordinate system for this transformation.

Returns:
  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 translateBy | ( | const MVector & | vec,
|  | MSpace::Space | space = `MSpace::kObject`
| ) |  |

Search for all occurrences

Translates the current CV by the amount specified in vec.

Parameters:

  [in] | vec | translation to be applied to the CV
  [in] | space | the co-oordinate system for this transformation.

Returns:
  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 index | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

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

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The index of the current CV

Status Codes:
  - MS::kSuccess The method was successful
  - MS::kFailure An object error has occurred

MObject cv | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

This method is obsolete.

Deprecated:
  Use the MItCurveCV::currentItem method.

This method returns the current CV as an MObject.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  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 currentItem | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

This method returns the current CV as an MObject.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  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 hasHistoryOnCreate | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

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.

Parameters:

  [out] | ReturnStatus |

Returns:
  Boolean value: true if shape has history, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus updateCurve | ( |  | ) |

Search for all occurrences

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.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV
MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV MItCurveCV