C++ API Reference
MGeometryLegacy Class Reference

MGeometryLegacy stores the collection of MGeometryData arrays which describe a Maya surface, including per-component data such as UV mapping and colour. More...

#include <MGeometry.h>

Public Member Functions

 ~MGeometryLegacy ()
 Class destructor.
 
 MGeometryLegacy (const MGeometryLegacy &geom)
 Copy constructor. More...
 
MGeometryLegacyoperator= (const MGeometryLegacy &rhs)
 Copy constructor. More...
 
unsigned int primitiveArrayCount () const
 Get the number of primitive arrays for this surface. More...
 
const MGeometryPrimitive primitiveArray (unsigned int arrayNumber) const
 Get the primitive indexing data for this surface. More...
 
const MGeometryData position ()
 Get the position data for this surface. More...
 
const MGeometryData normal ()
 Get the normal data for this surface. More...
 
const MGeometryData componentId ()
 Get the Maya component id data for this surface. More...
 
const MGeometryData texCoord (const MString &name)
 Get a texture coordinate set by name. More...
 
const MGeometryData color (const MString &name)
 Get a color set by name. More...
 
const MGeometryData tangent (const MString &name)
 Get a tangent set by name. More...
 
const MGeometryData binormal (const MString &name)
 Get a binormal set by name. More...
 
const MGeometryData data (MGeometryData::DataType what, const MString &name)
 Get arbitrary surface data by name. More...
 

Friends

class MGeometryManager
 
class MGeometryList
 
class MVaryingParameter
 

Detailed Description

MGeometryLegacy stores the collection of MGeometryData arrays which describe a Maya surface, including per-component data such as UV mapping and colour.

Various methods are provided for returning MGeometryData containing the data for different properties of the geometry: the position() method returns position data, the normal() method returns normals, and so on.

The primitiveArray() method returns MGeometryPrimitive's which provide indexing into those property arrays for each primitive to be drawn.

Examples:
dx11Shader/dx11Shader.cpp, and hlslShader/hlslShader.cpp.

Constructor & Destructor Documentation

MGeometryLegacy ( const MGeometryLegacy geom)

Copy constructor.

Parameters
[in]geomMGeometryLegacy to copy.

Member Function Documentation

MGeometryLegacy & operator= ( const MGeometryLegacy rhs)

Copy constructor.

Parameters
[in]rhsMGeometryLegacy to copy
Returns
MGeometryLegacy copied into.
unsigned int primitiveArrayCount ( ) const

Get the number of primitive arrays for this surface.

Returns
Number of primitive arrays
Examples:
dx11Shader/dx11Shader.cpp.
const MGeometryPrimitive primitiveArray ( unsigned int  arrayNumber) const

Get the primitive indexing data for this surface.

The surface geometry may consist of more than one MGeometryPrimitive, each representing an array of primitives. For example, if the surface was composed of both triangles and quads there might be one MGeometryPrimitive for the triangles and a second for the quads. The arrayNumber parameter is used to select between these.

Each MGeometryPrimitive contains indices which are used to map the MGeometryData returned by the other methods of this class onto the primitives. For example, if the returned MGeometryPrimitive is for an array of triangles it will contain three indices for each triangle. Those indices can be used to index into the position data returned by the position() method, the normal data returned by the normal() method, and so on.

Parameters
[in]arrayNumberNumber of the index data to retrieve. Must be in the range 0 to primitiveArrayCount() - 1.
Returns
Primitive data structure, which may be empty.
Examples:
dx11Shader/dx11Shader.cpp, and hlslShader/hlslShader.cpp.
const MGeometryData position ( )

Get the position data for this surface.

Returns
The position data (which may be empty).
Examples:
dx11Shader/dx11Shader.cpp, and hlslShader/hlslShader.cpp.
const MGeometryData normal ( )

Get the normal data for this surface.

Returns
The normal data (which may be empty).
Examples:
dx11Shader/dx11Shader.cpp.
const MGeometryData componentId ( )

Get the Maya component id data for this surface.

This array allows you to correlate MGeometryLegacy entries with the corresponding component on the Maya surface (e.g. for meshes, this array will contains the vertex id).

Returns
The component id data (which may be empty).
const MGeometryData texCoord ( const MString name)

Get a texture coordinate set by name.

Parameters
[in]namethe name of the set to return
Returns
The texture coordinate data (which may be empty).
const MGeometryData color ( const MString name)

Get a color set by name.

Parameters
[in]namethe name of the set to return
Returns
The color data (which may be empty).
const MGeometryData tangent ( const MString name)

Get a tangent set by name.

Parameters
[in]namethe name of the uv set tangent data should be returned for
Returns
The tangent data (which may be empty).
const MGeometryData binormal ( const MString name)

Get a binormal set by name.

Parameters
[in]namethe name of the uv set binormal data should be returned for
Returns
The binormal data (which may be empty).
const MGeometryData data ( MGeometryData::DataType  what,
const MString name 
)

Get arbitrary surface data by name.

Parameters
[in]whatthe type of data requested
[in]namethe name of the data set requested
Returns
The geometry data (which may be empty).

The documentation for this class was generated from the following files: