Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TGLScene Class Reference

TGLScene provides management and rendering of ROOT's default 3D /object representation as logical and physical shapes.

A GL scene is the container for all the viewable objects (shapes) loaded into the viewer. It consists of two main stl::maps containing the TGLLogicalShape and TGLPhysicalShape collections, and interface functions enabling viewers to manage objects in these. The physical shapes defined the placement of copies of the logical shapes - see TGLLogicalShape/TGLPhysicalShape for more information on relationship

The scene can be drawn by owning viewer, passing camera, draw style & quality (LOD), clipping etc - see Draw(). The scene can also be drawn for selection in similar fashion - see Select(). The scene keeps track of a single selected physical - which can be modified by viewers.

The scene maintains a lazy calculated bounding box for the total scene extents, axis aligned round TGLPhysicalShape shapes.

Currently a scene is owned exclusively by one viewer - however it is intended that it could easily be shared by multiple viewers - for efficiency and synchronisation reasons. Hence viewer variant objects camera, clips etc being owned by viewer and passed at draw/select

Definition at line 28 of file TGLScene.h.

Classes

struct  DrawElement_t
class  TSceneInfo

Public Types

typedef std::vector< DrawElement_t * >::iterator DrawElementPtrVec_i
typedef std::vector< DrawElement_t * > DrawElementPtrVec_t
typedef std::vector< DrawElement_t >::iterator DrawElementVec_i
typedef std::vector< DrawElement_tDrawElementVec_t
enum  ELock { kUnlocked , kDrawLock , kSelectLock , kModifyLock }
typedef std::map< TObject *, TGLLogicalShape * > LogicalShapeMap_t
typedef LogicalShapeMap_t::const_iterator LogicalShapeMapCIt_t
typedef LogicalShapeMap_t::iterator LogicalShapeMapIt_t
typedef LogicalShapeMap_t::value_type LogicalShapeMapValueType_t
typedef std::map< UInt_t, TGLPhysicalShape * > PhysicalShapeMap_t
typedef PhysicalShapeMap_t::const_iterator PhysicalShapeMapCIt_t
typedef PhysicalShapeMap_t::iterator PhysicalShapeMapIt_t
typedef PhysicalShapeMap_t::value_type PhysicalShapeMapValueType_t
typedef ShapeVec_t::iterator ShapeVec_i
typedef std::vector< const TGLPhysicalShape * > ShapeVec_t

Public Member Functions

 TGLScene ()
 ~TGLScene () override
 Destroy scene objects.
void AddViewer (TGLViewerBase *viewer)
 Add viewer to the list.
virtual void AdoptLogical (TGLLogicalShape &shape)
 Adopt dynamically created logical 'shape' - add to internal map and take responsibility for deleting.
virtual void AdoptPhysical (TGLPhysicalShape &shape)
 Adopt dynamically created physical 'shape' - add to internal map and take responsibility for deleting.
UInt_t BeginSmartRefresh ()
 Moves logicals that support smart-refresh to intermediate cache.
virtual Bool_t BeginUpdate ()
 Put scene in update mode, return true if lock acquired.
const TGLBoundingBoxBoundingBox () const
void CalcBoundingBox () const override
 Encapsulates all physical shapes bounding box with axes aligned box.
TGLClipClip () const
TSceneInfoCreateSceneInfo (TGLViewerBase *view) override
 Create a scene-info instance appropriate for this scene class.
ELock CurrentLock () const
virtual Bool_t DestroyLogical (TObject *logid, Bool_t mustFind=kTRUE)
 Destroy logical shape defined by unique 'ID'.
virtual Int_t DestroyLogicals ()
 Destroy all logical shapes in scene.
virtual Bool_t DestroyPhysical (UInt_t phid)
 Destroy physical shape defined by unique 'ID'.
virtual Int_t DestroyPhysicals ()
 Destroy physical shapes.
void DumpMapSizes () const
 Print sizes of logical and physical-shape maps.
void EndSmartRefresh ()
 Wipes logicals in refresh-cache.
virtual void EndUpdate (Bool_t minorChange=kTRUE, Bool_t sceneChanged=kTRUE, Bool_t updateViewers=kTRUE)
 Exit scene update mode.
TGLLogicalShapeFindLogical (TObject *logid) const override
 Find and return logical shape identified by unique logid.
