ROOT  6.06/09
Reference Guide
Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
TGLSceneBase Class Referenceabstract

Scene base-class – provides basic interface expected by the TGLViewer or its sub-classes:

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).

Definition at line 32 of file TGLSceneBase.h.

Public Member Functions

 TGLSceneBase ()
 
virtual ~TGLSceneBase ()
 Destructor. More...
 
void AddViewer (TGLViewerBase *viewer)
 Add viewer to the list. More...
 
void RemoveViewer (TGLViewerBase *viewer)
 Remove viewer from the list. More...
 
void TagViewersChanged ()
 Tag all viewers as changed. More...
 
virtual const char * LockIdStr () const
 Name printed on locking info messages. More...
 
virtual const char * GetName () const
 
virtual const char * GetTitle () const
 
virtual void SetName (const char *name)
 
virtual void SetTitle (const char *title)
 
virtual void SetNameTitle (const char *name, const char *title)
 
virtual TGLSceneInfoCreateSceneInfo (TGLViewerBase *view)
 Create a scene-info instance appropriate for this scene class. More...
 
virtual void RebuildSceneInfo (TGLRnrCtx &ctx)
 Fill scene-info with very basic information that is practically view independent. More...
 
virtual void UpdateSceneInfo (TGLRnrCtx &ctx)
 Fill scene-info with information needed for rendering, take into account the render-context (viewer state, camera, clipping). More...
 
virtual void LodifySceneInfo (TGLRnrCtx &ctx)
 Setup LOD-dependant values in scene-info. More...
 
virtual void PreDraw (TGLRnrCtx &rnrCtx)
 Perform basic pre-render initialization: More...
 
virtual void PreRender (TGLRnrCtx &rnrCtx)
 Perform pre-render initialization - fill rnrCtx with values stored during PreDraw(). More...
 
virtual 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. More...
 
virtual void RenderOpaque (TGLRnrCtx &rnrCtx)
 Render opaque elements. More...
 
virtual void RenderTransp (TGLRnrCtx &rnrCtx)
 Render transparent elements. More...
 
virtual void RenderSelOpaque (TGLRnrCtx &rnrCtx)
 Render selected opaque elements. More...
 
virtual void RenderSelTransp (TGLRnrCtx &rnrCtx)
 Render selected transparent elements for highlight. More...
 
virtual void RenderSelOpaqueForHighlight (TGLRnrCtx &rnrCtx)
 Render selected opaque elements for highlight. More...
 
virtual void RenderSelTranspForHighlight (TGLRnrCtx &rnrCtx)
 Render selected transparent elements. More...
 
virtual void PostRender (TGLRnrCtx &rnrCtx)
 Perform post-render clean-up. More...
 
virtual void PostDraw (TGLRnrCtx &rnrCtx)
 Finalize drawing. More...
 
virtual TGLLogicalShapeFindLogical (TObject *) const
 
virtual Bool_t ResolveSelectRecord (TGLSelectRecord &rec, Int_t curIdx)
 Process selection record rec. More...
 
UInt_t GetTimeStamp () const
 
void IncTimeStamp ()
 
UInt_t GetMinorStamp () const
 
void IncMinorStamp ()
 
Short_t LOD () const
 
void SetLOD (Short_t lod)
 
Short_t Style () const
 
void SetStyle (Short_t st)
 
TGLClipClip () const
 
void SetClip (TGLClip *p)
 
Bool_t GetSelectable () const
 
void SetSelectable (Bool_t a)
 
Bool_t GetAutoDestruct () const
 
void SetAutoDestruct (Bool_t a)
 
virtual void CalcBoundingBox () const =0
 
void InvalidateBoundingBox ()
 
const TGLBoundingBoxBoundingBox () const
 
- Public Member Functions inherited from TGLLockable
 TGLLockable ()
 
virtual ~TGLLockable ()
 
Bool_t TakeLock (ELock lock) const
 Lock the object in mode 'lock'. More...
 
Bool_t ReleaseLock (ELock lock) const
 Release current lock, make sure it the same as the 'lock' argument. More...
 
Bool_t IsLocked () const
 
ELock CurrentLock () const
 
Bool_t IsDrawOrSelectLock () const
 
 ClassDef (TGLLockable, 0)
 

Protected Types

typedef std::list< TGLViewerBase * > ViewerList_t
 
typedef std::list< TGLViewerBase * >::iterator ViewerList_i
 

Protected Attributes

UInt_t fSceneID
 
TString fName
 
TString fTitle
 
UInt_t fTimeStamp
 
UInt_t fMinorStamp
 
Short_t fLOD
 
Short_t fStyle
 
Float_t fWFLineW
 
Float_t fOLLineW
 
TGLClipfClip
 
Bool_t fSelectable
 
TGLBoundingBox fBoundingBox
 
Bool_t fBoundingBoxValid
 
Bool_t fDoFrustumCheck
 
Bool_t fDoClipCheck
 
ViewerList_t fViewers
 
Bool_t fAutoDestruct
 
- Protected Attributes inherited from TGLLockable
ELock fLock
 

Private Member Functions

 TGLSceneBase (const TGLSceneBase &)
 
TGLSceneBaseoperator= (const TGLSceneBase &)
 

Static Private Attributes

static UInt_t fgSceneIDSrc = 1
 

Additional Inherited Members

- Public Types inherited from TGLLockable
enum  ELock { kUnlocked, kDrawLock, kSelectLock, kModifyLock }
 
- Static Public Member Functions inherited from TGLLockable
static const char * LockName (ELock lock)
 Return name-string for given lock-type. More...
 
static Bool_t LockValid (ELock lock)
 Test if lock is a valid type to take/release. More...
 

#include <TGLSceneBase.h>

+ Inheritance diagram for TGLSceneBase:
+ Collaboration diagram for TGLSceneBase:

Member Typedef Documentation

typedef std::list<TGLViewerBase*>::iterator TGLSceneBase::ViewerList_i
protected

Definition at line 63 of file TGLSceneBase.h.

typedef std::list<TGLViewerBase*> TGLSceneBase::ViewerList_t
protected

Definition at line 62 of file TGLSceneBase.h.

Constructor & Destructor Documentation

TGLSceneBase::TGLSceneBase ( const TGLSceneBase )
private
TGLSceneBase::TGLSceneBase ( )

Definition at line 49 of file TGLSceneBase.cxx.

TGLSceneBase::~TGLSceneBase ( )
virtual

Destructor.

Definition at line 75 of file TGLSceneBase.cxx.

Member Function Documentation

void TGLSceneBase::AddViewer ( TGLViewerBase viewer)

Add viewer to the list.

Definition at line 86 of file TGLSceneBase.cxx.

Referenced by TGLViewerBase::AddScene().

const TGLBoundingBox& TGLSceneBase::BoundingBox ( ) const
inline

Definition at line 138 of file TGLSceneBase.h.

Referenced by TGLSceneInfo::SetupTransformsAndBBox(), and UpdateSceneInfo().

virtual void TGLSceneBase::CalcBoundingBox ( ) const
pure virtual

Implemented in TGLScene.

Referenced by BoundingBox().

TGLClip* TGLSceneBase::Clip ( ) const
inline

Definition at line 125 of file TGLSceneBase.h.

TGLSceneInfo * TGLSceneBase::CreateSceneInfo ( TGLViewerBase view)
virtual

Create a scene-info instance appropriate for this scene class.

Here we instantiate the scene-info base-class TGLSceneInfo.

Reimplemented in TGLScene.

Definition at line 144 of file TGLSceneBase.cxx.

Referenced by TGLViewerBase::AddScene().

virtual TGLLogicalShape* TGLSceneBase::FindLogical ( TObject ) const
inlinevirtual

Reimplemented in TGLScene.

Definition at line 105 of file TGLSceneBase.h.

Bool_t TGLSceneBase::GetAutoDestruct ( ) const
inline

Definition at line 131 of file TGLSceneBase.h.

UInt_t TGLSceneBase::GetMinorStamp ( ) const
inline

Definition at line 116 of file TGLSceneBase.h.

Referenced by TGLScene::TSceneInfo::PreDraw().

virtual const char* TGLSceneBase::GetName ( ) const
inlinevirtual
Bool_t TGLSceneBase::GetSelectable ( ) const
inline

Definition at line 128 of file TGLSceneBase.h.

Referenced by TGLViewerBase::PreRender().

UInt_t TGLSceneBase::GetTimeStamp ( ) const
inline

Definition at line 113 of file TGLSceneBase.h.

virtual const char* TGLSceneBase::GetTitle ( ) const
inlinevirtual

Definition at line 82 of file TGLSceneBase.h.

void TGLSceneBase::IncMinorStamp ( )
inline

Definition at line 117 of file TGLSceneBase.h.

Referenced by TGLScene::EndUpdate().

void TGLSceneBase::IncTimeStamp ( )
inline
void TGLSceneBase::InvalidateBoundingBox ( )
inline
const char * TGLSceneBase::LockIdStr ( ) const
virtual

Name printed on locking info messages.

Reimplemented from TGLLockable.

Definition at line 131 of file TGLSceneBase.cxx.

Short_t TGLSceneBase::LOD ( ) const
inline

Definition at line 119 of file TGLSceneBase.h.

void TGLSceneBase::LodifySceneInfo ( TGLRnrCtx ctx)
virtual

Setup LOD-dependant values in scene-info.

Nothing to be done here but to store the last LOD.

Reimplemented in TGLScene.

Definition at line 286 of file TGLSceneBase.cxx.

Referenced by TGLScene::LodifySceneInfo(), and PreDraw().

TGLSceneBase& TGLSceneBase::operator= ( const TGLSceneBase )
private
void TGLSceneBase::PostDraw ( TGLRnrCtx rnrCtx)
virtual

Finalize drawing.

This is called at the end of the GL-viewer draw cycle.

Reimplemented in TGLScene.

Definition at line 496 of file TGLSceneBase.cxx.

Referenced by TGLScene::PostDraw(), TGLViewerBase::PostRender(), and TGLViewerBase::PreRender().

void TGLSceneBase::PostRender ( TGLRnrCtx rnrCtx)
virtual

Perform post-render clean-up.

Definition at line 483 of file TGLSceneBase.cxx.

Referenced by TGLViewer::DoSecondarySelect(), and TGLViewerBase::SubRenderScenes().

void TGLSceneBase::PreDraw ( TGLRnrCtx rnrCtx)
virtual

Perform basic pre-render initialization:

  • calculate LOD, Style, Clipping,
  • build draw lists.

This is called in the beginning of the GL-viewer draw cycle.

Reimplemented in TGLScene.

Definition at line 311 of file TGLSceneBase.cxx.

Referenced by TGLScene::PreDraw(), and TGLViewerBase::PreRender().

void TGLSceneBase::PreRender ( TGLRnrCtx rnrCtx)
virtual

Perform pre-render initialization - fill rnrCtx with values stored during PreDraw().

This is called each time before RenderXyzz().

Definition at line 402 of file TGLSceneBase.cxx.

Referenced by TGLViewer::DoSecondarySelect(), and TGLViewerBase::SubRenderScenes().

void TGLSceneBase::RebuildSceneInfo ( TGLRnrCtx ctx)
virtual

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.

Reimplemented in TGLScene.

Definition at line 154 of file TGLSceneBase.cxx.

Referenced by PreDraw(), and TGLScene::RebuildSceneInfo().

void TGLSceneBase::RemoveViewer ( TGLViewerBase viewer)

Remove viewer from the list.

If auto-destruct is on and the last viewer is removed the scene destructs itself.

Definition at line 100 of file TGLSceneBase.cxx.

Referenced by TGLViewerBase::RemoveAllScenes(), and TGLViewerBase::RemoveScene().

void TGLSceneBase::Render ( TGLRnrCtx rnrCtx)
virtual

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.

Definition at line 430 of file TGLSceneBase.cxx.

void TGLSceneBase::RenderOpaque ( TGLRnrCtx rnrCtx)
virtual

Render opaque elements.

Reimplemented in TGLScene.

Definition at line 441 of file TGLSceneBase.cxx.

Referenced by Render(), TGLViewerBase::RenderNonSelected(), and TGLViewerBase::RenderOpaque().

void TGLSceneBase::RenderSelOpaque ( TGLRnrCtx rnrCtx)
virtual

Render selected opaque elements.

Reimplemented in TGLScene.

Definition at line 455 of file TGLSceneBase.cxx.

Referenced by Render(), TGLViewerBase::RenderOpaque(), and TGLViewerBase::RenderSelected().

void TGLSceneBase::RenderSelOpaqueForHighlight ( TGLRnrCtx rnrCtx)
virtual

Render selected opaque elements for highlight.

Reimplemented in TGLScene.

Definition at line 469 of file TGLSceneBase.cxx.

Referenced by TGLViewerBase::RenderSelectedForHighlight().

void TGLSceneBase::RenderSelTransp ( TGLRnrCtx rnrCtx)
virtual

Render selected transparent elements for highlight.

Reimplemented in TGLScene.

Definition at line 462 of file TGLSceneBase.cxx.

Referenced by Render(), TGLViewerBase::RenderSelected(), and TGLViewerBase::RenderTransparent().

void TGLSceneBase::RenderSelTranspForHighlight ( TGLRnrCtx rnrCtx)
virtual

Render selected transparent elements.

Reimplemented in TGLScene.

Definition at line 476 of file TGLSceneBase.cxx.

Referenced by TGLViewerBase::RenderSelectedForHighlight().

void TGLSceneBase::RenderTransp ( TGLRnrCtx rnrCtx)
virtual

Render transparent elements.

Reimplemented in TGLScene.

Definition at line 448 of file TGLSceneBase.cxx.

Referenced by Render(), TGLViewerBase::RenderNonSelected(), and TGLViewerBase::RenderTransparent().

Bool_t TGLSceneBase::ResolveSelectRecord ( TGLSelectRecord rec,
Int_t  curIdx 
)
virtual

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.

Reimplemented in TGLScene.

Definition at line 513 of file TGLSceneBase.cxx.

Referenced by TGLViewerBase::ResolveSelectRecord().

void TGLSceneBase::SetAutoDestruct ( Bool_t  a)
inline

Definition at line 132 of file TGLSceneBase.h.

Referenced by TEveScene::TEveScene().

void TGLSceneBase::SetClip ( TGLClip p)
inline

Definition at line 126 of file TGLSceneBase.h.

void TGLSceneBase::SetLOD ( Short_t  lod)
inline

Definition at line 120 of file TGLSceneBase.h.

virtual void TGLSceneBase::SetName ( const char *  name)
inlinevirtual

Definition at line 83 of file TGLSceneBase.h.

Referenced by TEveScene::SetName(), SetNameTitle(), and TEveScene::TEveScene().

virtual void TGLSceneBase::SetNameTitle ( const char *  name,
const char *  title 
)
inlinevirtual

Definition at line 85 of file TGLSceneBase.h.

void TGLSceneBase::SetSelectable ( Bool_t  a)
inline

Definition at line 129 of file TGLSceneBase.h.

void TGLSceneBase::SetStyle ( Short_t  st)
inline

Definition at line 123 of file TGLSceneBase.h.

virtual void TGLSceneBase::SetTitle ( const char *  title)
inlinevirtual

Definition at line 84 of file TGLSceneBase.h.

Referenced by SetNameTitle().

Short_t TGLSceneBase::Style ( ) const
inline

Definition at line 122 of file TGLSceneBase.h.

void TGLSceneBase::TagViewersChanged ( )

Tag all viewers as changed.

Definition at line 118 of file TGLSceneBase.cxx.

Referenced by TGLScene::EndUpdate().

void TGLSceneBase::UpdateSceneInfo ( TGLRnrCtx ctx)
virtual

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 transformation matrices) and potentially study and refine the clipping planes based on scene bounding box.

Reimplemented in TGLScene.

Definition at line 172 of file TGLSceneBase.cxx.

Referenced by PreDraw(), and TGLScene::UpdateSceneInfo().

Member Data Documentation

Bool_t TGLSceneBase::fAutoDestruct
protected

Definition at line 66 of file TGLSceneBase.h.

Referenced by GetAutoDestruct(), and RemoveViewer().

TGLBoundingBox TGLSceneBase::fBoundingBox
mutableprotected

Definition at line 55 of file TGLSceneBase.h.

Referenced by BoundingBox(), and TGLScene::CalcBoundingBox().

Bool_t TGLSceneBase::fBoundingBoxValid
mutableprotected

Definition at line 56 of file TGLSceneBase.h.

Referenced by TGLScene::CalcBoundingBox().

TGLClip* TGLSceneBase::fClip
protected

Definition at line 51 of file TGLSceneBase.h.

Referenced by Clip(), and PreDraw().

Bool_t TGLSceneBase::fDoClipCheck
protected

Definition at line 59 of file TGLSceneBase.h.

Referenced by UpdateSceneInfo().

Bool_t TGLSceneBase::fDoFrustumCheck
protected

Definition at line 58 of file TGLSceneBase.h.

Referenced by UpdateSceneInfo().

UInt_t TGLSceneBase::fgSceneIDSrc = 1
staticprivate

Definition at line 38 of file TGLSceneBase.h.

Referenced by TGLSceneBase().

Short_t TGLSceneBase::fLOD
protected

Definition at line 47 of file TGLSceneBase.h.

Referenced by LOD(), and PreDraw().

UInt_t TGLSceneBase::fMinorStamp
protected
TString TGLSceneBase::fName
protected

Definition at line 42 of file TGLSceneBase.h.

Referenced by GetName(), LockIdStr(), and TGLSceneBase().

Float_t TGLSceneBase::fOLLineW
protected

Definition at line 50 of file TGLSceneBase.h.

Referenced by PreDraw().

UInt_t TGLSceneBase::fSceneID
protected

Definition at line 41 of file TGLSceneBase.h.

Referenced by TGLSceneBase().

Bool_t TGLSceneBase::fSelectable
protected

Definition at line 52 of file TGLSceneBase.h.

Referenced by GetSelectable().

Short_t TGLSceneBase::fStyle
protected

Definition at line 48 of file TGLSceneBase.h.

Referenced by PreDraw(), and Style().

UInt_t TGLSceneBase::fTimeStamp
protected

Definition at line 45 of file TGLSceneBase.h.

Referenced by GetTimeStamp(), IncTimeStamp(), LodifySceneInfo(), PreDraw(), and UpdateSceneInfo().

TString TGLSceneBase::fTitle
protected

Definition at line 43 of file TGLSceneBase.h.

Referenced by GetTitle().

ViewerList_t TGLSceneBase::fViewers
protected

Definition at line 65 of file TGLSceneBase.h.

Referenced by AddViewer(), RemoveViewer(), TagViewersChanged(), and ~TGLSceneBase().

Float_t TGLSceneBase::fWFLineW
protected

Definition at line 49 of file TGLSceneBase.h.

Referenced by PreDraw().


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