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

sglLogicOp Class Reference

#include <sglStatelet.hpp>

Inheritance diagram for sglLogicOp::

sglStatelet sglObject List of all members.

Public Types

enum  LogicOpEnum {
  eCOPY = GL_COPY,
  eCLEAR = GL_CLEAR,
  eSET = GL_SET,
  eCOPY_INVERTED = GL_COPY_INVERTED,
  eNOOP = GL_NOOP,
  eINVERT = GL_INVERT,
  eAND = GL_AND,
  eNAND = GL_NAND,
  eOR = GL_OR,
  eNOR = GL_NOR,
  eXOR = GL_XOR,
  eEQUIV = GL_EQUIV,
  eAND_REVERSE = GL_AND_REVERSE,
  eAND_INVERTED = GL_AND_INVERTED,
  eOR_REVERSE = GL_OR_REVERSE,
  eOR_INVERTED = GL_OR_INVERTED
}

Public Methods

 sglLogicOp (LogicOpEnum op=eCOPY)
virtual ~sglLogicOp ()
void setLogicOp (LogicOpEnum op)
LogicOpEnum getLogicOp () const
void apply (sglCurrState *curr_state) const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Protected Attributes

LogicOpEnum m_logic_op

Detailed Description

This statelet encapsulates OpenGL's glLogicOp() and glEnable(GL_COLOR_LOGIC_OP) functions (note that glEnable(GL_INDEX_LOGIC_OP) is not supported by SGL) which sets the logical operation to be performed given the incoming fragment and the pixel currently stored in the color buffer. The default operation is sglLogicOp::eCOPY which overwrites the color buffer (destination) with the incoming fragment (source). The complete list of logical operations is contained in the LogicOpEnum list of this class.

Example:

   sglLogicOp *logic_op = new sglLogicOp;     // defaults to eCOPY
   logic_op->setLogicOp(sglLogicOp::eEQUIV);  // ~(source XOR dest)

Definition at line 1377 of file sglStatelet.hpp.


Member Enumeration Documentation

enum sglLogicOp::LogicOpEnum
 

The list of valid logic op tokens.

Enumeration values:
eCOPY   source (the default).
eCLEAR   zero.
eSET   one.
eCOPY_INVERTED   ~source.
eNOOP   dest.
eINVERT   ~dest.
eAND   source & dest.
eNAND   ~(source & dest).
eOR   source | dest.
eNOR   ~(source | dest).
eXOR   source ^ dest.
eEQUIV   ~(source ^ dest).
eAND_REVERSE   source & ~dest.
eAND_INVERTED   ~source & dest.
eOR_REVERSE   source | ~dest.
eOR_INVERTED   ~source | dest.

Definition at line 1381 of file sglStatelet.hpp.


Constructor & Destructor Documentation

sglLogicOp::sglLogicOp ( LogicOpEnum op = eCOPY ) [inline]
 

Constructor (also the default constructor).

Parameters:
op   The logical operation (one of the LogicOpEnum tokens). The default is eCOPY.

Definition at line 1422 of file sglStatelet.hpp.

sglLogicOp::~sglLogicOp ( ) [inline, virtual]
 

virtual destructor.

Definition at line 1426 of file sglStatelet.hpp.


Member Function Documentation

void sglLogicOp::setLogicOp ( LogicOpEnum op ) [inline]
 

Set the logical operation.

Parameters:
op   The logical operation (one of the LogicOpEnum tokens).

Definition at line 1431 of file sglStatelet.hpp.

LogicOpEnum sglLogicOp::getLogicOp ( ) const [inline]
 

Query the current logical operation.

Returns:
One of the LogicOpEnum tokens corresponding to the current logical operation.

Definition at line 1437 of file sglStatelet.hpp.

void sglLogicOp::apply ( sglCurrState * curr_state ) const [virtual]
 

Apply this state change to the current rendering state.

Parameters:
curr_state   Required for statelets that affect one another. For example the sglTransparency sets up depth mask and blending modes which interact with the sglBlending and sglDepthMask statelets, and the curr_state object is used to resolve these internal issues.

Reimplemented from sglStatelet.

virtual void sglLogicOp::printInfo ( ostream & ostrm,
const char * indent_string ) const [virtual]
 

Output the state of this node to the specified ostream.

Parameters:
ostrm   the ostream to which the output is sent
indent_string   the string (usually spaces) that is output at the beginning of every line of output

Reimplemented from sglStatelet.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:08 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001