MClearOperation Class Reference

#include <MViewport2Renderer.h>

Class Description

+ Inheritance diagram for MClearOperation:

Public Types

enum  ClearMask {
  kClearNone = 0, kClearColor = 1, kClearDepth = 1 << 1, kClearStencil = 1 << 2,
  kClearAll = ~0
}
 ClearMask describes the set of channels to clear If the mask value is set then that given channel will be cleared. More...
 
- Public Types inherited from MRenderOperation
enum  MRenderOperationType {
  kClear, kSceneRender, kQuadRender, kUserDefined,
  kHUDRender, kPresentTarget
}
 Supported render operation types. More...
 

Public Member Functions

 MClearOperation (const MString &name)
 Constructor for a named clear operation. More...
 
virtual ~MClearOperation ()
 Default destructor.
 
bool overridesColors () const
 Query whether clear colors are set by the override or come from Maya's preferences. More...
 
unsigned int mask () const
 Query the clear mask. More...
 
const float * clearColor () const
 Query the first clear color value. More...
 
bool clearGradient () const
 Query if the clear should clear with a gradient. More...
 
const float * clearColor2 () const
 Query the second clear color value. More...
 
int clearStencil () const
 Query the stencil clear value. More...
 
float clearDepth () const
 Query the clear depth value. More...
 
void setOverridesColors (bool override)
 Set the enabled state to control whether the clear operation overrides Maya's color preferences. More...
 
void setMask (unsigned int mask)
 Set the clear mask to define which channels to clear. More...
 
void setClearColor (float value[4])
 Set the clear color value. More...
 
void setClearGradient (bool value)
 Set whether to clear with a vertical color gradient. More...
 
void setClearColor2 (float value[4])
 Set the clear second color value. More...
 
void setClearStencil (int value)
 Set the clear stencil value. More...
 
void setClearDepth (float value)
 Set the clear depth value. More...
 
- Public Member Functions inherited from MRenderOperation
virtual bool enableSRGBWrite ()
 Return whether to enable GPU based gamma correction during pixel writes. More...
 
virtual const MFloatPointviewportRectangleOverride ()
 Query for a viewport rectangle override. More...
 
virtual const MStringname () const
 Query the name of a render operator. More...
 
virtual bool getInputTargetDescription (const MString &name, MRenderTargetDescription &description)
 Return the description to use when creating the target for the named input. More...
 
virtual int writableTargets (unsigned int &count)
 Return the index of the first writable target in the inputTargets list. More...
 
virtual MRenderTarget *const * targetOverrideList (unsigned int &listSize)
 Return a list of pointers to render target which will be used as the target overrides for the operation. More...
 
const MStringArrayinputTargets ()
 An array of input target names that semantically declares the type of targets the operation requires as input. More...
 
const MStringArrayoutputTargets ()
 An array of output target names that semantically declares the type of targets the operation can produce. More...
 
void renameOutputTarget (const MString &name, const MString &newName)
 Renames an output target of an operation. More...
 
MRenderOperationType operationType () const
 Query the type (MRenderOperationType) of a render operator. More...
 

Protected Attributes

unsigned int mClearMask
 Clear mask.
 
float mClearColor [4]
 Clear color value.
 
float mClearColor2 [4]
 Secondary clear color value. More...
 
bool mClearGradient
 Flag to indicate whether to clear the gradient.
 
int mClearStencil
 Clear stencil value.
 
float mClearDepth
 Clear depth value.
 
- Protected Attributes inherited from MRenderOperation
MRenderOperationType mOperationType
 Operation type.
 
MString mName
 Identifier for a sub render.
 

Additional Inherited Members

- Protected Member Functions inherited from MRenderOperation
 MRenderOperation (const MString &name)
 Protected constructor. More...
 
MRenderTargetgetInputTarget (const MString &name)
 Gets the target associated with this input. More...
 

Member Enumeration Documentation

enum ClearMask

ClearMask describes the set of channels to clear If the mask value is set then that given channel will be cleared.

Enumerator
kClearNone 

Clear nothing.

kClearColor 

Clear color.

kClearDepth 

Clear depth.

kClearStencil 

Clear stencil.

kClearAll 

Clear all.

Constructor & Destructor Documentation

MClearOperation ( const MString name)

Constructor for a named clear operation.

The default is clear operation sets color, depth and stencil to all be cleared. The default clear colors are opaque black, the default stencil value is 0 and the default depth value is 1.0;

By default a color gradient is not used.

Parameters
[in]nameThe name that will be given to the operation.

Member Function Documentation

bool overridesColors ( ) const

Query whether clear colors are set by the override or come from Maya's preferences.

Returns
True if set by the override
unsigned int mask ( ) const

Query the clear mask.

Bit flags can be tested with the MClearOperation::ClearMask enumeration.

Returns
The clear mask
const float * clearColor ( ) const

Query the first clear color value.

Returns
Clear color
bool clearGradient ( ) const

Query if the clear should clear with a gradient.

Returns
Clear gradient flag.
const float * clearColor2 ( ) const

Query the second clear color value.

Returns
Clear color
int clearStencil ( ) const

Query the stencil clear value.

Returns
Stencil value
float clearDepth ( ) const

Query the clear depth value.

Returns
Depth value
void setOverridesColors ( bool  val)

Set the enabled state to control whether the clear operation overrides Maya's color preferences.

Parameters
[in]valenable or disable color overrides.
void setClearColor ( float  value[4])

Set the clear color value.

This will be the color used at the top of the gradient if a color gradient is specified.

Parameters
[in]valueColor value to set
+ Examples:
void setClearGradient ( bool  value)

Set whether to clear with a vertical color gradient.

If a gradient is used then mClearColor is the color at the top of gradient, and mClearColor2 is the color at the bottom of the gradient.

Parameters
[in]valueWhether to use a gradient
+ Examples:
void setClearColor2 ( float  value[4])

Set the clear second color value.

Only used when a color gradient is to be used.

Parameters
[in]valueColor value to set
void setClearStencil ( int  value)

Set the clear stencil value.

Parameters
[in]valueStencil value
void setClearDepth ( float  value)

Set the clear depth value.

Parameters
[in]valueDepth value

Member Data Documentation

float mClearColor2[4]
protected

Secondary clear color value.

Used when gradient background drawing enabled


The documentation for this class was generated from the following files:
  • MViewport2Renderer.h
  • MViewport2Renderer.cpp