Open Inventor Reference
SoGLLazyElement Class Reference

Element that manages the GL state for the SoLazyElement. More...

#include <Inventor/elements/SoGLLazyElement.h>

Inheritance diagram for SoGLLazyElement:
SoLazyElement SoElement

List of all members.

Classes

struct  GLLazyState
 provide a public typedef for GLLazyState, so that GLRenderCache can use it: More...

Public Member Functions

virtual void init (SoState *state)
 Initializes element.
virtual void push (SoState *state)
 Override push() and pop() methods to maintain GL state.
virtual void pop (SoState *state, const SoElement *prevTopElement)
void sendDiffuseByIndex (int index) const
 Send diffuse color and transparency, by index Included for compatibility with SoMaterialBundle To be used by a shape to send additional colors after first send() Should NEVER be the first send of a shape!
void reset (SoState *state, uint32_t bitmask) const
 Destroy knowledge of GL state.
void send (const SoState *state, uint32_t mask) const
 Sends indicated component(s) to GL: Only sends if value is not already in GL.
virtual SbBool matches (const SoElement *) const
 note: matches, copyMatchinfo not used by this element.
virtual SoElementcopyMatchInfo () const
 Create a copy that we can put in a cache used list and call matches() on later.
SbBool lazyMatches (uint32_t checkGLFlag, uint32_t checkIVFlag, const SoGLLazyElement *eltInState)
 Replace matches() for this element: matches "this" element GL or IV state with values in eltInState.
SoGLLazyElementcopyLazyMatchInfo (SoState *state)
 Replaces copyMatchInfo for this element: makes a GLLazyElement with some initialization.
void getCopyGL (SoGLLazyElement *cacheLazyElement, SoGLLazyElement::GLLazyState &cacheGLState)
 method that makes a copy of GL state at cache close().
void copyBackGL (SoGLLazyElement *cacheLazyElement, SoGLLazyElement::GLLazyState &cacheGLState)
 method that copies GL state back into "this" element after cache has been called.
void sendVPPacked (SoState *state, const unsigned char *pcolor)
 Send a packed color (not in state).
virtual ~SoGLLazyElement ()
 Note: destructor is public, so cache can delete its copy.
void mergeCacheInfo (SoGLRenderCache *childCache, SoGLRenderCache *parentCache, uint32_t doSendFlag, uint32_t checkIVFlag, uint32_t checkGLFlag)
void updateColorVBO (SoState *state, SoVBO *vbo)
 Update the passed VBO with the packed colors if the diffuse/transparency node ids do not match.

Static Public Member Functions

static void sendAllMaterial (SoState *state)
 Static sends, always send top-of-stack. Intended for extender use.
static void sendNoMaterial (SoState *state)
static void sendOnlyDiffuseColor (SoState *state)
static SbBool isColorIndex (SoState *state)
static SoGLLazyElementgetInstance (const SoState *state)
 Return the top (current) instance of the element in the state Note it does NOT cause cache dependency! It also casts away the const.
static void initClass ()
 Initializes the SoGLLazyElement class.

Detailed Description

Note that this class relies on SoLazyElement to store the inventor color(s), etc. in the instance. This element keeps GL shadow copies of colors

Definition at line 76 of file SoGLLazyElement.h.


Constructor & Destructor Documentation

virtual SoGLLazyElement::~SoGLLazyElement ( ) [virtual]

Member Function Documentation

void SoGLLazyElement::copyBackGL ( SoGLLazyElement cacheLazyElement,
SoGLLazyElement::GLLazyState cacheGLState 
) [inline]

only copies if bit in bitmask is set. also sets invalidBits to FALSE for these components.

Definition at line 181 of file SoGLLazyElement.h.

SoGLLazyElement* SoGLLazyElement::copyLazyMatchInfo ( SoState state)

also initializes cacheSetBits to zero.

virtual SoElement* SoGLLazyElement::copyMatchInfo ( ) const [inline, virtual]

Reimplemented from SoLazyElement.

Definition at line 139 of file SoGLLazyElement.h.

void SoGLLazyElement::getCopyGL ( SoGLLazyElement cacheLazyElement,
SoGLLazyElement::GLLazyState cacheGLState 
)

goes from state="this" to cacheGLState only copies if bitmask (GLSend of cache lazy element) is set.

static SoGLLazyElement* SoGLLazyElement::getInstance ( const SoState state) [inline, static]

Definition at line 119 of file SoGLLazyElement.h.

References SoState::getConstElement().

virtual void SoGLLazyElement::init ( SoState state) [virtual]

Reimplemented from SoLazyElement.

static void SoGLLazyElement::initClass ( ) [static]

Reimplemented from SoLazyElement.

static SbBool SoGLLazyElement::isColorIndex ( SoState state) [inline, static]

Definition at line 113 of file SoGLLazyElement.h.

References SoLazyElement::getInstance().

SbBool SoGLLazyElement::lazyMatches ( uint32_t  checkGLFlag,
uint32_t  checkIVFlag,
const SoGLLazyElement eltInState 
) [inline]
virtual SbBool SoGLLazyElement::matches ( const SoElement ) const [inline, virtual]

they are replaced by lazyMatches, copyLazyMatchInfo

Reimplemented from SoLazyElement.

Definition at line 137 of file SoGLLazyElement.h.

References FALSE.

void SoGLLazyElement::mergeCacheInfo ( SoGLRenderCache childCache,
SoGLRenderCache parentCache,
uint32_t  doSendFlag,
uint32_t  checkIVFlag,
uint32_t  checkGLFlag 
)
virtual void SoGLLazyElement::pop ( SoState state,
const SoElement prevTopElement 
) [virtual]

Reimplemented from SoElement.

virtual void SoGLLazyElement::push ( SoState state) [virtual]

Reimplemented from SoLazyElement.

void SoGLLazyElement::reset ( SoState state,
uint32_t  bitmask 
) const
void SoGLLazyElement::send ( const SoState state,
uint32_t  mask 
) const [inline]

note: has side effects, cannot really be const. however will not necessarily cause cache dependency.

Definition at line 131 of file SoGLLazyElement.h.

References SoState::isCacheOpen().

static void SoGLLazyElement::sendAllMaterial ( SoState state) [inline, static]
void SoGLLazyElement::sendDiffuseByIndex ( int  index) const
static void SoGLLazyElement::sendNoMaterial ( SoState state) [inline, static]
static void SoGLLazyElement::sendOnlyDiffuseColor ( SoState state) [inline, static]
void SoGLLazyElement::sendVPPacked ( SoState state,
const unsigned char *  pcolor 
)

Send transparency as stipple if necessary.

void SoGLLazyElement::updateColorVBO ( SoState state,
SoVBO vbo 
)

The documentation for this class was generated from the following file: