Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TGLSceneBase Class Referenceabstract

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

Definition at line 32 of file TGLSceneBase.h.

Public Types

enum  ELock { kUnlocked , kDrawLock , kSelectLock , kModifyLock }

Public Member Functions

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

Static Public Member Functions

static TClassClass ()
static const char * Class_Name ()
static constexpr Version_t Class_Version ()
static const char * DeclFileName ()
static const char * LockName (ELock lock)
 Return name-string for given lock-type.
static Bool_t LockValid (ELock lock)
 Test if lock is a valid type to take/release.

Protected Types

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

Protected Attributes

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

Private Member Functions

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

Static Private Attributes

static UInt_t fgSceneIDSrc = 1

#include <TGLSceneBase.h>

Inheritance diagram for TGLSceneBase:
TGLLockable TGLScene TGLScenePad

Member Typedef Documentation

◆ ViewerList_i

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

Definition at line 63 of file TGLSceneBase.h.

◆ ViewerList_t

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

Definition at line 62 of file TGLSceneBase.h.

Member Enumeration Documentation

◆ ELock

enum TGLLockable::ELock
inherited
Enumerator
kUnlocked 
kDrawLock 
kSelectLock 
kModifyLock 

Definition at line 20 of file TGLLockable.h.

Constructor & Destructor Documentation

◆ TGLSceneBase() [1/2]

TGLSceneBase::TGLSceneBase ( const TGLSceneBase & )
privatedelete

◆ TGLSceneBase() [2/2]

TGLSceneBase::TGLSceneBase ( )

Definition at line 48 of file TGLSceneBase.cxx.

◆ ~TGLSceneBase()

TGLSceneBase::~TGLSceneBase ( )
override

Destructor.

Definition at line 74 of file TGLSceneBase.cxx.

Member Function Documentation

◆ AddViewer()

void TGLSceneBase::AddViewer ( TGLViewerBase * viewer)

Add viewer to the list.

Definition at line 85 of file TGLSceneBase.cxx.

◆ BoundingBox()

const TGLBoundingBox & TGLSceneBase::BoundingBox ( ) const
inline

Definition at line 138 of file TGLSceneBase.h.

◆ CalcBoundingBox()

virtual void TGLSceneBase::CalcBoundingBox ( ) const
pure virtual

Implemented in TGLScene.

◆ Class()

TClass * TGLSceneBase::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

const char * TGLSceneBase::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

constexpr Version_t TGLSceneBase::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 142 of file TGLSceneBase.h.

◆ Clip()

TGLClip * TGLSceneBase::Clip ( ) const
inline

Definition at line 125 of file TGLSceneBase.h.

◆ CreateSceneInfo()

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 143 of file TGLSceneBase.cxx.

◆ CurrentLock()

ELock TGLLockable::CurrentLock ( ) const
inlineinherited

Definition at line 61 of file TGLLockable.h.

◆ DeclFileName()

const char * TGLSceneBase::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 142 of file TGLSceneBase.h.

◆ FindLogical()

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

Reimplemented in TGLScene.

Definition at line 105 of file TGLSceneBase.h.

◆ GetAutoDestruct()

Bool_t TGLSceneBase::GetAutoDestruct ( ) const
inline

Definition at line 131 of file TGLSceneBase.h.

◆ GetMinorStamp()

UInt_t TGLSceneBase::GetMinorStamp ( ) const
inline

Definition at line 116 of file TGLSceneBase.h.

◆ GetName()

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

Definition at line 81 of file TGLSceneBase.h.

◆ GetSelectable()

Bool_t TGLSceneBase::GetSelectable ( ) const
inline

Definition at line 128 of file TGLSceneBase.h.

◆ GetTimeStamp()

UInt_t TGLSceneBase::GetTimeStamp ( ) const
inline

Definition at line 113 of file TGLSceneBase.h.

◆ GetTitle()

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

Definition at line 82 of file TGLSceneBase.h.

◆ IncMinorStamp()

void TGLSceneBase::IncMinorStamp ( )
inline

Definition at line 117 of file TGLSceneBase.h.

◆ IncTimeStamp()

void TGLSceneBase::IncTimeStamp ( )
inline

Definition at line 114 of file TGLSceneBase.h.

◆ InvalidateBoundingBox()

void TGLSceneBase::InvalidateBoundingBox ( )
inline

Definition at line 137 of file TGLSceneBase.h.

◆ IsA()

TClass * TGLSceneBase::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TGLLockable.

Reimplemented in TGLScenePad.

Definition at line 142 of file TGLSceneBase.h.

◆ IsDrawOrSelectLock()

Bool_t TGLLockable::IsDrawOrSelectLock ( ) const
inlineinherited

Definition at line 63 of file TGLLockable.h.

◆ IsLocked()

Bool_t TGLLockable::IsLocked ( ) const
inlineinherited

Definition at line 60 of file TGLLockable.h.

◆ LockIdStr()

const char * TGLSceneBase::LockIdStr ( ) const
overridevirtual

Name printed on locking info messages.

Reimplemented from TGLLockable.

Definition at line 130 of file TGLSceneBase.cxx.

◆ LockName()

const char * TGLLockable::LockName ( ELock lock)
staticinherited

Return name-string for given lock-type.

Definition at line 68 of file TGLLockable.cxx.

◆ LockValid()

Bool_t TGLLockable::LockValid ( ELock lock)
staticinherited

Test if lock is a valid type to take/release.

kUnlocked is never valid in these cases.

Definition at line 84 of file TGLLockable.cxx.

◆ LOD()

Short_t TGLSceneBase::LOD ( ) const
inline

Definition at line 119 of file TGLSceneBase.h.

◆ LodifySceneInfo()

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 285 of file TGLSceneBase.cxx.

◆ operator=()

TGLSceneBase & TGLSceneBase::operator= ( const TGLSceneBase & )
privatedelete

◆ PostDraw()

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 495 of file TGLSceneBase.cxx.

◆ PostRender()

void TGLSceneBase::PostRender ( TGLRnrCtx & rnrCtx)
virtual

Perform post-render clean-up.

Definition at line 482 of file TGLSceneBase.cxx.

◆ PreDraw()

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 310 of file TGLSceneBase.cxx.

◆ 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 401 of file TGLSceneBase.cxx.

◆ RebuildSceneInfo()

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 153 of file TGLSceneBase.cxx.

◆ ReleaseLock()

Bool_t TGLLockable::ReleaseLock ( ELock lock) const
inherited

Release current lock, make sure it the same as the 'lock' argument.

Returns TRUE on success, FALSE on failure.

Definition at line 50 of file TGLLockable.cxx.

◆ RemoveViewer()

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 99 of file TGLSceneBase.cxx.

◆ Render()

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 429 of file TGLSceneBase.cxx.

◆ RenderOpaque()

void TGLSceneBase::RenderOpaque ( TGLRnrCtx & rnrCtx)
virtual

Render opaque elements.

Reimplemented in TGLScene.

Definition at line 440 of file TGLSceneBase.cxx.

◆ RenderSelOpaque()

void TGLSceneBase::RenderSelOpaque ( TGLRnrCtx & rnrCtx)
virtual

Render selected opaque elements.

Reimplemented in TGLScene.

Definition at line 454 of file TGLSceneBase.cxx.

◆ RenderSelOpaqueForHighlight()

void TGLSceneBase::RenderSelOpaqueForHighlight ( TGLRnrCtx & rnrCtx)
virtual

Render selected opaque elements for highlight.

Reimplemented in TGLScene.

Definition at line 468 of file TGLSceneBase.cxx.

◆ RenderSelTransp()

void TGLSceneBase::RenderSelTransp ( TGLRnrCtx & rnrCtx)
virtual

Render selected transparent elements for highlight.

Reimplemented in TGLScene.

Definition at line 461 of file TGLSceneBase.cxx.

◆ RenderSelTranspForHighlight()

void TGLSceneBase::RenderSelTranspForHighlight ( TGLRnrCtx & rnrCtx)
virtual

Render selected transparent elements.

Reimplemented in TGLScene.

Definition at line 475 of file TGLSceneBase.cxx.

◆ RenderTransp()

void TGLSceneBase::RenderTransp ( TGLRnrCtx & rnrCtx)
virtual

Render transparent elements.

Reimplemented in TGLScene.

Definition at line 447 of file TGLSceneBase.cxx.

◆ ResolveSelectRecord()

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 512 of file TGLSceneBase.cxx.

◆ SetAutoDestruct()

void TGLSceneBase::SetAutoDestruct ( Bool_t a)
inline

Definition at line 132 of file TGLSceneBase.h.

◆ SetClip()

void TGLSceneBase::SetClip ( TGLClip * p)
inline

Definition at line 126 of file TGLSceneBase.h.

◆ SetLOD()

void TGLSceneBase::SetLOD ( Short_t lod)
inline

Definition at line 120 of file TGLSceneBase.h.

◆ SetName()

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

Definition at line 83 of file TGLSceneBase.h.

◆ SetNameTitle()

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

Definition at line 85 of file TGLSceneBase.h.

◆ SetSelectable()

void TGLSceneBase::SetSelectable ( Bool_t a)
inline

Definition at line 129 of file TGLSceneBase.h.

◆ SetStyle()

void TGLSceneBase::SetStyle ( Short_t st)
inline

Definition at line 123 of file TGLSceneBase.h.

◆ SetTitle()

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

Definition at line 84 of file TGLSceneBase.h.

◆ Streamer()

void TGLSceneBase::Streamer ( TBuffer & )
overridevirtual

Reimplemented from TGLLockable.

Reimplemented in TGLScenePad.

◆ StreamerNVirtual()

void TGLSceneBase::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 142 of file TGLSceneBase.h.

◆ Style()

Short_t TGLSceneBase::Style ( ) const
inline

Definition at line 122 of file TGLSceneBase.h.

◆ TagViewersChanged()

void TGLSceneBase::TagViewersChanged ( )

Tag all viewers as changed.

Definition at line 117 of file TGLSceneBase.cxx.

◆ TakeLock()

Bool_t TGLLockable::TakeLock ( ELock lock) const
inherited

Lock the object in mode 'lock'.

Return TRUE if successful, FALSE if the object is already locked.

Definition at line 31 of file TGLLockable.cxx.

◆ UpdateSceneInfo()

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 171 of file TGLSceneBase.cxx.

Member Data Documentation

◆ fAutoDestruct

Bool_t TGLSceneBase::fAutoDestruct
protected

Definition at line 66 of file TGLSceneBase.h.

◆ fBoundingBox

TGLBoundingBox TGLSceneBase::fBoundingBox
mutableprotected

Definition at line 55 of file TGLSceneBase.h.

◆ fBoundingBoxValid

Bool_t TGLSceneBase::fBoundingBoxValid
mutableprotected

Definition at line 56 of file TGLSceneBase.h.

◆ fClip

TGLClip* TGLSceneBase::fClip
protected

Definition at line 51 of file TGLSceneBase.h.

◆ fDoClipCheck

Bool_t TGLSceneBase::fDoClipCheck
protected

Definition at line 59 of file TGLSceneBase.h.

◆ fDoFrustumCheck

Bool_t TGLSceneBase::fDoFrustumCheck
protected

Definition at line 58 of file TGLSceneBase.h.

◆ fgSceneIDSrc

UInt_t TGLSceneBase::fgSceneIDSrc = 1
staticprivate

Definition at line 38 of file TGLSceneBase.h.

◆ fLock

ELock TGLLockable::fLock
mutableprotectedinherited

Definition at line 32 of file TGLLockable.h.

◆ fLOD

Short_t TGLSceneBase::fLOD
protected

Definition at line 47 of file TGLSceneBase.h.

◆ fMinorStamp

UInt_t TGLSceneBase::fMinorStamp
protected

Definition at line 46 of file TGLSceneBase.h.

◆ fName

TString TGLSceneBase::fName
protected

Definition at line 42 of file TGLSceneBase.h.

◆ fOLLineW

Float_t TGLSceneBase::fOLLineW
protected

Definition at line 50 of file TGLSceneBase.h.

◆ fSceneID

UInt_t TGLSceneBase::fSceneID
protected

Definition at line 41 of file TGLSceneBase.h.

◆ fSelectable

Bool_t TGLSceneBase::fSelectable
protected

Definition at line 52 of file TGLSceneBase.h.

◆ fStyle

Short_t TGLSceneBase::fStyle
protected

Definition at line 48 of file TGLSceneBase.h.

◆ fTimeStamp

UInt_t TGLSceneBase::fTimeStamp
protected

Definition at line 45 of file TGLSceneBase.h.

◆ fTitle

TString TGLSceneBase::fTitle
protected

Definition at line 43 of file TGLSceneBase.h.

◆ fViewers

ViewerList_t TGLSceneBase::fViewers
protected

Definition at line 65 of file TGLSceneBase.h.

◆ fWFLineW

Float_t TGLSceneBase::fWFLineW
protected

Definition at line 49 of file TGLSceneBase.h.


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