library: libRGL
#include "TGLDisplayListCache.h"

TGLDisplayListCache


class description - source file - inheritance tree (.pdf)

class TGLDisplayListCache

Inheritance Chart:
TGLDisplayListCache
    private:
TGLDisplayListCache(Bool_t enable = true, UInt_t size = 10000) virtual ~TGLDisplayListCache() UInt_t Find(TGLDisplayListCache::CacheID_t cacheID) const void Init() TGLDisplayListCache::CacheID_t MakeCacheID(const TGLDrawable& drawable, UInt_t LOD) const public:
TGLDisplayListCache(const TGLDisplayListCache&) Bool_t CaptureIsOpen() static TClass* Class() Bool_t CloseCapture() Bool_t Draw(const TGLDrawable& drawable, UInt_t LOD) const void Dump() const void Enable(Bool_t enable) static TGLDisplayListCache& Instance() virtual TClass* IsA() const Bool_t IsEnabled() Bool_t OpenCapture(const TGLDrawable& drawable, UInt_t LOD) TGLDisplayListCache& operator=(const TGLDisplayListCache&) void Purge() void Purge(const TGLDrawable& drawable) void Purge(const TGLDrawable& drawable, UInt_t LOD) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
UInt_t fSize ! Bool_t fInit ! Bool_t fEnabled ! Bool_t fCaptureOpen ! UInt_t fDLBase ! UInt_t fDLNextFree ! map<pair<const TGLDrawable*,const unsigned int>,unsigned int,less<pair<const TGLDrawable*,const unsigned int> >,allocator<pair<const pair<const TGLDrawable*,const unsigned int>,unsigned int> > > fCacheDLMap ! static TGLDisplayListCache* fgInstance ! the singleton cache instance static const UInt_t fgInvalidDLName

Class Description

                                                                      
 TGLDisplayListCache                                                  
                                                                      
 Singleton cache of GL display lists. Provides lazy automatic GL      
 display list capture of draws by a TGLDrawable at a certain 'LOD'    
 which can be disable on a global, per drawable or LOD basis.         
                                                                      
 Internally the cache creates a block of GL display lists of fSize,   
 and maintains a stl::map, mapping CacheID_t ids (created from        
 TGLDrawable and LOD draw flag) to 'name' entries in the GL display   
 list block.                                                          
                                                                      
 See TGLDrawable::Draw() for use.                                     
 NOTE: Purging of individual TGLDrawables not currently implemented:  
       Purge(const TGLDrawable & drawable)                            
       Purge(const TGLDrawable & drawable, UInt_t LOD)                // 

TGLDisplayListCache& Instance()
 Create (if required) and return the singleton display list cache

TGLDisplayListCache(Bool_t enable, UInt_t size) : fSize(size), fInit(kFALSE), fEnabled(enable), fCaptureOpen(kFALSE), fDLBase(fgInvalidDLName), fDLNextFree(fgInvalidDLName)
 Construct display list cache.
 Private constructor - cache is singleton obtained through
 TGLDisplayListCache::Instance()

~TGLDisplayListCache()
 Destroy display list cache - deleting internal GL display list block

void Init()
 Initialise the cache - create the internal GL display list block of size
 fSize

Bool_t Draw(const TGLDrawable & drawable, UInt_t LOD) const
 Draw (call) the GL dislay list entry associated with the drawable / LOD
 flag pair, and return kTRUE. If no list item associated, return KFALSE.

Bool_t OpenCapture(const TGLDrawable & drawable, UInt_t LOD)
 Open capture of GL draw commands into cache entry, associated with
 drawable / LOD pair. Capture is done in GL_COMPILE mode - so the cache
 entry has to be drawn using TGLDisplayListCache::Draw() after capture close.

 Return kTRUE if opened, kFALSE if not. Capture is not opened if cache not
 enabled or cache if full.
 GL display lists can be nested at 'run' (draw) time, but cannot be nested
 in capture - so attempting to nest captures is rejected.

Bool_t CloseCapture()
 Close currently open capture - return kTRUE if one open and successfully
 closed.

void Purge()
 Purge all entries for all drawable/LOD pairs from cache

void Purge(const TGLDrawable & /* drawable */)
 Purge all entries for a drawable at any LOD from cache
 NOTE: NOT IMPLEMENTED AT PRESENT!

void Purge(const TGLDrawable & /* drawable */, UInt_t /* LOD */)
 Purge entry for a drawable/LOD from cache
 NOTE: NOT IMPLEMENTED AT PRESENT!

UInt_t Find(CacheID_t cacheID) const
 Find GL display list block 'name' assocaited with the cacheID
 cacheID is unqiuely generated from drawable/LOD pair - see
 TGLDisplayListCache::MakeCacheID()
 Look at Effect STL on efficiency .

void Dump() const
 Dump usage count of cache



Inline Functions


        TGLDisplayListCache::CacheID_t MakeCacheID(const TGLDrawable& drawable, UInt_t LOD) const
                                  void Enable(Bool_t enable)
                                Bool_t IsEnabled()
                                Bool_t CaptureIsOpen()
                               TClass* Class()
                               TClass* IsA() const
                                  void ShowMembers(TMemberInspector& insp, char* parent)
                                  void Streamer(TBuffer& b)
                                  void StreamerNVirtual(TBuffer& b)
                   TGLDisplayListCache TGLDisplayListCache(const TGLDisplayListCache&)
                  TGLDisplayListCache& operator=(const TGLDisplayListCache&)


Author: Richard Maunder 25/05/2005
Last update: root/gl:$Name: $:$Id: TGLDisplayListCache.cxx,v 1.8 2005/12/01 11:04:04 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.