C++ API Reference
|
This class holds the set of data elements which represent a Maya surface. More...
#include <MGeometryList.h>
Public Types | |
enum | { kNone = 0, kMatrices = 1 << 0, kFixedFunctionLighting = 1 << 1, kCulling = 1 << 2, kAll = -1 } |
Bit flags for the geometry method that govern which OpenGL state Maya sets for you. More... | |
enum | MCullMode { kCullNone, kCullCW, kCullCCW } |
Defines the culling modes to use when rendering this geometry. More... | |
Public Member Functions | |
MGeometryList (const MRenderingInfo &info, int initialCapacity=1) | |
Create an emtpy GeometryIterator for the specified rendering context. More... | |
~MGeometryList () | |
Class destructor. | |
bool | isDone () const |
Tests to see if the iterator has reached the end of the elements it contains. More... | |
void | next () |
Advance to the next element in the iterator. More... | |
void | reset () |
Reset this iterator to the first element. More... | |
int | length () const |
Query the total number of elements available through this iterator. More... | |
void | setCurrentElement (int i) |
Randomly access the ith element in the iterator. More... | |
MGeometryLegacy & | geometry (int setupFlags=kAll) |
Get the geometry for the current element in the iterator. More... | |
const MMatrix & | objectToWorldMatrix () const |
Get the object to world matrix for the current element in the iterator. More... | |
const MMatrix & | projectionMatrix () const |
Get the camera project matrix for the current element in the iterator. More... | |
const MMatrix & | viewMatrix () const |
Get the camera view matrix for the current element in the iterator. More... | |
MDagPath | path () const |
Get the dag path for the current element in the iterator. More... | |
MGeometryList::MCullMode | cullMode () const |
Get the rendering cull mode to use for current element in the iterator. More... | |
bool | addLast (const MDagPath &path, const MObject *components=NULL) |
Add the geometry representing a shape to this geometry iterator. More... | |
bool | addLast (const MGeometryLegacy &geometry, const MMatrix &matrix) |
Add arbitrary geometry to this geometry iterator. More... | |
Public Attributes | |
enum MGeometryList:: { ... } | MSetupFlags |
Bit flags for the geometry method that govern which OpenGL state Maya sets for you. | |
This class holds the set of data elements which represent a Maya surface.
It provides iterated access to a list of geometry items, along with the rendering context require to render them (e.g. matrix, etc).
anonymous enum |
Bit flags for the geometry method that govern which OpenGL state Maya sets for you.
enum MCullMode |
MGeometryList | ( | const MRenderingInfo & | info, |
int | initialCapacity = 1 |
||
) |
Create an emtpy GeometryIterator for the specified rendering context.
[in] | info | the rendering context the geometry in this iterator should use. |
[in] | initialCapacity | the number of elements to pre-allocate space for. |
bool isDone | ( | ) | const |
Tests to see if the iterator has reached the end of the elements it contains.
Once this method returns true, you should not call any further methods on the iterator.
void next | ( | ) |
Advance to the next element in the iterator.
This should only be called if the iterator indicates it has more elements through the isDone() method.
void reset | ( | ) |
Reset this iterator to the first element.
This allows you to iterate multiple times through the list.
int length | ( | ) | const |
Query the total number of elements available through this iterator.
void setCurrentElement | ( | int | i | ) |
Randomly access the ith element in the iterator.
[in] | i | the index of the element you want to access |
MGeometryLegacy & geometry | ( | int | setupFlags = kAll | ) |
Get the geometry for the current element in the iterator.
[in] | setupFlags | the parts of the rendering pipeline your shader needs setup in order to render. This can be any combination of kMatrices, kFixedFunctionLighting, kCulling, or kAll. For efficiency, you can avoid the overhead of setting up parts of the rendering pipeline not used by your shader (e.g. fixed function lighting). |
const MMatrix & objectToWorldMatrix | ( | ) | const |
Get the object to world matrix for the current element in the iterator.
const MMatrix & projectionMatrix | ( | ) | const |
Get the camera project matrix for the current element in the iterator.
const MMatrix & viewMatrix | ( | ) | const |
Get the camera view matrix for the current element in the iterator.
MDagPath path | ( | ) | const |
Get the dag path for the current element in the iterator.
MGeometryList::MCullMode cullMode | ( | ) | const |
Get the rendering cull mode to use for current element in the iterator.
Add the geometry representing a shape to this geometry iterator.
Note that you are only able to add geometry items to MGeometryLists you have created using the public constructor. Trying to add elements to an iterator passed to you from Maya (e.g. in a shader render call) will fail.
[in] | path | The DAG path for the shape to add |
[in] | components | The optional set of components (faces) to include in the geometry. A NULL value indicates the whole object should be added |
bool addLast | ( | const MGeometryLegacy & | geometry, |
const MMatrix & | matrix | ||
) |
Add arbitrary geometry to this geometry iterator.
Note that you are only able to add geometry items to MGeometryLists you have created using the public constructor. Trying to add elements to an iterator passed to you from Maya (e.g. in a shader render call) will fail.
[in] | geometry | the geometry cache to add |
[in] | matrix | the transformation to associate with this geometry |