C++ API Reference
|
This method is obsolete. More...
#include <MGeometryData.h>
Public Types | |
enum | ElementSize { kInvalidElementSize = 0, kOne = 1, kTwo, kThree, kFour } |
Specifies the size or dimension of each data element of the storage. More... | |
enum | ElementType { kInvalidElementType = -1, kFloat = 0, kDouble, kChar, kUnsignedChar, kInt16, kUnsignedInt16, kInt32, kUnsignedInt32 } |
Specifies the data type of each data element of the storage. More... | |
enum | DataType { kInvalidDataType = 0, kPosition, kNormal, kTexCoord, kColor, kWeight, kAPISupported, kTangent, kBiNormal, kVelocity, kPrimitiveCenter, kColorMask, kUserData, kMaxDataTypeIndex } |
Specifies the data type of the storage array. More... | |
Public Member Functions | |
MGeometryData (const char *dataName, DataType dataType, ElementType elementType, ElementSize elementSize, unsigned int elementCount, void *dataPtr=NULL, bool ownsData=true) | |
Geometry data constructor. More... | |
MGeometryData (const MGeometryData &) | |
Copy constructor. | |
~MGeometryData () | |
Class destructor. More... | |
const char * | objectName () const |
Return the logical name of the geometry. More... | |
int | uniqueID () const |
Return the per session unique identifier. More... | |
DataType | dataType () const |
Get the data type for the data. More... | |
ElementType | elementType () const |
Returns the data type. More... | |
unsigned int | elementTypeSize () const |
Return the element type size. More... | |
ElementSize | elementSize () const |
Return element size. More... | |
unsigned int | elementCount () const |
Return element count. More... | |
void * | data () const |
Retrieve a pointer to the internal data. More... | |
void | setCollectionNumber (int cn) |
Set the collection number for the object. More... | |
int | collectionNumber () const |
Get the collection number of the data. More... | |
void | setObjectOwnsData (bool val) |
Set ownship of the interal data. More... | |
bool | objectOwnsData () const |
Return if the MGeometryData object owns the internal data or not. More... | |
Friends | |
class | MGeometryLegacy |
class | MHardwareRenderer |
class | MD3D9Renderer |
This method is obsolete.
This class 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:
There are specific "type" identifiers to provide a semantic on for the data. These 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.
enum ElementSize |
enum ElementType |
Specifies the data type of each data element of the storage.
enum DataType |
Specifies the data type of the storage array.
OPENMAYA_MAJOR_NAMESPACE_OPEN MGeometryData | ( | const char * | dataName, |
MGeometryData::DataType | dataType, | ||
MGeometryData::ElementType | elementType, | ||
MGeometryData::ElementSize | elementSize, | ||
unsigned int | elementCount, | ||
void * | dataPtr = NULL , |
||
bool | ownsData = true |
||
) |
Geometry data constructor.
Data is reference counted. On creation the reference count is set to be 1.
[in] | dataName | name of the data |
[in] | dataType | type of data |
[in] | elementType | element type |
[in] | elementSize | size or dimension of an element. For example, a 3D position vector has three components per position (x, y, z) so it would have an elementSize of kThree. |
[in] | elementCount | element count |
[in] | dataPtr | pointer to contiguous block of data |
[in] | ownsData | flag to tell if the instance owns the data or not. |
~MGeometryData | ( | ) |
Class destructor.
Automatically releases the associated image array.
const char * objectName | ( | ) | const |
Return the logical name of the geometry.
int uniqueID | ( | ) | const |
Return the per session unique identifier.
MGeometryData::DataType dataType | ( | ) | const |
Get the data type for the data.
MGeometryData::ElementType elementType | ( | ) | const |
Returns the data type.
unsigned int elementTypeSize | ( | ) | const |
Return the element type size.
MGeometryData::ElementSize elementSize | ( | ) | const |
Return element size.
unsigned int elementCount | ( | ) | const |
Return element count.
void * data | ( | ) | const |
Retrieve a pointer to the internal data.
void setCollectionNumber | ( | int | collectionNumber | ) |
Set the collection number for the object.
Numbers less than 0 are invalid collection numbers.
[in] | collectionNumber | The number to use |
int collectionNumber | ( | ) | const |
Get the collection number of the data.
Collection numbers are zero-based.
void setObjectOwnsData | ( | bool | value | ) |
Set ownship of the interal data.
[in] | value | ownership flag to set to. |
bool objectOwnsData | ( | ) | const |
Return if the MGeometryData object owns the internal data or not.