#include <MViewport2Renderer.h>
Base class for defining a rendering override.
Public Member Functions | |
MRenderOverride (const MString &name) | |
Constructor for a name render override. More... | |
virtual | ~MRenderOverride () |
Default destructor for a render override. | |
virtual MHWRender::DrawAPI | supportedDrawAPIs () const |
Returns the draw API supported by this override. More... | |
virtual bool | startOperationIterator () |
In order for an override to indicate the set of operations that are to be performed it must implement overrides for the iterator methods on the override: More... | |
virtual MRenderOperation * | renderOperation () |
Return the current operation being iterated over. More... | |
virtual bool | nextRenderOperation () |
Iterate to the next operation. More... | |
const MString & | name () const |
Query the name of the override. More... | |
virtual MString | uiName () const |
Query the user interface name for the override. More... | |
virtual MStatus | setup (const MString &destination) |
Perform any setup required before render operations are to be executed. More... | |
virtual MStatus | cleanup () |
Perform any cleanup required following the execution of render operations. More... | |
const MFrameContext * | getFrameContext () const |
Return frame context. More... | |
Friends | |
class | M3dView |
MRenderOverride | ( | const MString & | name | ) |
Constructor for a name render override.
[in] | name | Name of render override |
|
virtual |
Returns the draw API supported by this override.
The returned value may be formed as the bitwise 'or' of MRenderer::DrawAPI elements to indicate that the override supports multiple draw APIs. This method returns 'MHWRender::kOpenGL' by default.
|
virtual |
In order for an override to indicate the set of operations that are to be performed it must implement overrides for the iterator methods on the override:
The order that the operations are returned via these methods determines the order that the operations are invoked.
If there is a user operation (MUserRenderOperation) the execute() method for that operation will be called when the operation is invoked.
Note that the ordering will not change during one invocation of an override which is delimited by the setup() and cleanup() calls.
This particular method is called to allow the override to start iterating over a list of operations to be performed by the override.
The operations that are returned can be thought of as representing a "command list". This command list will perform in order from start to end.
Pseudo-code for the internal Maya iteration logic would look something like this:
MRenderOverride override; if (override.startOperationIterator()) { --> Get operation MRenderOperation *op = override.renderOperation(); while (op) { if (op) --> Add to "list" of operations to perform
--> Iterate to next operation if (!override.nextRenderOperation()) op = NULL; else op = override.renderOperation(); } }
|
virtual |
Return the current operation being iterated over.
The call to currentOperation() will occur after a startIteratingOperations() call.
|
virtual |
Iterate to the next operation.
If there are no more operations then this method should return false.
const MString & name | ( | ) | const |
Query the name of the override.
|
virtual |
Query the user interface name for the override.
If an empty string is returned then the value returned from the name() method will be used as the user interface name.
Perform any setup required before render operations are to be executed.
The default behaviour performs no actions.
An override is called once per render. The order of method calls when an override is called is as follows:
[in] | destination | String identifier which gives an indication as to where this override is being applied. Presently this will return a viewport panel name for interactive rendering. |
|
virtual |
Perform any cleanup required following the execution of render operations.
The default behaviour performs no actions.
const MHWRender::MFrameContext * getFrameContext | ( | ) | const |