osg::StencilTwoSided Class Reference

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

Inheritance diagram for osg::StencilTwoSided:

Inheritance graph
[legend]
List of all members.

Public Types

 FRONT = 0
 BACK = 1
 NEVER = GL_NEVER
 LESS = GL_LESS
 EQUAL = GL_EQUAL
 LEQUAL = GL_LEQUAL
 GREATER = GL_GREATER
 NOTEQUAL = GL_NOTEQUAL
 GEQUAL = GL_GEQUAL
 ALWAYS = GL_ALWAYS
 KEEP = GL_KEEP
 ZERO = GL_ZERO
 REPLACE = GL_REPLACE
 INCR = GL_INCR
 DECR = GL_DECR
 INVERT = GL_INVERT
 INCR_WRAP = GL_INCR_WRAP
 DECR_WRAP = GL_DECR_WRAP
enum  Face { FRONT = 0, BACK = 1 }
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, INCR_WRAP = GL_INCR_WRAP, DECR_WRAP = GL_DECR_WRAP
}

Public Member Functions

 StencilTwoSided ()
 StencilTwoSided (const StencilTwoSided &stencil, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.
 META_StateAttribute (osg, StencilTwoSided, STENCIL)
virtual int compare (const StateAttribute &sa) const
 return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
virtual bool getModeUsage (StateAttribute::ModeUsage &usage) const
 Return the modes associated with this StateAttribute.
void setFunction (Face face, Function func, int ref, unsigned int mask)
void setFunction (Face face, Function func)
Function getFunction (Face face) const
void setFunctionRef (Face face, int ref)
int getFunctionRef (Face face) const
void setFunctionMask (Face face, unsigned int mask)
unsigned int getFunctionMask (Face face) const
void setOperation (Face face, Operation sfail, Operation zfail, Operation zpass)
 set the operations to apply when the various stencil and depth tests fail or pass.
void setStencilFailOperation (Face face, Operation sfail)
 set the operation when the stencil test fails.
Operation getStencilFailOperation (Face face) const
 get the operation when the stencil test fails.
void setStencilPassAndDepthFailOperation (Face face, Operation zfail)
 set the operation when the stencil test passes but the depth test fails.
Operation getStencilPassAndDepthFailOperation (Face face) const
 get the operation when the stencil test passes but the depth test fails.
void setStencilPassAndDepthPassOperation (Face face, Operation zpass)
 set the operation when both the stencil test and the depth test pass.
Operation getStencilPassAndDepthPassOperation (Face face) const
 get the operation when both the stencil test and the depth test pass.
void setWriteMask (Face face, unsigned int mask)
unsigned int getWriteMask (Face face) const
virtual void apply (State &state) const
 apply the OpenGL state attributes.

Static Public Member Functions

static ExtensionsgetExtensions (unsigned int contextID, bool createIfNotInitalized)
 Function to call to get the extension of a specified context.
static void setExtensions (unsigned int contextID, Extensions *extensions)
 The setExtensions method allows users to override the extensions across graphics contexts.

Protected Member Functions

virtual ~StencilTwoSided ()

Protected Attributes

Function _func [2]
int _funcRef [2]
unsigned int _funcMask [2]
Operation _sfail [2]
Operation _zfail [2]
Operation _zpass [2]
unsigned int _writeMask [2]

Classes

class  Extensions
 Extensions class which encapsulates the querying of extensions and associated function pointers, and provide convenience wrappers to check for the extensions or use the associated functions. More...

Detailed Description

Encapsulate OpenGL two sided glStencilFunc/Op/Mask functions.


Member Enumeration Documentation

enum osg::StencilTwoSided::Face

Enumerator:
FRONT 
BACK 

enum osg::StencilTwoSided::Function

Enumerator:
NEVER 
LESS 
EQUAL 
LEQUAL 
GREATER 
NOTEQUAL 
GEQUAL 
ALWAYS 

enum osg::StencilTwoSided::Operation

Enumerator:
KEEP 
ZERO 
REPLACE 
INCR 
DECR 
INVERT 
INCR_WRAP 
DECR_WRAP 


Constructor & Destructor Documentation

osg::StencilTwoSided::StencilTwoSided (  ) 

osg::StencilTwoSided::StencilTwoSided ( const StencilTwoSided stencil,
const CopyOp copyop = CopyOp::SHALLOW_COPY 
)

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::StencilTwoSided::~StencilTwoSided (  )  [protected, virtual]


Member Function Documentation

virtual void osg::StencilTwoSided::apply ( State state  )  const [virtual]

apply the OpenGL state attributes.

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

Reimplemented from osg::StateAttribute.

virtual int osg::StencilTwoSided::compare ( const StateAttribute sa  )  const [virtual]

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

Implements osg::StateAttribute.

static Extensions* osg::StencilTwoSided::getExtensions ( unsigned int  contextID,
bool  createIfNotInitalized 
) [static]

Function to call to get the extension of a specified context.

If the Extension object for that context has not yet been created and the 'createIfNotInitalized' flag been set to false then returns NULL. If 'createIfNotInitalized' is true then the Extensions object is automatically created. However, in this case the extension object will only be created with the graphics context associated with ContextID.

Function osg::StencilTwoSided::getFunction ( Face  face  )  const [inline]

unsigned int osg::StencilTwoSided::getFunctionMask ( Face  face  )  const [inline]

int osg::StencilTwoSided::getFunctionRef ( Face  face  )  const [inline]

virtual bool osg::StencilTwoSided::getModeUsage ( StateAttribute::ModeUsage usage  )  const [inline, virtual]

Return the modes associated with this StateAttribute.

Reimplemented from osg::StateAttribute.

Operation osg::StencilTwoSided::getStencilFailOperation ( Face  face  )  const [inline]

get the operation when the stencil test fails.

Operation osg::StencilTwoSided::getStencilPassAndDepthFailOperation ( Face  face  )  const [inline]

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

Operation osg::StencilTwoSided::getStencilPassAndDepthPassOperation ( Face  face  )  const [inline]

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

unsigned int osg::StencilTwoSided::getWriteMask ( Face  face  )  const [inline]

osg::StencilTwoSided::META_StateAttribute ( osg  ,
StencilTwoSided  ,
STENCIL   
)

static void osg::StencilTwoSided::setExtensions ( unsigned int  contextID,
Extensions extensions 
) [static]

The setExtensions method allows users to override the extensions across graphics contexts.

Typically used when you have different extensions supported across graphics pipes but need to ensure that they all use the same low common denominator extensions.

void osg::StencilTwoSided::setFunction ( Face  face,
Function  func 
) [inline]

void osg::StencilTwoSided::setFunction ( Face  face,
Function  func,
int  ref,
unsigned int  mask 
) [inline]

void osg::StencilTwoSided::setFunctionMask ( Face  face,
unsigned int  mask 
) [inline]

void osg::StencilTwoSided::setFunctionRef ( Face  face,
int  ref 
) [inline]

void osg::StencilTwoSided::setOperation ( Face  face,
Operation  sfail,
Operation  zfail,
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::StencilTwoSided::setStencilFailOperation ( Face  face,
Operation  sfail 
) [inline]

set the operation when the stencil test fails.

void osg::StencilTwoSided::setStencilPassAndDepthFailOperation ( Face  face,
Operation  zfail 
) [inline]

set the operation when the stencil test passes but the depth test fails.

void osg::StencilTwoSided::setStencilPassAndDepthPassOperation ( Face  face,
Operation  zpass 
) [inline]

set the operation when both the stencil test and the depth test pass.

void osg::StencilTwoSided::setWriteMask ( Face  face,
unsigned int  mask 
) [inline]


Member Data Documentation

Function osg::StencilTwoSided::_func[2] [protected]

unsigned int osg::StencilTwoSided::_funcMask[2] [protected]

int osg::StencilTwoSided::_funcRef[2] [protected]

Operation osg::StencilTwoSided::_sfail[2] [protected]

unsigned int osg::StencilTwoSided::_writeMask[2] [protected]

Operation osg::StencilTwoSided::_zfail[2] [protected]

Operation osg::StencilTwoSided::_zpass[2] [protected]


The documentation for this class was generated from the following file:
Generated at Tue Aug 5 20:31:55 2008 for the OpenSceneGraph by doxygen 1.4.7.