TGLLogicalShapeFindLogicalSmartRefresh (TObject *ID) const
 Find and return logical shape identified by unique 'ID' in refresh-cache.
virtual TGLPhysicalShapeFindPhysical (UInt_t phid) const
 Find and return physical shape identified by unique 'ID'.
Bool_t GetAutoDestruct () const
TGLContextIdentityGetGLCtxIdentity () const
virtual UInt_t GetMaxPhysicalID ()
 Returns the maximum used physical id.
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
void LodifySceneInfo (TGLRnrCtx &rnrCtx) override
 Setup LOD-dependant values in scene-info.
void PostDraw (TGLRnrCtx &rnrCtx) override
 Called after the rendering is finished.
virtual void PostRender (TGLRnrCtx &rnrCtx)
 Perform post-render clean-up.
void PreDraw (TGLRnrCtx &rnrCtx) override
 Initialize rendering.
virtual void PreRender (TGLRnrCtx &rnrCtx)
 Perform pre-render initialization - fill rnrCtx with values stored during PreDraw().
void RebuildSceneInfo (TGLRnrCtx &rnrCtx) override
 Major change in scene, need to rebuild all-element draw-vector and sort it.
LogicalShapeMap_tRefLogicalShapes ()
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 RenderAllPasses (TGLRnrCtx &rnrCtx, DrawElementPtrVec_t &elVec, Bool_t check_timeout)
 Do full rendering of scene.
virtual void RenderElements (TGLRnrCtx &rnrCtx, DrawElementPtrVec_t &elVec, Bool_t check_timeout, const TGLPlaneSet_t *clipPlanes=nullptr)
 Render DrawElements in elementVec with given timeout.
virtual void RenderHighlight (TGLRnrCtx &rnrCtx, DrawElementPtrVec_t &elVec)
void RenderOpaque (TGLRnrCtx &rnrCtx) override
 Render opaque elements.
void RenderSelOpaque (TGLRnrCtx &rnrCtx) override
 Render selected opaque elements.
void RenderSelOpaqueForHighlight (TGLRnrCtx &rnrCtx) override
 Render selected opaque elements for highlight.
void RenderSelTransp (TGLRnrCtx &rnrCtx) override
 Render selected transparent elements.
void RenderSelTranspForHighlight (TGLRnrCtx &rnrCtx) override
 Render selected transparent elements for highlight.
void RenderTransp (TGLRnrCtx &rnrCtx) override
 Render transparent elements.
Bool_t ResolveSelectRecord (TGLSelectRecord &rec, Int_t curIdx) override
 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)
UInt_t SizeOfScene () const
 Return memory cost of scene.
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 UpdateLogical (TObject *logid)
 Drop display-lists for the logical (assume TGLObject/direct rendering).
virtual void UpdatePhysical (UInt_t phid, Double_t *trans, Color_t cidx=-1, UChar_t transp=0)
 Reposition/recolor physical shape.
virtual void UpdatePhysical (UInt_t phid, Double_t *trans, UChar_t *col)
 Reposition/recolor physical shape.
virtual void UpdatePhysioLogical (TObject *logid, Double_t *trans, Color_t cidx, UChar_t transp)
 Reposition/recolor physical for given logical (assume TGLObject and a single physical).
virtual void UpdatePhysioLogical (TObject *logid, Double_t *trans, UChar_t *col)
 Reposition/recolor physical for given logical (assume TGLObject and a single physical).
void UpdateSceneInfo (TGLRnrCtx &rnrCtx) override
 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 Bool_t IsOutside (const TGLBoundingBox &box, const TGLPlaneSet_t &planes)
 Check if box is outside of all planes.
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.
static void RGBAFromColorIdx (Float_t rgba[4], Color_t ci, Char_t transp=0)
 Fill rgba color from ROOT color-index ci and transparency (0->100).

Protected Types

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

Protected Member Functions

virtual void DestroyPhysicalInternal (PhysicalShapeMapIt_t pit)
 Virtual function to destroy a physical.
void ReleaseGLCtxIdentity ()
 Release all GL resources for current context identity.

Protected Attributes

Bool_t fAutoDestruct
TGLBoundingBox fBoundingBox
Bool_t fBoundingBoxValid
TGLClipfClip
Bool_t fDoClipCheck
Bool_t fDoFrustumCheck
TGLContextIdentityfGLCtxIdentity
Bool_t fInSmartRefresh
 !
