MGeometryList Class Reference
[OpenMayaRender - API module for rendering]

#include <MGeometryList.h>

Collaboration diagram for MGeometryList:

Collaboration graph
[legend]

List of all members.


Detailed Description

Geometric data cache.

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).

Examples:

hlslShader.cpp, and hlslShader.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)
 ~MGeometryList ()
bool isDone () const
void next ()
void reset ()
int length () const
void setCurrentElement (int i)
MGeometrygeometry (int setupFlags=kAll)
const MMatrixobjectToWorldMatrix () const
const MMatrixprojectionMatrix () const
const MMatrixviewMatrix () const
MDagPath path () const
MGeometryList::MCullMode cullMode () const
bool addLast (const MDagPath &path, const MObject *components=NULL)
bool addLast (const MGeometry &geometry, const MMatrix &matrix)

Public Attributes

enum MGeometryList:: { ... }  MSetupFlags
 Bit flags for the geometry method that govern which OpenGL state Maya sets for you.

Friends

class MUniformParameter
class MGeometryManager

Member Enumeration Documentation

anonymous enum

Bit flags for the geometry method that govern which OpenGL state Maya sets for you.

Enumerator:
kNone  No renderer setup is required for this element.
kMatrices  Setup the model view matrix for this element.
kFixedFunctionLighting  Setup the fixed function lighting state for this element.
kCulling  Setup the back/front face culling state for this element.
kAll  Setup all renderer state for this element.

Defines the culling modes to use when rendering this geometry.

Enumerator:
kCullNone  No culling should be performed on this geometry.
kCullCW  Cull clockwise faces when rendering this geometry.
kCullCCW  Cull counter-clockwise faces when rendering this geometry.


Constructor & Destructor Documentation

MGeometryList::MGeometryList ( const MRenderingInfo info,
int  initialCapacity = 1 
)

Create an emtpy GeometryIterator for the specified rendering context.

Parameters:
[in] info the rendering context the geometry in this iterator should use.
[in] initialCapacity the number of elements to pre-allocate space for.

MGeometryList::~MGeometryList (  ) 

Class destructor.


Member Function Documentation

bool MGeometryList::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.

Returns:
True if the iterator has no further elements, false if there are more elements remaining.
Examples:

void MGeometryList::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.

Examples:

void MGeometryList::reset (  ) 

Reset this iterator to the first element. This allows you to iterate multiple times through the list.

int MGeometryList::length (  )  const

Query the total number of elements available through this iterator.

Returns:
The total number of elements in the iterator.

void MGeometryList::setCurrentElement ( int  i  ) 

Randomly access the ith element in the iterator.

Parameters:
[in] i the index of the element you want to access

MGeometry & MGeometryList::geometry ( int  setupFlags = kAll  ) 

Get the geometry for the current element in the iterator.

Parameters:
[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).
Returns:
The geometry for the current element.
Examples:

const MMatrix & MGeometryList::objectToWorldMatrix (  )  const

Get the object to world matrix for the current element in the iterator.

Returns:
The matrix for the current element.
Examples:

const MMatrix & MGeometryList::projectionMatrix (  )  const

Get the camera project matrix for the current element in the iterator.

Returns:
The matrix for the current element.
Examples:

const MMatrix & MGeometryList::viewMatrix (  )  const

Get the camera view matrix for the current element in the iterator.

Returns:
The matrix for the current element.
Examples:

MDagPath MGeometryList::path (  )  const

Get the dag path for the current element in the iterator.

Returns:
The dag path for the current element.

MGeometryList::MCullMode MGeometryList::cullMode (  )  const

Get the rendering cull mode to use for current element in the iterator.

Returns:
The cull mode for the current element.
Examples:

bool MGeometryList::addLast ( const MDagPath path,
const MObject components = NULL 
)

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.

Parameters:
[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
Returns:
True if the element was added to the iterator, false otherwise.

bool MGeometryList::addLast ( const MGeometry 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.

Parameters:
[in] geometry the geometry cache to add
[in] matrix the transformation to associate with this geometry
Returns:
True if the element was added to the iterator, false otherwise.


Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6