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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MAttributeSpec Class Reference
OpenMaya - API module for common classes

This reference page is linked to from the following overview topics: コンポーネント.

Search for all occurrences

## Detailed Description

An attribute specification.

Class that encapsulates component/attribute information for generating selection items.

This class is used by MPxSurfaceShape::matchComponent for validating attributes specified as strings and converting that specification to a component object.

The attribute specification ".foo.bar[3].x" would be expressed like this (using a pseudo-structure description):

        MAttributeSpecArray[0..3] {
            MAttributeSpec[0] {
                name      = "foo"
                dimension = 0
            }
            MAttributeSpec[1] {
                name      = "bar"
                dimension = 1
                MAttributeIndex[0] = {
                    type      = kInteger
                    isRange   = false
                    isBounded = true
                    value     = 3
                }
            }
            MAttributeSpec[2] {
                name      = "x"
                dimension = 0
            }
        }

Examples:

  apiMeshShape.cpp.

`#include <MAttributeSpec.h>`

List of all members.

## Public Member Functions
| MAttributeSpec ()
| Constructor.
| MAttributeSpec (const char *name)
| Constructor.
| MAttributeSpec (const MString &name)
| Constructor.
| MAttributeSpec (const MAttributeSpec &other)
| Copy constructor.
| ~MAttributeSpec ()
| Destructor.
const MString | name () const
| Returns the attribute name part of the specification.
int | dimensions () const
| Returns the dimension of the attribute specification.
void | setName (const MString &name)
| Set the attribute name part of the specification.
void | setDimensions (int value)
| Set the dimension of the attribute specification.
MAttributeSpec & | operator= (const MAttributeSpec &rhs)
| Assignment operator.
const MAttributeIndex | operator[] (int index) const
| Returns an attribute index object for the specified element.
bool | operator== (const MAttributeSpec &other) const
| Comparison operator.
MAttributeIndex | operator[] (int index)
| This method is not available in Python.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Constructor & Destructor Documentation

MAttributeSpec | ( | const char * | name | ) |

Constructor.

Creates an attribute specification with the given attribute name.

Parameters:

  [in] | name | the attribute name to set

MAttributeSpec | ( | const MString & | name | ) |

Constructor.

Creates an attribute specification with the given attribute name.

Parameters:

  [in] | name | the attribute name to set

MAttributeSpec | ( | const MAttributeSpec & | other | ) |

Copy constructor.

Parameters:

  [in] | other | the attribute specification to copy

## Member Function Documentation

const MString name | ( |  | ) | const

Search for all occurrences

Returns the attribute name part of the specification.

Returns:
  The attribute name

Examples:
  apiMeshShape.cpp.

int dimensions | ( |  | ) | const

Search for all occurrences

Returns the dimension of the attribute specification.

For array attributes the dimension is > 0.

Returns:
  The attributes dimension

Examples:
  apiMeshShape.cpp.

void setName | ( | const MString & | name | ) |

Search for all occurrences

Set the attribute name part of the specification.

Parameters:

  [in] | name | the name to be set

void setDimensions | ( | int | value | ) |

Search for all occurrences

Set the dimension of the attribute specification.

Array attribute dimensions are > 0.

Parameters:

  [in] | value | the dimension value to be set

MAttributeSpec & operator= | ( | const MAttributeSpec & | rhs | ) |

Assignment operator.

Parameters:

  [in] | rhs | attribute specification to copy

Returns:
  A reference to the copied MAttributeSpec object.

const MAttributeIndex operator[] | ( | int | index | ) | const

Returns an attribute index object for the specified element.

Parameters:

  [in] | index | attribute index to return

Returns:
  The MAttributeIndex associated with the given index.

bool operator== | ( | const MAttributeSpec & | other | ) | const

Comparison operator.

Parameters:

  [in] | other | attribute specifier to be compared

Returns:
  The boolean indicating whether the object are same or not.

MAttributeIndex operator[] | ( | int | index | ) |

This method is not available in Python.

Returns an attribute index object for the specified element.

Parameters:

  [in] | index | attribute index to return

Returns:
  The MAttributeIndex associated with the given index.

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

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec
MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec MAttributeSpec