Float_t fLastLineWidthScale
Float_t fLastPointSizeScale
ELock fLock
Short_t fLOD
LogicalShapeMap_t fLogicalShapes
 !
UInt_t fMinorStamp
TString fName
Float_t fOLLineW
PhysicalShapeMap_t fPhysicalShapes
 !
UInt_t fSceneID
Bool_t fSelectable
LogicalShapeMap_t fSmartRefreshCache
 !
Short_t fStyle
UInt_t fTimeStamp
TString fTitle
ViewerList_t fViewers
Float_t fWFLineW

Private Member Functions

 TGLScene (const TGLScene &)=delete
TGLSceneoperator= (const TGLScene &)=delete

Static Private Member Functions

static Bool_t ComparePhysicalDiagonals (const TGLPhysicalShape *shape1, const TGLPhysicalShape *shape2)
 Compare 'shape1' and 'shape2' bounding box volumes - return kTRUE if 'shape1' bigger than 'shape2'.
static Bool_t ComparePhysicalVolumes (const TGLPhysicalShape *shape1, const TGLPhysicalShape *shape2)
 Compare 'shape1' and 'shape2' bounding box volumes - return kTRUE if 'shape1' bigger than 'shape2'.

Static Private Attributes

static UInt_t fgSceneIDSrc = 1

Friends

class TSceneInfo

#include <TGLScene.h>

Inheritance diagram for TGLScene:
TGLSceneBase TGLLockable TGLScenePad

Member Typedef Documentation

◆ DrawElementPtrVec_i

typedef std::vector<DrawElement_t*>::iterator TGLScene::DrawElementPtrVec_i

Definition at line 69 of file TGLScene.h.

◆ DrawElementPtrVec_t

Definition at line 68 of file TGLScene.h.

◆ DrawElementVec_i

typedef std::vector<DrawElement_t>::iterator TGLScene::DrawElementVec_i

Definition at line 66 of file TGLScene.h.

◆ DrawElementVec_t

Definition at line 65 of file TGLScene.h.

◆ LogicalShapeMap_t

Definition at line 41 of file TGLScene.h.

◆ LogicalShapeMapCIt_t

typedef LogicalShapeMap_t::const_iterator TGLScene::LogicalShapeMapCIt_t

Definition at line 44 of file TGLScene.h.

◆ LogicalShapeMapIt_t

typedef LogicalShapeMap_t::iterator TGLScene::LogicalShapeMapIt_t

Definition at line 43 of file TGLScene.h.

◆ LogicalShapeMapValueType_t

typedef LogicalShapeMap_t::value_type TGLScene::LogicalShapeMapValueType_t

Definition at line 42 of file TGLScene.h.

◆ PhysicalShapeMap_t

Definition at line 47 of file TGLScene.h.

◆ PhysicalShapeMapCIt_t

typedef PhysicalShapeMap_t::const_iterator TGLScene::PhysicalShapeMapCIt_t

Definition at line 50 of file TGLScene.h.

◆ PhysicalShapeMapIt_t

typedef PhysicalShapeMap_t::iterator TGLScene::PhysicalShapeMapIt_t

Definition at line 49 of file TGLScene.h.

◆ PhysicalShapeMapValueType_t

typedef PhysicalShapeMap_t::value_type TGLScene::PhysicalShapeMapValueType_t

Definition at line 48 of file TGLScene.h.

◆ ShapeVec_i

typedef ShapeVec_t::iterator TGLScene::ShapeVec_i

Definition at line 73 of file TGLScene.h.

◆ ShapeVec_t

typedef std::vector<const TGLPhysicalShape*> TGLScene::ShapeVec_t

Definition at line 72 of file TGLScene.h.

◆ ViewerList_i

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

Definition at line 63 of file TGLSceneBase.h.

◆ ViewerList_t

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

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

◆ TGLScene() [1/2]

TGLScene::TGLScene ( const TGLScene & )
privatedelete

◆ TGLScene() [2/2]

TGLScene::TGLScene ( )

Definition at line 277 of file TGLScene.cxx.

◆ ~TGLScene()

TGLScene::~TGLScene ( )
override

Destroy scene objects.

Definition at line 291 of file TGLScene.cxx.

Member Function Documentation

◆ AddViewer()

void TGLSceneBase::AddViewer ( TGLViewerBase * viewer)
inherited

Add viewer to the list.

Definition at line 85 of file TGLSceneBase.cxx.

