C++ API Reference
|
This class provides methods for managing MGeometry resources. More...
#include <MGeometryManager.h>
Public Types | |
enum | GeometricShape { kDefaultSphere = 0, kDefaultPlane, kDefaultCube } |
Default geometry shapes. More... | |
Static Public Member Functions | |
static MGeometryLegacy | getGeometry (const MDagPath &shape, const MGeometryRequirementsLegacy &requirements, MObject *components=NULL) |
Access the Geometry cache for a shape. More... | |
static MGeometryList * | referenceDefaultGeometry (const MGeometryManager::GeometricShape geomShape, const MGeometryRequirementsLegacy &requirements) |
Obtain a reference to geometry for some "default" shapes maintained by the manager such that the geometry returned will match a set of geometric requirements (MGeometryRequirementsLegacy). More... | |
static MStatus | dereferenceDefaultGeometry (MGeometryList *data) |
This is the companion method to referenceDefaultGeometry() and must always be called immediately after usage of data supplied by the reference call. More... | |
static const char * | className () |
Returns the name of this class. More... | |
This class provides methods for managing MGeometry resources.
It provides an interface for loading and using hardware textures.
enum GeometricShape |
|
static |
Access the Geometry cache for a shape.
[in] | shape | the surface |
[in] | requirements | the surface data you want in the cache. Attempting to access cache data not included in the requirements will fail. |
[in] | components | an optional component group, for accessing a sub-selection of faces (e.g. the faces assigned to a material) |
|
static |
Obtain a reference to geometry for some "default" shapes maintained by the manager such that the geometry returned will match a set of geometric requirements (MGeometryRequirementsLegacy).
The actual form is a geometric iterator (MGeometryList), which can be used to iterate over the internal data kept (MGeometry).
Note that all data is assumed to be "read-only", as the data is not owned by the caller. To maintain proper reference counting of internal data, the user must "deference" the data when no longer using it via the MGeometryManager::dereferenceGeometry() calls. It is recommended to immediately dereference the data after each use. There is negligable overhead to reference and dereference data in this manner.
Available default shapes include:
The following is an example usage via a hardware shader plugin for swatch rendering:
[in] | geomShape | Desired geometry shape. |
[in] | requirements | Geometry requirements (MGeometryRequirementsLegacy). |
A pointer to a geometry iterator (MGeometryList), which contains a reference to the geometric data (MGeometry). The MGeometry information which tries to match the requirements passed in. ( e.g. position, normal, texture coordinates, tangents, and binormals etc). It can be assumed that all data is floating point such that:
|
static |
This is the companion method to referenceDefaultGeometry() and must always be called immediately after usage of data supplied by the reference call.
This call simply maintains proper internal state for any data used.
[in] | geomIterator | The geometry iterator returned from referenceDefaultGeometry(). |
|
static |
Returns the name of this class.