Open Inventor Reference
SoGLCacheContextElement Class Reference

#include <Inventor/elements/SoGLCacheContextElement.h>

Inheritance diagram for SoGLCacheContextElement:
SoElement

List of all members.

Public Types

enum  { DO_AUTO_CACHE = 1, DONT_AUTO_CACHE = 2 }
 Methods used to improve auto-caching algorithm: More...

Public Member Functions

virtual void init (SoState *state)
 Initializes element.
virtual SbBool matches (const SoElement *elt) const
 Standard element stuff:
virtual SoElementcopyMatchInfo () const
 Create and return a copy of this element.
virtual void print (FILE *fp) const
 Prints element (for debugging)

Static Public Member Functions

static void set (SoState *state, int context, SbBool is2PassTransparency, SbBool isRemoteRendering)
 Sets the current context.
static int get (SoState *state)
 Gets the current context.
static int getExtID (const char *str)
 Methods to quickly figure out if an OpenGL extension is available at run-time.
static SbBool extSupported (SoState *state, int ext)
 This routine is pretty quick:
static SbBool areMipMapsFast (SoState *state)
 TRUE if mip-mapped textures are known to be fast (fli2011: always returns TRUE nowadays, only kept to keep legacy code working):
static void shouldAutoCache (SoState *state, int bits)
 Called by nodes to say that they should/shouldn't be auto-cached (pass TRUE if should, FALSE if shouldn't, don't call this method at all if the node doesn't care):
static void setAutoCacheBits (SoState *state, int bits)
 Used by Separators to set/reset the auto-caching bits:
static int resetAutoCacheBits (SoState *state)
static SbBool getIsRemoteRendering (SoState *state)
static void initClass ()
 Initializes the SoElement class.

Protected Member Functions

virtual ~SoGLCacheContextElement ()

Protected Attributes

int context
SbBool is2PassTransp
SbBool isRemoteRendering
int autoCacheBits

Friends

class SoGLDisplayList

Detailed Description

Definition at line 178 of file SoGLCacheContextElement.h.


Member Enumeration Documentation

anonymous enum

Two bits are stored. Nodes that should be cached will set the DO_AUTO_CACHE bit, nodes that should NOT be cached will set the DONT_AUTO_CACHE bit. By default, DO_AUTO_CACHE is FALSE unless remote rendering is being done. DONT_AUTO_CACHE is FALSE by default. Separators will auto cache if DO_AUTO_CACHE is TRUE and DONT_AUTO_CACHE is FALSE, otherwise they won't auto-cache.

Enumerator:
DO_AUTO_CACHE 

Hack warning: I rely on TRUE==DO_AUTO_CACHE.

DONT_AUTO_CACHE 

Definition at line 226 of file SoGLCacheContextElement.h.


Constructor & Destructor Documentation

virtual SoGLCacheContextElement::~SoGLCacheContextElement ( ) [protected, virtual]

Member Function Documentation

static SbBool SoGLCacheContextElement::areMipMapsFast ( SoState state) [static]
virtual SoElement* SoGLCacheContextElement::copyMatchInfo ( ) const [virtual]

Implements SoElement.

static SbBool SoGLCacheContextElement::extSupported ( SoState state,
int  ext 
) [static]
static int SoGLCacheContextElement::get ( SoState state) [static]
static int SoGLCacheContextElement::getExtID ( const char *  str) [static]

This is the slow routine-- convert from a string to an integer. The integer should be saved to do quick lookups:

static SbBool SoGLCacheContextElement::getIsRemoteRendering ( SoState state) [inline, static]

Definition at line 258 of file SoGLCacheContextElement.h.

References SoState::getConstElement(), and isRemoteRendering.

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

Reimplemented from SoElement.

static void SoGLCacheContextElement::initClass ( ) [static]

Reimplemented from SoElement.

virtual SbBool SoGLCacheContextElement::matches ( const SoElement elt) const [virtual]

Returns TRUE if the widths match in both elements

Implements SoElement.

virtual void SoGLCacheContextElement::print ( FILE *  fp) const [virtual]

Reimplemented from SoElement.

static int SoGLCacheContextElement::resetAutoCacheBits ( SoState state) [inline, static]

Hack warning: I rely on TRUE==DO_AUTO_CACHE

Definition at line 247 of file SoGLCacheContextElement.h.

References autoCacheBits, SoState::getElementNoPush(), and isRemoteRendering.

static void SoGLCacheContextElement::set ( SoState state,
int  context,
SbBool  is2PassTransparency,
SbBool  isRemoteRendering 
) [static]

This is done by the renderAction; theoretically, a node that redirected the GL rendering context to another X server would also set this. This also frees up any display lists that are waiting for the context to become valid. The third argument indicates whether 2-pass transparency is in effect (as for DELAYED or SORTED blending), which means that caches containing transparent objects may not be valid. The fourth argument should be TRUE if remote rendering is being done; the SoSeparator auto-caching algorithm uses this information to help decide whether or not to build caches.

static void SoGLCacheContextElement::setAutoCacheBits ( SoState state,
int  bits 
) [inline, static]

Definition at line 242 of file SoGLCacheContextElement.h.

References SoState::getElementNoPush().

static void SoGLCacheContextElement::shouldAutoCache ( SoState state,
int  bits 
) [inline, static]

Definition at line 234 of file SoGLCacheContextElement.h.

References autoCacheBits, and SoState::getElementNoPush().


Friends And Related Function Documentation

friend class SoGLDisplayList [friend]

Definition at line 303 of file SoGLCacheContextElement.h.


Member Data Documentation

Definition at line 284 of file SoGLCacheContextElement.h.

Referenced by resetAutoCacheBits(), and shouldAutoCache().

Definition at line 281 of file SoGLCacheContextElement.h.


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