◆ AdoptLogical()

void TGLScene::AdoptLogical ( TGLLogicalShape & shape)
virtual

Adopt dynamically created logical 'shape' - add to internal map and take responsibility for deleting.

Definition at line 1017 of file TGLScene.cxx.

◆ AdoptPhysical()

void TGLScene::AdoptPhysical ( TGLPhysicalShape & shape)
virtual

Adopt dynamically created physical 'shape' - add to internal map and take responsibility for deleting.

Definition at line 1128 of file TGLScene.cxx.

◆ BeginSmartRefresh()

UInt_t TGLScene::BeginSmartRefresh ( )

Moves logicals that support smart-refresh to intermediate cache.

Destroys the others and returns the number of destroyed ones.

Definition at line 1415 of file TGLScene.cxx.

◆ BeginUpdate()

Bool_t TGLScene::BeginUpdate ( )
virtual

Put scene in update mode, return true if lock acquired.

Definition at line 1244 of file TGLScene.cxx.

◆ BoundingBox()

const TGLBoundingBox & TGLSceneBase::BoundingBox ( ) const
inlineinherited

Definition at line 138 of file TGLSceneBase.h.

◆ CalcBoundingBox()

void TGLScene::CalcBoundingBox ( ) const
overridevirtual

Encapsulates all physical shapes bounding box with axes aligned box.

Validity checked in the base-class.

Implements TGLSceneBase.

Definition at line 976 of file TGLScene.cxx.

◆ Class()

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

◆ Class_Name()

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

◆ Class_Version()

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

Definition at line 244 of file TGLScene.h.

◆ Clip()

TGLClip * TGLSceneBase::Clip ( ) const
inlineinherited

Definition at line 125 of file TGLSceneBase.h.

◆ ComparePhysicalDiagonals()

Bool_t TGLScene::ComparePhysicalDiagonals ( const TGLPhysicalShape * shape1,
const TGLPhysicalShape * shape2 )
inlinestaticprivate

Compare 'shape1' and 'shape2' bounding box volumes - return kTRUE if 'shape1' bigger than 'shape2'.

Definition at line 365 of file TGLScene.cxx.

◆ ComparePhysicalVolumes()

Bool_t TGLScene::ComparePhysicalVolumes ( const TGLPhysicalShape * shape1,
const TGLPhysicalShape * shape2 )
inlinestaticprivate

Compare 'shape1' and 'shape2' bounding box volumes - return kTRUE if 'shape1' bigger than 'shape2'.

Definition at line 355 of file TGLScene.cxx.

◆ CreateSceneInfo()

TGLScene::TSceneInfo * TGLScene::CreateSceneInfo ( TGLViewerBase * view)
overridevirtual

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

Here we instantiate the inner class TSceneInfo that includes camera/clipping specific draw-list containers.

Reimplemented from TGLSceneBase.

Definition at line 346 of file TGLScene.cxx.

◆ CurrentLock()

ELock TGLLockable::CurrentLock ( ) const
inlineinherited

Definition at line 61 of file TGLLockable.h.

◆ DeclFileName()

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

Definition at line 244 of file TGLScene.h.

◆ DestroyLogical()

Bool_t TGLScene::DestroyLogical ( TObject * logid,
Bool_t mustFind = kTRUE )
virtual

Destroy logical shape defined by unique 'ID'.

Returns kTRUE if found/destroyed - kFALSE otherwise.

If mustFind is true, an error is reported if the logical is not found.

Definition at line 1035 of file TGLScene.cxx.

◆ DestroyLogicals()

Int_t TGLScene::DestroyLogicals ( )
virtual

Destroy all logical shapes in scene.

Return number of destroyed logicals.

Definition at line 1072 of file TGLScene.cxx.

◆ DestroyPhysical()

Bool_t TGLScene::DestroyPhysical ( UInt_t phid)
virtual

Destroy physical shape defined by unique 'ID'.

Returns kTRUE if found/destroyed - kFALSE otherwise.

Definition at line 1158 of file TGLScene.cxx.

◆ DestroyPhysicalInternal()

void TGLScene::DestroyPhysicalInternal ( PhysicalShapeMapIt_t pit)
protectedvirtual

Virtual function to destroy a physical.

Sub-classes might have special checks to perform. Caller should also invalidate the draw-list.

Definition at line 1148 of file TGLScene.cxx.

