- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# MClearOperation Class Reference

# OpenMayaRender - API module for rendering

This reference page is linked to from the following overview topics: Rendering Overrides.

Search for all occurrences

## Detailed Description

Class which defines the operation of clearing render target channels.

`#include <MViewport2Renderer.h>`

Inheritance diagram for MClearOperation:
[legend]

List of all members.

## Public Types
enum | ClearMask { kClearNone = 0, kClearColor = 1, kClearDepth = 1 << 1, kClearStencil = 1 << 2 }
| ClearMask describes the set of channels to clear If the mask value is set then that given channel will be cleared. More...
## Public Member Functions
unsigned int | mask () const
| Query the clear mask.
const float * | clearColor () const
| Query the first clear color value.
bool | clearGradient () const
| Query if the clear should clear with a gradient.
const float * | clearColor2 () const
| Query the second clear color value.
int | clearStencil () const
| Query the stencil clear value.
float | clearDepth () const
| Query the clear depth value.
void | setMask (unsigned int mask)
| Set the clear mask to define which channels to clear.
void | setClearColor (float value[4])
| Set the clear color value.
void | setClearGradient (bool value)
| Set whether to clear with a vertical color gradient.
void | setClearColor2 (float value[4])
| Set the clear second color value.
void | setClearStencil (int value)
| Set the clear stencil value.
void | setClearDepth (float value)
| Set the clear depth value.

## Member Enumeration Documentation

enum ClearMask

Search for all occurrences

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. Search for all occurrences
  kClearColor | Clear color. Search for all occurrences
  kClearDepth | Clear depth. Search for all occurrences
  kClearStencil | Clear stencil. Search for all occurrences

## Member Function Documentation

unsigned int mask | ( |  | ) | const

Search for all occurrences

Query the clear mask.

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

Returns:
  The clear mask

const float * clearColor | ( |  | ) | const

Search for all occurrences

Query the first clear color value.

Returns:
  Clear color

bool clearGradient | ( |  | ) | const

Search for all occurrences

Query if the clear should clear with a gradient.

Returns:
  Clear gradient flag.

const float * clearColor2 | ( |  | ) | const

Search for all occurrences

Query the second clear color value.

Returns:
  Clear color

int clearStencil | ( |  | ) | const

Search for all occurrences

Query the stencil clear value.

Returns:
  Stencil value

float clearDepth | ( |  | ) | const

Search for all occurrences

Query the clear depth value.

Returns:
  Depth value

void setMask | ( | unsigned int | mask | ) |

Search for all occurrences

Set the clear mask to define which channels to clear.

Parameters:

  [in] | mask | Clear mask to set.

void setClearColor | ( | float | value[4] | ) |

Search for all occurrences

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] | value | Color value to set

void setClearGradient | ( | bool | value | ) |

Search for all occurrences

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] | value | Whether to use a gradient

void setClearColor2 | ( | float | value[4] | ) |

Search for all occurrences

Set the clear second color value.

Only used when a color gradient is to be used.

Parameters:

  [in] | value | Color value to set

void setClearStencil | ( | int | value | ) |

Search for all occurrences

Set the clear stencil value.

Parameters:

  [in] | value | Stencil value

void setClearDepth | ( | float | value | ) |

Search for all occurrences

Set the clear depth value.

Parameters:

  [in] | value | Depth value

MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation
MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation MClearOperation