class MGeometryData

Jump to documentation

Geometric data container (OpenMayaRender) (OpenMayaRender.py)

public members:

enum ElementSize
Specifies the size or dimension of each data element of the storage.
kInvalidElementSize
kOne
Single value
kTwo
2-tuple
kThree
3-tuple
kFour
4-tuple
enum ElementType
Specifies the data type of each data element of the storage.
kInvalidElementType
Invalid element type (default value)
kFloat
IEEE single precision floating point
kDouble
IEEE double precision floating point
kChar
Signed char
kUnsignedChar
Unsigned char
kInt16
Signed 16-bit integer
kUnsignedInt16
Unsigned 16-bit integer
kInt32
Signed 32-bit integer
kUnsignedInt32
Unsigned 32-bit integer
enum DataType
Specifies the data type of the storage array.
kInvalidDataType
Invalid data type (default value)
kPosition
Position vector
kNormal
Normal vector
kTexCoord
Texture coordinate tuple
kColor
Color tuple
kWeight
Vertex weighting data
kAPISupported
Separator to indicate native draw API supported types
kTangent
Tangent vector
kBiNormal
Bi-normal vector
kVelocity
Velocity vector
kPrimitiveCenter
Center of primitive
kColorMask
Mapped, unmapped color mask
kUserData
Arbitrary "user data"
kMaxDataTypeIndex
Valid entries are < kMaxDataTypeIndex
MGeometryData ( const char * dataName, DataType dataType , ElementType elementType , ElementSize elementSize , unsigned int elementCount , void* dataPtr = NULL, bool ownsData = true)
Constructor
MGeometryData (const MGeometryData &)
~MGeometryData ()
Destructor
const char * objectName () const
int uniqueID () const
DataType dataType () const
ElementType elementType () const
unsigned int elementTypeSize () const
ElementSize elementSize () const
unsigned int elementCount () const
void * data () const
void setCollectionNumber (int cn)
int collectionNumber () const
void setObjectOwnsData (bool val)
bool objectOwnsData () const

Documentation

This class is a geometric data container
Description

MGeometryData is a class which allows storage of arbitrary data which is formated to be specifically suitable for usage using a 3D display interface such as OpenGL.

Format options include:

Currently Maya only interprets a fixed format subset for data with recongnized semantics, This does not mean that the user cannot create any arbitrary format for data storage. Support formats with semantics includes:

Memory allocation of the correct size is left up to the user of this class.

Memory can be marked as "owned" by this class or the user of this class. Ownership by this class is the default behaviour specified in the constructor. If the data is marked as being owned by the class, it is assumed that the data is created using a "new" operation, as the destructor of this class will use a "delete" operation to free memory.

Internal Maya data which is passed to the user via this class is always assumed to be non-modifiable. If modified, stability cannot be ensured.

Functions

MGeometryData:: MGeometryData (const char * dataName, MGeometryData::DataType dataType , MGeometryData::ElementType elementType , MGeometryData::ElementSize elementSize , unsigned int elementCount , void * dataPtr, bool ownsData)

Description

Geometry data constructor. Data is reference counted. On creation the reference count is set to be 1.

Arguments

  • dataName : name of the data
  • dataType : type of data
  • elementType : element type
  • elementCount : element count
  • dataPtr : pointer to contiguous block of data
  • ownsData : flag to tell if the instance owns the data or not.

MGeometryData:: MGeometryData ( const MGeometryData & other )

Description

Copy constructor.

MGeometryData:: ~MGeometryData ()

Description

Class destructor. Automatically releases the associated image array.

const char * MGeometryData:: objectName () const

Description

Return the logical name of the geometry

Arguments

  • None

Return Value

  • NULL or object name string pointer

int MGeometryData:: uniqueID () const

Description

Return the per session unique identifier

Arguments

  • None

Return Value

  • Unique data identifier. -1 on error.

MGeometryData::DataType MGeometryData:: dataType () const

Description

Get the data type for the data.

Arguments

  • None

Return Value

  • Geometry data type. MGeometryData::kInvalid on error.

MGeometryData::ElementType MGeometryData:: elementType () const

Description

Returns the data type.

Arguments

  • None

Return Value

  • ElemenType. MGeometryData::kInvalidElementType on error.

unsigned int MGeometryData:: elementTypeSize () const

Description

Return the element type size

Arguments

  • None

Return Value

  • Size of element in bytes.

MGeometryData::ElementSize MGeometryData:: elementSize () const

Description

Return element size.

Arguments

  • None

Return Value

  • Element size. MGeometryData::kInvalidElementSize is returned on error.

unsigned int MGeometryData:: elementCount () const

Description

Return element count.

Arguments

  • None

Return Value

  • Element count. 0 is returned on error.

void * MGeometryData:: data () const

Description

Retrive a pointer to the internal data

Arguments

  • None

Return Value

  • Void pointer to the data. Pointer is NULL on error.

void MGeometryData:: setCollectionNumber (int collectionNumber )

Description

Set the collection number for the object. Numbers less than 0 are invalid collection numbers.

Arguments

  • collectionNumber :

Return Value

  • MS::kSuccess always.

int MGeometryData:: collectionNumber () const

Description

Get the collection number of the data. Collection numbers are zero-based.

Arguments

  • None

Return Value

  • -1 if failed. Else number greather than -1.

void MGeometryData:: setObjectOwnsData (bool value)

Description

Set ownship of the interal data.

Arguments

  • value : ownership flag to set to.

Return Value

  • None

bool MGeometryData:: objectOwnsData () const

Description

Return if the MGeometryData object owns the internal data or not.

Arguments

  • None

Return Value

  • true if owned internally, else false.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright