+
class TGLScene
-
library: libRGL
#include "TGLScene.h"
Display options:
Show inherited
Show non-public

class TGLScene: public TGLSceneBase

 TGLScene::TSceneInfo

 Extend TGLSceneInfo for needs of TGLScene:

 1. DrawElement vectors for opaque/transparent shapes which cache
 physicals that pass the clip tests (frustum and additional
 clip-object);

 2. Statistics / debug information

Function Members (Methods)

public:
TGLScene()
virtual~TGLScene()
virtual voidAdoptLogical(TGLLogicalShape& shape)
virtual voidAdoptPhysical(TGLPhysicalShape& shape)
voidBeginSmartRefresh()
virtual voidBeginUpdate()
const TGLBoundingBox&TGLSceneBase::BoundingBox() const
virtual voidCalcBoundingBox() const
static TClass*Class()
TGLClip*TGLSceneBase::Clip() const
virtual TGLScene::TSceneInfo*CreateSceneInfo(TGLViewerBase* view)
TGLLockable::ELockTGLLockable::CurrentLock() const
virtual Bool_tDestroyLogical(TObject* logid)
virtual Int_tDestroyLogicals()
virtual Bool_tDestroyPhysical(UInt_t phid)
virtual Int_tDestroyPhysicals(Bool_t incModified, const TGLCamera* camera = 0)
voidDumpMapSizes() const
voidEndSmartRefresh()
virtual voidEndUpdate()
virtual TGLLogicalShape*FindLogical(TObject* logid) const
TGLLogicalShape*FindLogicalSmartRefresh(TObject* ID) const
virtual TGLPhysicalShape*FindPhysical(UInt_t phid) const
virtual voidTGLSceneBase::FullRender(TGLRnrCtx& rnrCtx)
TGLContextIdentity*GetGLCtxIdentity() const
virtual UInt_tGetMaxPhysicalID()
virtual const char*TGLSceneBase::GetName() const
UInt_tTGLSceneBase::GetTimeStamp() const
virtual const char*TGLSceneBase::GetTitle() const
voidTGLSceneBase::IncTimeStamp()
voidTGLSceneBase::InvalidateBoundingBox()
virtual TClass*IsA() const
Bool_tTGLLockable::IsDrawOrSelectLock() const
Bool_tTGLLockable::IsLocked() const
static Bool_tIsOutside(const TGLBoundingBox& box, const TGLPlaneSet_t& planes)
virtual const char*TGLSceneBase::LockIdStr() const
static const char*TGLLockable::LockName(TGLLockable::ELock lock)
static Bool_tTGLLockable::LockValid(TGLLockable::ELock lock)
Short_tTGLSceneBase::LOD() const
virtual voidLodifySceneInfo(TGLRnrCtx& ctx)
virtual voidPostRender(TGLRnrCtx& rnrCtx)
virtual voidPreRender(TGLRnrCtx& rnrCtx)
Bool_tTGLLockable::ReleaseLock(TGLLockable::ELock lock) const
virtual voidRender(TGLRnrCtx& rnrCtx)
virtual Double_tRenderAllPasses(TGLRnrCtx& rnrCtx, Double_t timeout)
virtual Double_tRenderElements(TGLRnrCtx& rnrCtx, TGLScene::DrawElementVec_t& elementVec, Double_t timeout, const TGLPlaneSet_t* clipPlanes = 0)
virtual Double_tRenderOnePass(TGLRnrCtx& rnrCtx, Double_t timeout, const TGLPlaneSet_t* clipPlanes = 0)
virtual Bool_tResolveSelectRecord(TGLSelectRecord& rec, Int_t curIdx)
static voidRGBAFromColorIdx(Float_t* rgba, Color_t ci, Char_t transp = 0)
voidTGLSceneBase::SetClip(TGLClip* p)
voidTGLSceneBase::SetLOD(Short_t lod)
virtual voidTGLSceneBase::SetName(const char* name)
virtual voidTGLSceneBase::SetNameTitle(const char* name, const char* title)
voidTGLSceneBase::SetStyle(Short_t st)
virtual voidTGLSceneBase::SetTitle(const char* title)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
UInt_tSizeOfScene() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
Short_tTGLSceneBase::Style() const
Bool_tTGLLockable::TakeLock(TGLLockable::ELock lock) const
virtual voidUpdateLogical(TObject* logid)
virtual voidUpdatePhysical(UInt_t phid, Double_t* trans, UChar_t* col)
virtual voidUpdatePhysical(UInt_t phid, Double_t* trans, Color_t cidx = -1, UChar_t transp = 0)
virtual voidUpdatePhysioLogical(TObject* logid, Double_t* trans, UChar_t* col)
virtual voidUpdatePhysioLogical(TObject* logid, Double_t* trans, Color_t cidx = -1, UChar_t transp = 0)
virtual voidUpdateSceneInfo(TGLRnrCtx& ctx)
protected:
static Bool_tComparePhysicalVolumes(const TGLPhysicalShape* shape1, const TGLPhysicalShape* shape2)
virtual voidDestroyPhysicalInternal(TGLScene::PhysicalShapeMapIt_t pit)
voidReleaseGLCtxIdentity()
voidSortDrawList()
private:
TGLScene(const TGLScene&)
TGLScene&operator=(const TGLScene&)

Data Members

public:
enum TGLLockable::ELock { kUnlocked
kDrawLock
kSelectLock
kModifyLock
};
protected:
TGLBoundingBoxTGLSceneBase::fBoundingBoxbounding box for scene (axis aligned) - lazy update - use BoundingBox() to access
Bool_tTGLSceneBase::fBoundingBoxValidbounding box valid?
TGLClip*TGLSceneBase::fClipScene clipping-plane.
Bool_tTGLSceneBase::fDoClipCheckPerform global clip-plane-check in UpdateSceneInfo()
Bool_tTGLSceneBase::fDoFrustumCheckPerform global frustum-check in UpdateSceneInfo()
vector<const TGLPhysicalShape*,allocator<const TGLPhysicalShape*> >fDrawList!
Bool_tfDrawListValid!
TGLContextIdentity*fGLCtxIdentity
Bool_tfInSmartRefresh!
Short_tTGLSceneBase::fLODScene-lod.
TGLLockable::ELockTGLLockable::fLockLock state.
map<TObject*,TGLLogicalShape*,less<TObject*>,allocator<pair<TObject* const,TGLLogicalShape*> > >fLogicalShapes!
TStringTGLSceneBase::fNameObject identifier.
map<unsigned int,TGLPhysicalShape*,less<unsigned int>,allocator<pair<const unsigned int,TGLPhysicalShape*> > >fPhysicalShapes!
UInt_tTGLSceneBase::fSceneIDUnique scene id.
map<TObject*,TGLLogicalShape*,less<TObject*>,allocator<pair<TObject* const,TGLLogicalShape*> > >fSmartRefreshCache!
Short_tTGLSceneBase::fStyleScene-style.
UInt_tTGLSceneBase::fTimeStampCounter increased on every update.
TStringTGLSceneBase::fTitleObject title.
list<TGLViewerBase*>TGLSceneBase::fViewers

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TGLScene(const TGLScene& )
{}
~TGLScene()
 Destroy scene objects
void ReleaseGLCtxIdentity()
 Release all GL resources for current context identity.
 Requires iteration over all logical shapes.
void UpdateSceneInfo(TGLRnrCtx& ctx)
 Fill scene-info with information needed for rendering, take into
 account the render-context (viewer state, camera, clipping).
 Here we have to iterate over all the physical shapes and select
 the visible ones. While at it, opaque and transparent shapes are
 divided into two groups.
void LodifySceneInfo(TGLRnrCtx& ctx)
 Setup LOD-dependant values in scene-info.
 We have to perform LOD quantization for all draw-elements.
void PreRender(TGLRnrCtx& rnrCtx)
 Initialize rendering.
 Pass to base-class where most work is done.
 Check if GL-ctx is shared with the previous one; if not
 wipe display-lists of all logicals.
void Render(TGLRnrCtx& rnrCtx)
 Render scene.
void PostRender(TGLRnrCtx& rnrCtx)
 Called after the rendering is finished.
 In debug mode draw statistcs is dumped.
 Parent's PostRender is called for GL cleanup.
Double_t RenderAllPasses(TGLRnrCtx& rnrCtx, Double_t timeout)
 Do full rendering of scene.

 First draw the opaques, then the transparents. For each we do
 the number of passes required by draw mode and clipping setup.
Double_t RenderOnePass(TGLRnrCtx& rnrCtx, Double_t timeout, const TGLPlaneSet_t* clipPlanes = 0)
 Render all opaque and transparent elements in the scene.
Double_t RenderElements(TGLRnrCtx& rnrCtx, TGLScene::DrawElementVec_t& elementVec, Double_t timeout, const TGLPlaneSet_t* clipPlanes = 0)
 Render DrawElements in elementVec with given timeout.
 If clipPlanes is non-zero, test each element against its
 clipping planes.
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.
void CalcBoundingBox()
 Encapsulates all physical shapes bounding box with axes aligned box.
 Validity checked in the base-class.
void AdoptLogical(TGLLogicalShape& shape)
 Adopt dynamically created logical 'shape' - add to internal map
 and take responsibility for deleting.
Bool_t DestroyLogical(TObject* logid)
 Destroy logical shape defined by unique 'ID'.
 Returns kTRUE if found/destroyed - kFALSE otherwise.
Int_t DestroyLogicals()
 Destroy all logical shapes in scene.
 Return number of destroyed logicals.
TGLLogicalShape * FindLogical(TObject* logid) const
 Find and return logical shape identified by unqiue logid.
 Returns 0 if not found.
void AdoptPhysical(TGLPhysicalShape& shape)
 Adopt dynamically created physical 'shape' - add to internal map and take
 responsibility for deleting
void DestroyPhysicalInternal(TGLScene::PhysicalShapeMapIt_t pit)
 Virtual function to destroy a physical. Sub-classes might have
 special checks to perform.
 Caller should also invalidate the draw-list.
Bool_t DestroyPhysical(UInt_t phid)
 Destroy physical shape defined by unique 'ID'.
 Returns kTRUE if found/destroyed - kFALSE otherwise.
Int_t DestroyPhysicals(Bool_t incModified, const TGLCamera* camera = 0)
 Destroy physical shapes that are no longer of interest to camera.
 If 'incModified' is true also the modified ones are deleted.
 Return count of number destroyed.
TGLPhysicalShape * FindPhysical(UInt_t phid) const
 Find and return physical shape identified by unqiue 'ID'.
 Returns 0 if not found.
UInt_t GetMaxPhysicalID()
 Returns the maximum used physical id.
 Returns 0 if empty.
void BeginUpdate()
 Put scene in update mode.
void EndUpdate()
 Exit scene update mode, eventually notify scene consumers.
void UpdateLogical(TObject* logid)
 Drop display-lists for the logical (assume TGLObject/direct rendering).
 Re-calculate the bounding box (also for all physicals).
void UpdatePhysical(UInt_t phid, Double_t* trans, UChar_t* col)
 Reposition/recolor physical shape.
void UpdatePhysical(UInt_t phid, Double_t* trans, Color_t cidx = -1, UChar_t transp = 0)
 Reposition/recolor physical shape.
void UpdatePhysioLogical(TObject* logid, Double_t* trans, UChar_t* col)
 Reposition/recolor physical for given logical (assume TGLObject and
 a single physical).
void UpdatePhysioLogical(TObject* logid, Double_t* trans, Color_t cidx = -1, UChar_t transp = 0)
 Reposition/recolor physical for given logical (assume TGLObject and
 a single physical).
void BeginSmartRefresh()
 Moves logicals to refresh-cache.
void EndSmartRefresh()
 Wipes logicals in refresh-cache.
TGLLogicalShape * FindLogicalSmartRefresh(TObject* ID) const
 Find and return logical shape identified by unqiue 'ID' in refresh-cache.
 Returns 0 if not found.
void SortDrawList()
 Sort the TGLPhysical draw list by shape bounding box volume, from
 large to small. This makes dropout of shapes with time limited
 Draw() calls must less noticable. As this does not use projected
 size it only needs to be done after a scene content change - not
 everytime scene drawn (potential camera/projection change).
Bool_t ComparePhysicalVolumes(const TGLPhysicalShape* shape1, const TGLPhysicalShape* shape2)
 Compare 'shape1' and 'shape2' bounding box volumes - return kTRUE if
 'shape1' bigger than 'shape2'.
UInt_t SizeOfScene()
 Return memory cost of scene.
 Warning: NOT CORRECT at present - doesn't correctly calculate size.
 of logical shapes with dynamic internal contents.
void DumpMapSizes()
 Print sizes of logical nad physical-shape maps.
void RGBAFromColorIdx(Float_t* rgba, Color_t ci, Char_t transp = 0)
 Fill rgba color from ROOT color-index ci and transparency (0->100).
Bool_t IsOutside(const TGLBoundingBox& box, const TGLPlaneSet_t& planes)
 Check if box is outside of all planes.
TGLScene(const TGLScene& )
TGLScene& operator=(const TGLScene& )
TSceneInfo* CreateSceneInfo(TGLViewerBase* view)
TGLContextIdentity * GetGLCtxIdentity()
{ return fGLCtxIdentity; }

Author: Matevz Tadel, Feb 2007
Last update: root/gl:$Name: $:$Id: TGLScene.cxx,v 1.53 2007/06/23 21:23:22 brun Exp $
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.