◆ DestroyPhysicals()

Int_t TGLScene::DestroyPhysicals ( )
virtual

Destroy physical shapes.

Definition at line 1182 of file TGLScene.cxx.

◆ DumpMapSizes()

void TGLScene::DumpMapSizes ( ) const

Print sizes of logical and physical-shape maps.

Definition at line 1522 of file TGLScene.cxx.

◆ EndSmartRefresh()

void TGLScene::EndSmartRefresh ( )

Wipes logicals in refresh-cache.

Definition at line 1438 of file TGLScene.cxx.

◆ EndUpdate()

void TGLScene::EndUpdate ( Bool_t minorChange = kTRUE,
Bool_t sceneChanged = kTRUE,
Bool_t updateViewers = kTRUE )
virtual

Exit scene update mode.

If sceneChanged is true (default), the scene timestamp is increased and basic draw-lists etc will be rebuild on next draw request. If you only changed colors or some other visual parameters that do not affect object bounding-box or transformation matrix, you can set it to false.

If updateViewers is true (default), the viewers using this scene will be tagged as changed. If sceneChanged is true the updateViewers should be true as well, unless you take care of the viewers elsewhere or in some other way.

Definition at line 1264 of file TGLScene.cxx.

◆ FindLogical()

TGLLogicalShape * TGLScene::FindLogical ( TObject * logid) const
overridevirtual

Find and return logical shape identified by unique logid.

Returns 0 if not found.

Reimplemented from TGLSceneBase.

Definition at line 1106 of file TGLScene.cxx.

◆ FindLogicalSmartRefresh()

TGLLogicalShape * TGLScene::FindLogicalSmartRefresh ( TObject * ID) const

Find and return logical shape identified by unique 'ID' in refresh-cache.

Returns 0 if not found.

Definition at line 1454 of file TGLScene.cxx.

◆ FindPhysical()

TGLPhysicalShape * TGLScene::FindPhysical ( UInt_t phid) const
virtual

Find and return physical shape identified by unique 'ID'.

Returns 0 if not found.

Definition at line 1220 of file TGLScene.cxx.

◆ GetAutoDestruct()

Bool_t TGLSceneBase::GetAutoDestruct ( ) const
inlineinherited

Definition at line 131 of file TGLSceneBase.h.

◆ GetGLCtxIdentity()

TGLContextIdentity * TGLScene::GetGLCtxIdentity ( ) const
inline

Definition at line 230 of file TGLScene.h.

◆ GetMaxPhysicalID()

UInt_t TGLScene::GetMaxPhysicalID ( )
virtual

Returns the maximum used physical id.

Returns 0 if empty.

Definition at line 1230 of file TGLScene.cxx.

◆ GetMinorStamp()

UInt_t TGLSceneBase::GetMinorStamp ( ) const
inlineinherited

Definition at line 116 of file TGLSceneBase.h.

◆ GetName()

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

Definition at line 81 of file TGLSceneBase.h.

◆ GetSelectable()

Bool_t TGLSceneBase::GetSelectable ( ) const
inlineinherited

Definition at line 128 of file TGLSceneBase.h.

◆ GetTimeStamp()

UInt_t TGLSceneBase::GetTimeStamp ( ) const
inlineinherited

Definition at line 113 of file TGLSceneBase.h.

◆ GetTitle()

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

Definition at line 82 of file TGLSceneBase.h.

◆ IncMinorStamp()

void TGLSceneBase::IncMinorStamp ( )
inlineinherited

Definition at line 117 of file TGLSceneBase.h.

◆ IncTimeStamp()

void TGLSceneBase::IncTimeStamp ( )
inlineinherited

Definition at line 114 of file TGLSceneBase.h.

◆ InvalidateBoundingBox()

void TGLSceneBase::InvalidateBoundingBox ( )
inlineinherited

Definition at line 137 of file TGLSceneBase.h.

◆ IsA()

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

Reimplemented from TGLLockable.

Reimplemented in TGLScenePad.

Definition at line 244 of file TGLScene.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.

◆ IsOutside()

Bool_t TGLScene::IsOutside ( const TGLBoundingBox & box,
const TGLPlaneSet_t & planes )
static

Check if box is outside of all planes.

Definition at line 1542 of file TGLScene.cxx.

◆ LockIdStr()

const char * TGLSceneBase::LockIdStr ( ) const
overridevirtualinherited

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
inlineinherited

Definition at line 119 of file TGLSceneBase.h.

◆ LodifySceneInfo()

void TGLScene::LodifySceneInfo ( TGLRnrCtx & rnrCtx)
overridevirtual

Setup LOD-dependant values in scene-info.

We have to perform LOD quantization for all draw-elements.

Reimplemented from TGLSceneBase.

Definition at line 543 of file TGLScene.cxx.

◆ operator=()

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

◆ PostDraw()

void TGLScene::PostDraw ( TGLRnrCtx & rnrCtx)
overridevirtual

Called after the rendering is finished.

In debug mode draw statistics is dumped. Parent's PostDraw is called for GL cleanup.

Reimplemented from TGLSceneBase.

Definition at line 706 of file TGLScene.cxx.

◆ PostRender()

void TGLSceneBase::PostRender ( TGLRnrCtx & rnrCtx)
virtualinherited

Perform post-render clean-up.

Definition at line 482 of file TGLSceneBase.cxx.

◆ PreDraw()

void TGLScene::PreDraw ( TGLRnrCtx & rnrCtx)
overridevirtual

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.

Reimplemented from TGLSceneBase.

Definition at line 567 of file TGLScene.cxx.

◆ PreRender()

void TGLSceneBase::PreRender ( TGLRnrCtx & rnrCtx)
virtualinherited

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 TGLScene::RebuildSceneInfo ( TGLRnrCtx & rnrCtx)
overridevirtual

Major change in scene, need to rebuild all-element draw-vector and sort it.

Sort the TGLPhysical draw list by shape bounding box diagonal, from large to small. This makes dropout of shapes with time limited Draw() calls must less noticeable. As this does not use projected size it only needs to be done after a scene content change - not every time scene drawn (potential camera/projection change).

Reimplemented from TGLSceneBase.

Definition at line 381 of file TGLScene.cxx.

◆ RefLogicalShapes()

LogicalShapeMap_t & TGLScene::RefLogicalShapes ( )
inline

Definition at line 216 of file TGLScene.h.

◆ ReleaseGLCtxIdentity()

void TGLScene::ReleaseGLCtxIdentity ( )
protected

Release all GL resources for current context identity.

Requires iteration over all logical shapes.

Definition at line 310 of file TGLScene.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)
inherited

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

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.

◆ RenderAllPasses()

void TGLScene::RenderAllPasses ( TGLRnrCtx & rnrCtx,
DrawElementPtrVec_t & elVec,
Bool_t check_timeout )
virtual

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.

Definition at line 724 of file TGLScene.cxx.

◆ RenderElements()

void TGLScene::RenderElements ( TGLRnrCtx & rnrCtx,
DrawElementPtrVec_t & elVec,
Bool_t check_timeout,
const TGLPlaneSet_t * clipPlanes = nullptr )
virtual

Render DrawElements in elementVec with given timeout.

If clipPlanes is non-zero, test each element against its clipping planes.

Definition at line 892 of file TGLScene.cxx.

◆ RenderHighlight()

void TGLScene::RenderHighlight ( TGLRnrCtx & rnrCtx,
DrawElementPtrVec_t & elVec )
virtual

Definition at line 671 of file TGLScene.cxx.

◆ RenderOpaque()

void TGLScene::RenderOpaque ( TGLRnrCtx & rnrCtx)
overridevirtual

Render opaque elements.

Reimplemented from TGLSceneBase.

Definition at line 612 of file TGLScene.cxx.

◆ RenderSelOpaque()

void TGLScene::RenderSelOpaque ( TGLRnrCtx & rnrCtx)
overridevirtual

Render selected opaque elements.

Reimplemented from TGLSceneBase.

Definition at line 632 of file TGLScene.cxx.

◆ RenderSelOpaqueForHighlight()

void TGLScene::RenderSelOpaqueForHighlight ( TGLRnrCtx & rnrCtx)
overridevirtual

Render selected opaque elements for highlight.

Reimplemented from TGLSceneBase.

Definition at line 652 of file TGLScene.cxx.

◆ RenderSelTransp()

void TGLScene::RenderSelTransp ( TGLRnrCtx & rnrCtx)
overridevirtual

Render selected transparent elements.

Reimplemented from TGLSceneBase.

Definition at line 642 of file TGLScene.cxx.

◆ RenderSelTranspForHighlight()

void TGLScene::RenderSelTranspForHighlight ( TGLRnrCtx & rnrCtx)
overridevirtual

Render selected transparent elements for highlight.

Reimplemented from TGLSceneBase.

Definition at line 662 of file TGLScene.cxx.

◆ RenderTransp()

void TGLScene::RenderTransp ( TGLRnrCtx & rnrCtx)
overridevirtual

Render transparent elements.

Reimplemented from TGLSceneBase.

Definition at line 622 of file TGLScene.cxx.

◆ ResolveSelectRecord()

Bool_t TGLScene::ResolveSelectRecord ( TGLSelectRecord & rec,
Int_t curIdx )
overridevirtual

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.

Reimplemented from TGLSceneBase.

Definition at line 949 of file TGLScene.cxx.

◆ RGBAFromColorIdx()

void TGLScene::RGBAFromColorIdx ( Float_t rgba[4],
Color_t ci,
Char_t transp = 0 )
static

Fill rgba color from ROOT color-index ci and transparency (0->100).

Definition at line 1531 of file TGLScene.cxx.

◆ SetAutoDestruct()

void TGLSceneBase::SetAutoDestruct ( Bool_t a)
inlineinherited

Definition at line 132 of file TGLSceneBase.h.

◆ SetClip()

void TGLSceneBase::SetClip ( TGLClip * p)
inlineinherited

Definition at line 126 of file TGLSceneBase.h.

◆ SetLOD()

void TGLSceneBase::SetLOD ( Short_t lod)
inlineinherited

Definition at line 120 of file TGLSceneBase.h.

◆ SetName()

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

Definition at line 83 of file TGLSceneBase.h.

◆ SetNameTitle()

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

Definition at line 85 of file TGLSceneBase.h.

◆ SetSelectable()

void TGLSceneBase::SetSelectable ( Bool_t a)
inlineinherited

Definition at line 129 of file TGLSceneBase.h.

◆ SetStyle()

void TGLSceneBase::SetStyle ( Short_t st)
inlineinherited

Definition at line 123 of file TGLSceneBase.h.

◆ SetTitle()

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

Definition at line 84 of file TGLSceneBase.h.

◆ SizeOfScene()

UInt_t TGLScene::SizeOfScene ( ) const

Return memory cost of scene.

Warning: NOT CORRECT at present - doesn't correctly calculate size. of logical shapes with dynamic internal contents.

Definition at line 1490 of file TGLScene.cxx.

◆ Streamer()

void TGLScene::Streamer ( TBuffer & )
overridevirtual

Reimplemented from TGLLockable.

Reimplemented in TGLScenePad.

◆ StreamerNVirtual()

void TGLScene::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 244 of file TGLScene.h.

◆ Style()

Short_t TGLSceneBase::Style ( ) const
inlineinherited

Definition at line 122 of file TGLSceneBase.h.

◆ TagViewersChanged()

void TGLSceneBase::TagViewersChanged ( )
inherited

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.

◆ UpdateLogical()

void TGLScene::UpdateLogical ( TObject * logid)
virtual

Drop display-lists for the logical (assume TGLObject/direct rendering).

Re-calculate the bounding box (also for all physicals).

Definition at line 1282 of file TGLScene.cxx.

◆ UpdatePhysical() [1/2]

void TGLScene::UpdatePhysical ( UInt_t phid,
Double_t * trans,
Color_t cidx = -1,
UChar_t transp = 0 )
virtual

Reposition/recolor physical shape.

Definition at line 1324 of file TGLScene.cxx.

◆ UpdatePhysical() [2/2]

void TGLScene::UpdatePhysical ( UInt_t phid,
Double_t * trans,
UChar_t * col )
virtual

Reposition/recolor physical shape.

Definition at line 1303 of file TGLScene.cxx.

◆ UpdatePhysioLogical() [1/2]

void TGLScene::UpdatePhysioLogical ( TObject * logid,
Double_t * trans,
Color_t cidx,
UChar_t transp )
virtual

Reposition/recolor physical for given logical (assume TGLObject and a single physical).

Definition at line 1378 of file TGLScene.cxx.

◆ UpdatePhysioLogical() [2/2]

void TGLScene::UpdatePhysioLogical ( TObject * logid,
Double_t * trans,
UChar_t * col )
virtual

Reposition/recolor physical for given logical (assume TGLObject and a single physical).

Definition at line 1351 of file TGLScene.cxx.

