H3D::H3DDisplayListObject::DisplayList Class Reference

We use the Field's lazy evaluation mechanisms to manage the GL display lists for rendering, giving automatic cache breaking when dependencies are modified. More...

#include <H3D/H3DDisplayListObject.h>

Inheritance diagram for H3D::H3DDisplayListObject::DisplayList:

Inheritance graph

List of all members.

Classes

class  IsActive
 The IsActive field is updated each scenegraph loop, since Scene::time is routed to it to see if the callList() function was called during or since the last loop. More...

Public Types

enum  CacheMode { ON, OFF, OPTIONS }
 The entries in CacheMode enumerator is used for checking if caching should be done or not. More...

Public Member Functions

 DisplayList ()
 Constructor.
 ~DisplayList ()
 Destructor.
void setCacheMode (CacheMode m)
 Set the cache mode.
CacheMode getCacheMode ()
 Get the cache mode.
bool usingCaching ()
 Returns true if caching is in use and false otherwise.
unsigned int cachingDelay ()
 Returns the number of loops the DisplayList must render without receiving an event before a display is built.
void breakCache ()
 If called the display list will be rebuilt on next call to.
virtual void update ()
 Calls tryBuildDisplayList().
virtual void propagateEvent (Event e)
 When the event is propagated the display list is invalidated.
virtual void callList (bool build_list=true)
 Calls the OpenGL call list for if it exists.
FieldgetEventPointer ()
 Gets the pointer to the last field that created an event to this field.
bool hasCausedEvent (Field *f)
 Returns true if the Field given has generated an event to this field since the last call to the update() function.
template<class FieldType >
bool hasCausedEvent (auto_ptr< FieldType > &f)
 Returns true if the Field given has generated an event to this field since the last call to the update() function.

Static Public Member Functions

static void rebuildAllDisplayLists ()
 Force a rebuild of all display lists created.

Protected Member Functions

bool haveValidDisplayList ()
 Returns true if we have a valid display list built that can be called.
bool tryBuildDisplayList (bool cache_broken)
 Try to build a display list.


Detailed Description

We use the Field's lazy evaluation mechanisms to manage the GL display lists for rendering, giving automatic cache breaking when dependencies are modified.


Member Enumeration Documentation

The entries in CacheMode enumerator is used for checking if caching should be done or not.

Enumerator:
ON  Caching is on.
OFF  Caching is off.
OPTIONS  Caching is depending on the GraphicalRenderingOptions in use.


Member Function Documentation

unsigned int H3DDisplayListObject::DisplayList::cachingDelay (  ) 

Returns the number of loops the DisplayList must render without receiving an event before a display is built.

References H3D::GraphicsCachingOptions::cachingDelay, H3D::GlobalSettings::getActive(), H3D::GlobalSettings::getOptionNode(), H3D::X3DGeometryNode::getOptionNode(), and H3D::Field::getOwner().

Referenced by breakCache(), DisplayList(), and propagateEvent().

void H3DDisplayListObject::DisplayList::callList ( bool  build_list = true  )  [virtual]

template<class FieldType >
bool H3D::H3DDisplayListObject::DisplayList::hasCausedEvent ( auto_ptr< FieldType > &  f  )  [inline]

Returns true if the Field given has generated an event to this field since the last call to the update() function.

bool H3D::H3DDisplayListObject::DisplayList::hasCausedEvent ( Field f  )  [inline]

Returns true if the Field given has generated an event to this field since the last call to the update() function.

bool H3D::H3DDisplayListObject::DisplayList::haveValidDisplayList (  )  [inline, protected]

Returns true if we have a valid display list built that can be called.

Referenced by callList().

bool H3DDisplayListObject::DisplayList::tryBuildDisplayList ( bool  cache_broken  )  [protected]

Try to build a display list.

Requires that the display lists of all H3DDisplayListNode instances that are routed to us are valid in order to build the cache.

Parameters:
cache_broken true if this call is made when the cache has just been broken, e.g. from the update() function.
Returns:
true if the list was successfully built, false otherwise.

References H3D::Field::getFullName(), H3D::Field::owner, and H3D::Node::render().

Referenced by callList(), and update().


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

Generated on Fri Nov 7 10:30:12 2008 for H3D API by  doxygen 1.5.7