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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions

# MFnSingleIndexedComponent Class Reference
OpenMaya - API module for common classes | FunctionSet classes

This reference page is linked to from the following overview topics: Components.

Search for all occurrences

## Detailed Description

Single indexed component function set.

This function set allows you to create, edit, and query single indexed components. Single indexed components store 1 dimensional index values.

Examples:

  apiMeshData.cpp, apiMeshShape.cpp, apiMeshShapeUI.cpp, apiSimpleShapeUI.cpp, meshOpCmd.cpp, meshOpNode.cpp, OpenGLViewportRenderer.cpp, splitUVCmd.cpp, and splitUVNode.cpp.

`#include <MFnSingleIndexedComponent.h>`

Inheritance diagram for MFnSingleIndexedComponent:
[legend]

List of all members.

## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnSingleIndexedComponent ()
| Destructor.
| MFnSingleIndexedComponent ()
| Default constructor.
| MFnSingleIndexedComponent (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
MObject | create (MFn::Type compType, MStatus *ReturnStatus=NULL)
| Create a single indexed component of the given type.
MStatus | addElement (int element)
| Add the specified element to the component.
MStatus | addElements (MIntArray &elements)
| Add the specified elements to the component.
int | element (int index, MStatus *ReturnStatus=NULL) const
| Returns the specified element from the component.
MStatus | getElements (MIntArray &elements) const
| Get all of the element indices from the component.
MStatus | setCompleteData (int numElements)
| Marks the component as complete (meaning all items are selected) and uses the argument to identify the total number of elements selected.
MStatus | getCompleteData (int &numElements) const
| Returns the number of elements for the complete component.
| MFnSingleIndexedComponent (const MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Constructor & Destructor Documentation

MFnSingleIndexedComponent | ( | MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnSingleIndexedComponent | ( | const MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

## Member Function Documentation

MFn::Type type | ( |  | ) | const`[virtual]`

Search for all occurrences

Function set type.

Return the class type : MFn::kSingleIndexedComponent.

Reimplemented from MFnComponent.

const char * className | ( |  | ) | const`[protected, virtual]`

Search for all occurrences

Class name.

Return the class name : "MFnSingleIndexedComponent".

Reimplemented from MFnComponent.

MObject create | ( | MFn::Type | compType,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Create a single indexed component of the given type.

Allowable types are

MFn::kCurveCVComponent MFn::kCurveEPComponent MFn::kCurveKnotComponent MFn::kMeshEdgeComponent MFn::kMeshPolygonComponent MFn::kMeshVertComponent MFn::kMeshMapComponent

Parameters:

  [in] | compType | the type of component to create
  [out] | ReturnStatus | status code

Returns:
  The new component

Status Codes:
  - MS::kSuccess the method was successful.
  - MS::kInvalidParameter invalid component type

Examples:
  apiMeshShape.cpp, apiMeshShapeUI.cpp, apiSimpleShapeUI.cpp, OpenGLViewportRenderer.cpp, and splitUVCmd.cpp.

MStatus addElement | ( | int | element | ) |

Search for all occurrences

Add the specified element to the component.

Parameters:

  [in] | element | the element index to be added

Returns:
  Status code

Status Codes:
  - MS::kSuccess the method was successful
  - MS::kFailure an object error has occurred

Examples:
  apiMeshShape.cpp, apiMeshShapeUI.cpp, apiSimpleShapeUI.cpp, and OpenGLViewportRenderer.cpp.

MStatus addElements | ( | MIntArray & | elements | ) |

Search for all occurrences

Add the specified elements to the component.

Parameters:

  [in] | elements | the array of element indices to be added

Returns:
  Status code

Status Codes:
  - MS::kSuccess the method was successful
  - MS::kFailure an object error has occurred

Examples:
  splitUVCmd.cpp.

int element | ( | int | index,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns the specified element from the component.

Parameters:

  [in] | index | the index of the element to retrieve
  [out] | ReturnStatus | status code

Returns:
  The index of the specified component

Status Codes:
  - MS::kSuccess the method was successful
  - MS::kFailure an object error has occurred

MStatus getElements | ( | MIntArray & | elements | ) | const

Search for all occurrences

Get all of the element indices from the component.

Parameters:

  [out] | elements | storage for the array of indices

Returns:
  Status code

Status Codes:
  - MS::kSuccess the method was successful
  - MS::kFailure an object error has occurred

MStatus setCompleteData | ( | int | numElements | ) |

Search for all occurrences

Marks the component as complete (meaning all items are selected) and uses the argument to identify the total number of elements selected.

If the component should contain N element indices, then the range would be [0,N-1].

Also sets the complete state of the component to 'true' (i.e. setComplete(true)).

Parameters:

  [in] | numElements | the maximum number of elements in the component

Returns:
  Status code

Status Codes:
  - MS::kSuccess the method was successful
  - MS::kFailure an object error has occurred

Examples:
  apiMeshShape.cpp.

MStatus getCompleteData | ( | int & | numElements | ) | const

Search for all occurrences

Returns the number of elements for the complete component.

A complete component means that all elements are selected.

Parameters:

  [out] | numElements | storage for the maximum number of elements

Returns:
  Status code

Status Codes:
  - MS::kSuccess the method was successful
  - MS::kFailure an object error has occurred

MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent
MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent MFnSingleIndexedComponent