◆ UpdateSceneInfo()

void TGLScene::UpdateSceneInfo ( TGLRnrCtx & rnrCtx)
overridevirtual

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.

Reimplemented from TGLSceneBase.

Definition at line 425 of file TGLScene.cxx.

◆ TSceneInfo

friend class TSceneInfo
friend

Definition at line 121 of file TGLScene.h.

Member Data Documentation

◆ fAutoDestruct

Bool_t TGLSceneBase::fAutoDestruct
protectedinherited

Definition at line 66 of file TGLSceneBase.h.

◆ fBoundingBox

TGLBoundingBox TGLSceneBase::fBoundingBox
mutableprotectedinherited

Definition at line 55 of file TGLSceneBase.h.

◆ fBoundingBoxValid

Bool_t TGLSceneBase::fBoundingBoxValid
mutableprotectedinherited

Definition at line 56 of file TGLSceneBase.h.

◆ fClip

TGLClip* TGLSceneBase::fClip
protectedinherited

Definition at line 51 of file TGLSceneBase.h.

◆ fDoClipCheck

Bool_t TGLSceneBase::fDoClipCheck
protectedinherited

Definition at line 59 of file TGLSceneBase.h.

◆ fDoFrustumCheck

Bool_t TGLSceneBase::fDoFrustumCheck
protectedinherited

Definition at line 58 of file TGLSceneBase.h.

◆ fGLCtxIdentity

TGLContextIdentity* TGLScene::fGLCtxIdentity
protected

Definition at line 131 of file TGLScene.h.

◆ fgSceneIDSrc

UInt_t TGLSceneBase::fgSceneIDSrc = 1
staticprivateinherited

Definition at line 38 of file TGLSceneBase.h.

◆ fInSmartRefresh

Bool_t TGLScene::fInSmartRefresh
protected

!

Definition at line 135 of file TGLScene.h.

◆ fLastLineWidthScale

Float_t TGLScene::fLastLineWidthScale
protected

Definition at line 140 of file TGLScene.h.

◆ fLastPointSizeScale

Float_t TGLScene::fLastPointSizeScale
protected

Definition at line 139 of file TGLScene.h.

◆ fLock

ELock TGLLockable::fLock
mutableprotectedinherited

Definition at line 32 of file TGLLockable.h.

◆ fLOD

Short_t TGLSceneBase::fLOD
protectedinherited

Definition at line 47 of file TGLSceneBase.h.

◆ fLogicalShapes

LogicalShapeMap_t TGLScene::fLogicalShapes
protected

!

Definition at line 125 of file TGLScene.h.

◆ fMinorStamp

UInt_t TGLSceneBase::fMinorStamp
protectedinherited

Definition at line 46 of file TGLSceneBase.h.

◆ fName

TString TGLSceneBase::fName
protectedinherited

Definition at line 42 of file TGLSceneBase.h.

◆ fOLLineW

Float_t TGLSceneBase::fOLLineW
protectedinherited

Definition at line 50 of file TGLSceneBase.h.

◆ fPhysicalShapes

PhysicalShapeMap_t TGLScene::fPhysicalShapes
protected

!

Definition at line 126 of file TGLScene.h.

◆ fSceneID

UInt_t TGLSceneBase::fSceneID
protectedinherited

Definition at line 41 of file TGLSceneBase.h.

◆ fSelectable

Bool_t TGLSceneBase::fSelectable
protectedinherited

Definition at line 52 of file TGLSceneBase.h.

◆ fSmartRefreshCache

LogicalShapeMap_t TGLScene::fSmartRefreshCache
mutableprotected

!

Definition at line 136 of file TGLScene.h.

◆ fStyle

Short_t TGLSceneBase::fStyle
protectedinherited

Definition at line 48 of file TGLSceneBase.h.

◆ fTimeStamp

UInt_t TGLSceneBase::fTimeStamp
protectedinherited

Definition at line 45 of file TGLSceneBase.h.

◆ fTitle

TString TGLSceneBase::fTitle
protectedinherited

Definition at line 43 of file TGLSceneBase.h.

◆ fViewers

ViewerList_t TGLSceneBase::fViewers
protectedinherited

Definition at line 65 of file TGLSceneBase.h.

◆ fWFLineW

Float_t TGLSceneBase::fWFLineW
protectedinherited

Definition at line 49 of file TGLSceneBase.h.


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