Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osg::Stencil Class Reference

Encapsulate OpenGL glStencilFunc/Op/Mask functions. More...

Inheritance diagram for osg::Stencil:

Inheritance graph
[legend]
List of all members.

Public Types

enum  Function {
  NEVER = GL_NEVER, LESS = GL_LESS, EQUAL = GL_EQUAL, LEQUAL = GL_LEQUAL,
  GREATER = GL_GREATER, NOTEQUAL = GL_NOTEQUAL, GEQUAL = GL_GEQUAL, ALWAYS = GL_ALWAYS
}
enum  Operation {
  KEEP = GL_KEEP, ZERO = GL_ZERO, REPLACE = GL_REPLACE, INCR = GL_INCR,
  DECR = GL_DECR, INVERT = GL_INVERT
}

Public Methods

 Stencil ()
 Stencil (const Stencil &stencil, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.

 META_StateAttribute (osg, Stencil, STENCIL)
virtual int compare (const StateAttribute &sa) const
 return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.

virtual void getAssociatedModes (std::vector< GLMode > &modes) const
 return the modes associated with this StateSet

void setFunction (const Function func, int ref, uint mask)
const Function getFunction () const
const int getFunctionRef () const
const uint getFunctionMask () const
void setOperation (const Operation sfail, const Operation zfail, const Operation zpass)
 set the operations to apply when the various stencil and depth tests fail or pass.

const Operation getStencilFailOperation () const
 get the operation when the stencil test fails.

const Operation getStencilPassAndDepthFailOperation () const
 get the operation when the stencil test passes but the depth test fails

const Operation getStencilPassAndDepthPassOperation () const
 get the operation when both the stencil test and the depth test pass

void setWriteMask (uint mask)
const uint getWriteMask () const
virtual void apply (State &state) const
 apply the OpenGL state attributes.


Protected Methods

virtual ~Stencil ()

Protected Attributes

Function _func
int _funcRef
uint _funcMask
Operation _sfail
Operation _zfail
Operation _zpass
uint _writeMask

Detailed Description

Encapsulate OpenGL glStencilFunc/Op/Mask functions.


Member Enumeration Documentation

enum osg::Stencil::Function
 

Enumeration values:
NEVER 
LESS 
EQUAL 
LEQUAL 
GREATER 
NOTEQUAL 
GEQUAL 
ALWAYS 

enum osg::Stencil::Operation
 

Enumeration values:
KEEP 
ZERO 
REPLACE 
INCR 
DECR 
INVERT 


Constructor & Destructor Documentation

osg::Stencil::Stencil  
 

osg::Stencil::Stencil const Stencil &    stencil,
const CopyOp   copyop = CopyOp::SHALLOW_COPY
[inline]
 

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::Stencil::~Stencil   [protected, virtual]
 


Member Function Documentation

virtual void osg::Stencil::apply State   state const [virtual]
 

apply the OpenGL state attributes.

The global state for the current OpenGL context is passed in to allow the StateAttribute to obtain details on the the current context and state.

Implements osg::StateAttribute.

virtual int osg::Stencil::compare const StateAttribute   sa const [inline, virtual]
 

return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.

Implements osg::StateAttribute.

virtual void osg::Stencil::getAssociatedModes std::vector< GLMode > &    modes const [inline, virtual]
 

return the modes associated with this StateSet

Reimplemented from osg::StateAttribute.

const Function osg::Stencil::getFunction   const [inline]
 

const uint osg::Stencil::getFunctionMask   const [inline]
 

const int osg::Stencil::getFunctionRef   const [inline]
 

const Operation osg::Stencil::getStencilFailOperation   const [inline]
 

get the operation when the stencil test fails.

const Operation osg::Stencil::getStencilPassAndDepthFailOperation   const [inline]
 

get the operation when the stencil test passes but the depth test fails

const Operation osg::Stencil::getStencilPassAndDepthPassOperation   const [inline]
 

get the operation when both the stencil test and the depth test pass

const uint osg::Stencil::getWriteMask   const [inline]
 

osg::Stencil::META_StateAttribute osg   ,
Stencil   ,
STENCIL   
 

void osg::Stencil::setFunction const Function    func,
int    ref,
uint    mask
[inline]
 

void osg::Stencil::setOperation const Operation    sfail,
const Operation    zfail,
const Operation    zpass
[inline]
 

set the operations to apply when the various stencil and depth tests fail or pass.

First parameter is to control the operation when the stencil test fails. The second parameter is to control the operation when the stencil test passes, but depth test fails. The third parameter controls the operation when both the stencil test and depth pass. Ordering of parameter is the same as if using glStencilOp(,,).

void osg::Stencil::setWriteMask uint    mask [inline]
 


Member Data Documentation

Function osg::Stencil::_func [protected]
 

uint osg::Stencil::_funcMask [protected]
 

int osg::Stencil::_funcRef [protected]
 

Operation osg::Stencil::_sfail [protected]
 

uint osg::Stencil::_writeMask [protected]
 

Operation osg::Stencil::_zfail [protected]
 

Operation osg::Stencil::_zpass [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:43 2002 for the Open Scene Graph by doxygen 1.2.16.