class TGLSceneBase: public TGLLockable


 Scene base-class --  provides basic interface expected by the
 TGLViewer or its sub-classes:
 * unique scene id
 * scene locking
 * overall bounding box
 * list of viewers displaying the scene (for update propagation)
 * virtual interface for draw/select/render (?)

 The standard ROOT OpenGL scene is implemented in direct sub-class
 TGLScene.

 Note that while each scene can be shared among several viewers, ALL
 of them are obliged to share the same display-list space (this can
 be achieved on GL-context creation time; Matevz believes that by
 default all GL contexts must use shared display-lists etc).

Function Members (Methods)

 
    This is an abstract class, constructors will not be documented.
    Look at the header to check for available constructors.

public:
virtual~TGLSceneBase()
voidAddViewer(TGLViewerBase* viewer)
const TGLBoundingBox&BoundingBox() const
virtual voidCalcBoundingBox() const
static TClass*Class()
TGLClip*Clip() const
virtual TGLSceneInfo*CreateSceneInfo(TGLViewerBase* view)
TGLLockable::ELockTGLLockable::CurrentLock() const
Bool_tGetAutoDestruct() const
UInt_tGetMinorStamp() const
virtual const char*GetName() const
UInt_tGetTimeStamp() const
virtual const char*GetTitle() const
voidIncMinorStamp()
voidIncTimeStamp()
voidInvalidateBoundingBox()
virtual TClass*IsA() const
Bool_tTGLLockable::IsDrawOrSelectLock() const
Bool_tTGLLockable::IsLocked() const
virtual const char*LockIdStr() const
static const char*TGLLockable::LockName(TGLLockable::ELock lock)
static Bool_tTGLLockable::LockValid(TGLLockable::ELock lock)
Short_tLOD() const
virtual voidLodifySceneInfo(TGLRnrCtx& ctx)
virtual voidPostDraw(TGLRnrCtx& rnrCtx)
virtual voidPostRender(TGLRnrCtx& rnrCtx)
virtual voidPreDraw(TGLRnrCtx& rnrCtx)
virtual voidPreRender(TGLRnrCtx& rnrCtx)
virtual voidRebuildSceneInfo(TGLRnrCtx& ctx)
Bool_tTGLLockable::ReleaseLock(TGLLockable::ELock lock) const
voidRemoveViewer(TGLViewerBase* viewer)
virtual voidRender(TGLRnrCtx& rnrCtx)
virtual voidRenderOpaque(TGLRnrCtx& rnrCtx)
virtual voidRenderSelOpaque(TGLRnrCtx& rnrCtx)
virtual voidRenderSelTransp(TGLRnrCtx& rnrCtx)
virtual voidRenderTransp(TGLRnrCtx& rnrCtx)
virtual Bool_tResolveSelectRecord(TGLSelectRecord& rec, Int_t curIdx)
voidSetAutoDestruct(Bool_t a)
voidSetClip(TGLClip* p)
voidSetLOD(Short_t lod)
virtual voidSetName(const char* name)
virtual voidSetNameTitle(const char* name, const char* title)
voidSetStyle(Short_t st)
virtual voidSetTitle(const char* title)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
Short_tStyle() const
voidTagViewersChanged()
Bool_tTGLLockable::TakeLock(TGLLockable::ELock lock) const
virtual voidUpdateSceneInfo(TGLRnrCtx& ctx)
private:
TGLSceneBase&operator=(const TGLSceneBase&)

Data Members

public:
enum TGLLockable::ELock { kUnlocked
kDrawLock
kSelectLock
kModifyLock
};
protected:
Bool_tfAutoDestruct
TGLBoundingBoxfBoundingBoxbounding box for scene (axis aligned) - lazy update - use BoundingBox() to access
Bool_tfBoundingBoxValidbounding box valid?
TGLClip*fClipScene clipping-plane.
Bool_tfDoClipCheckPerform global clip-plane-check in UpdateSceneInfo()
Bool_tfDoFrustumCheckPerform global frustum-check in UpdateSceneInfo()
Bool_tfForceUpdateSIForce update of scene-info in PreRender().
Short_tfLODScene-lod.
TGLLockable::ELockTGLLockable::fLockLock state.
UInt_tfMinorStampCounter increased on minimal update.
TStringfNameObject identifier.
UInt_tfSceneIDUnique scene id.
Short_tfStyleScene-style.
UInt_tfTimeStampCounter increased on every update.
TStringfTitleObject title.
list<TGLViewerBase*,allocator<TGLViewerBase*> >fViewers
private:
static UInt_tfgSceneIDSrc

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

~TGLSceneBase()
 Destructor.
void AddViewer(TGLViewerBase* viewer)
 Add viewer to the list.
void RemoveViewer(TGLViewerBase* viewer)
 Remove viewer from the list.
 If auto-destruct is on and the last viewer is removed the scene
 destructs itself.
void TagViewersChanged()
 Tag all viewers as changed.
const char* LockIdStr()
 Name printed on locking info messages.
TGLSceneInfo* CreateSceneInfo(TGLViewerBase* view)
 Create a scene-info instance appropriate for this scene class.
 Here we instantiate the scene-info base-class TGLSceneInfo.
void RebuildSceneInfo(TGLRnrCtx& ctx)
 Fill scene-info with very basic information that is practically
 view independent. This is called when scene content is changed
 or when camera-interest changes.
void UpdateSceneInfo(TGLRnrCtx& ctx)
 Fill scene-info with information needed for rendering, take into
 account the render-context (viewer state, camera, clipping).
 Usually called from TGLViewer before rendering a scene if some
 moderately significant part of render-context has changed.

 Here we update the basic state (clear last-LOD, mark the time,
 set global <-> scene transforamtion matrices) and potentially
 study and refine the clipping planes based on scene bounding box.
void LodifySceneInfo(TGLRnrCtx& ctx)
 Setup LOD-dependant values in scene-info.

 Nothing to be done here but to store the last LOD.
void PreDraw(TGLRnrCtx& rnrCtx)
 Perform basic pre-render initialization:
  - calculate LOD, Style, Clipping,
  - build draw lists.

 This is called in the beginning of the GL-viewer draw cycle.
void PreRender(TGLRnrCtx& rnrCtx)
 Perform pre-render initialization - fill rnrCtx with
 values stored during PreDraw().

 This is called each time before RenderXyzz().
void Render(TGLRnrCtx& rnrCtx)
 This function does rendering of all stages, the shapes are
 rendered in the following order: opaque, transparent,
 selected-opaque, selected-transparent.

 GL-depth buffer is cleared after transparent shapes have been
 rendered.

 This is never called from ROOT GL directly. Use it if you know
 you are rendering a single scene.
void RenderOpaque(TGLRnrCtx& rnrCtx)
 Render opaque elements.
void RenderTransp(TGLRnrCtx& rnrCtx)
 Render transparent elements.
void RenderSelOpaque(TGLRnrCtx& rnrCtx)
 Render selected opaque elements.
void RenderSelTransp(TGLRnrCtx& rnrCtx)
 Render selected transparent elements.
void PostRender(TGLRnrCtx& rnrCtx)
 Perform post-render clean-up.
void PostDraw(TGLRnrCtx& rnrCtx)
 Finalize drawing.

 This is called at the end of the GL-viewer draw cycle.
Bool_t ResolveSelectRecord(TGLSelectRecord& rec, Int_t curIdx)
 Process selection record rec.
 'curIdx' is the item position where the scene should start
 its processing.
 Return TRUE if an object has been identified or FALSE otherwise.
 The scene-info member of the record is already set by the caller.

 See implementation in sub-class TGLScene, here we just return FALSE.
TGLSceneBase& operator=(const TGLSceneBase& )
const char * GetName()
{ return fName; }
const char * GetTitle()
{ return fTitle; }
void SetName(const char* name)
{ fName = name; }
void SetTitle(const char* title)
{ fTitle = title; }
void SetNameTitle(const char* name, const char* title)
{ SetName(name); SetTitle(title); }
UInt_t GetTimeStamp()
 Getters & setters
{ return fTimeStamp; }
void IncTimeStamp()
{ ++fTimeStamp; fMinorStamp = 1; }
UInt_t GetMinorStamp()
{ return fMinorStamp; }
void IncMinorStamp()
{ ++fMinorStamp; }
Short_t LOD()
{ return fLOD; }
void SetLOD(Short_t lod)
{ fLOD = lod; }
Short_t Style()
{ return fStyle; }
void SetStyle(Short_t st)
{ fStyle = st; }
void SetClip(TGLClip* p)
{ fClip = p; }
Bool_t GetAutoDestruct()
{ return fAutoDestruct; }
void SetAutoDestruct(Bool_t a)
{ fAutoDestruct = a; }
void CalcBoundingBox()
 BoundingBox
void InvalidateBoundingBox()
{ fBoundingBoxValid = kFALSE; }

Author: Matevz Tadel, Feb 2007
Last change: root/gl:$Id: TGLSceneBase.h 23087 2008-04-09 14:10:56Z rdm $
Last generated: 2008-06-25 08:41
Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *

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.