27#include "TGLIncludes.h"
63 fResetSceneInfosOnRender (
kFALSE),
81 (*i)->GetScene()->RemoveViewer(
this);
95 return "TGLViewerBase";
109 while (i !=
fScenes.end() && (*i)->GetScene() !=
scene) ++i;
122 scene->AddViewer(
this);
126 Warning(
"TGLViewerBase::AddScene",
"scene '%s' already in the list.",
141 scene->RemoveViewer(
this);
144 Warning(
"TGLViewerBase::RemoveScene",
"scene '%s' not found.",
157 sinfo->GetScene()->RemoveViewer(
this);
177 Warning(
"TGLViewerBase::SceneDestructing",
"scene not found.");
270 (*i)->ResetSceneStamp();
284 if (
sinfo->GetActive())
286 sinfo->SetupTransformsAndBBox();
327 Warning(
"TGLViewerBase::PreRender",
"Switching to another GL context; maybe you should use context-sharing.");
351 if (
sinfo->GetActive())
357 Warning(
"TGLViewerBase::PreRender",
"locking of scene '%s' failed, skipping.",
358 sinfo->GetScene()->GetName());
363 sinfo->SetupTransformsAndBBox();
383 if (
sinfo->IsVisible()) {
534 if (
el->GetState() & state)
607 if (
sb->SelectRecord(rec,
recIdx) < 1)
615 rec.SetSceneInfo(
sinfo);
616 return sinfo->GetScene()->ResolveSelectRecord(rec, 1);
668 if (rec.GetItem(0) <
fOverlay.size())
670 rec.SetOvlElement(
fOverlay[rec.GetItem(0)]);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
const_iterator begin() const
const_iterator end() const
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
void SetEmpty()
Set bounding box empty - all vertices at (0,0,0)
void MergeAligned(const TGLBoundingBox &other)
Expand current bbox so that it includes other's bbox.
Rgl::EOverlap FrustumOverlap(const TGLBoundingBox &box) const
Calculate overlap (kInside, kOutside, kPartial) of box with camera frustum Camera must have valid fru...
virtual void Apply(const TGLBoundingBox &sceneBox, const TGLRect *pickRect=nullptr) const =0
virtual void Setup(const TGLBoundingBox &bbox)=0
Identifier of a shared GL-context.
static TGLContextIdentity * GetCurrent()
Find identitfy of current context. Static.
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
Selection record for overlay objects.
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
void SetSceneInfo(TGLSceneInfo *si)
void SetViewerLOD(Short_t LOD)
TGLSelectBuffer * GetSelectBuffer() const
void SetViewerOLLineW(Float_t w)
void SetViewerWFLineW(Float_t w)
void SetGLCtxIdentity(TGLContextIdentity *cid)
TGLRect * GetPickRectangle()
Return current pick rectangle.
void SetViewerStyle(Short_t sty)
void SetViewerClip(TGLClip *p)
void SetCamera(TGLCamera *c)
void SetHighlight(Bool_t hil)
TGLContextIdentity * GetGLCtxIdentity() const
Scene base-class – provides basic interface expected by the TGLViewer or its sub-classes:
virtual void RenderSelOpaque(TGLRnrCtx &rnrCtx)
Render selected opaque elements.
virtual void RenderSelTransp(TGLRnrCtx &rnrCtx)
Render selected transparent elements for highlight.
virtual void RenderTransp(TGLRnrCtx &rnrCtx)
Render transparent elements.
virtual void RenderSelTranspForHighlight(TGLRnrCtx &rnrCtx)
Render selected transparent elements.
virtual void RenderOpaque(TGLRnrCtx &rnrCtx)
Render opaque elements.
virtual void RenderSelOpaqueForHighlight(TGLRnrCtx &rnrCtx)
Render selected opaque elements for highlight.
Base class for extended scene context.
Encapsulates OpenGL select buffer.
Standard selection record including information about containing scene and details ob out selected ob...
static Int_t CheckError(const char *loc)
Check current GL error state, outputting details via ROOT Error method if one.
Base class for GL viewers.
void SceneDestructing(TGLSceneBase *scene)
Remove scene, its scene-info is deleted.
virtual void RenderTransparent(Bool_t rnr_non_selected=kTRUE, Bool_t rnr_selected=kTRUE)
Render transparent objects from all scenes.
virtual void DeleteOverlayElements(TGLOverlayElement::ERole r)
Delete overlay elements.
virtual void PreRenderOverlaySelection()
Perform minimal initialization for overlay selection.
SceneInfoVec_t fVisScenes
const char * LockIdStr() const override
Name to print in locking output.
virtual void RenderSelected()
Render selected objects from all scenes.
void SubRenderScenes(SubRender_foo render_foo)
Call sub-rendering function render_foo on all currently visible scenes.
Bool_t FindClosestOpaqueRecord(TGLSelectRecord &rec, Int_t &recIdx)
Find next select record that can be resolved and whose result is not transparent, starting from posit...
virtual void ResetSceneInfos()
Force rebuild of view-dependent scene-info structures.
TGLSceneInfo * AddScene(TGLSceneBase *scene)
Add new scene, appropriate scene-info is created.
TGLLogicalShape * FindLogicalInScenes(TObject *id)
Find logical-shape representing object id in the list of scenes.
std::vector< TGLOverlayElement * > OverlayElmVec_t
virtual void RemoveOverlayElement(TGLOverlayElement *el)
Remove overlay element.
virtual void RenderOverlay(Int_t state, Bool_t selection)
Render overlay objects.
SceneInfoVec_t::iterator SceneInfoVec_i
TGLSceneInfo * GetSceneInfo(TGLSceneBase *scene)
Find scene-info corresponding to scene.
virtual void Render()
Render all scenes.
virtual void PostRenderOverlaySelection()
Perform cleanup after overlay selection.
virtual void PreRender()
Initialize render-context, setup camera, GL, render-area.
virtual void PostRender()
Function called after rendering is finished.
virtual void SetupClipObject()
Setup clip-object. Protected virtual method.
SceneInfoList_i FindScene(TGLSceneBase *scene)
Find scene-info corresponding to scene.
Bool_t FindClosestOverlayRecord(TGLOvlSelectRecord &rec, Int_t &recIdx)
Find next overlay-select record that can be resolved, starting from position 'recIdx'.
virtual void MergeSceneBBoxes(TGLBoundingBox &bbox)
Merge bounding-boxes of all active registered scenes.
OverlayElmVec_t::iterator OverlayElmVec_i
void RemoveAllScenes()
Remove all scenes from the viewer, their scene-infos are deleted.
Bool_t fResetSceneInfosOnRender
TGLBoundingBox fOverallBoundingBox
void RemoveScene(TGLSceneBase *scene)
Remove scene from the viewer, its scene-info is deleted.
std::list< TGLSceneInfo * > SceneInfoList_t
virtual void DeleteOverlayAnnotations()
Delete overlay elements that are annotations.
virtual void RenderNonSelected()
Render non-selected objects from all scenes.
Bool_t ResolveSelectRecord(TGLSelectRecord &rec, Int_t recIdx)
Process selection record on buffer-position 'recIdx' and fill the data into 'rec'.
virtual void RenderSelectedForHighlight()
Render selected objects from all scenes for highlight.
virtual void RenderOpaque(Bool_t rnr_non_selected=kTRUE, Bool_t rnr_selected=kTRUE)
Render opaque objects from all scenes.
SceneInfoList_t::iterator SceneInfoList_i
~TGLViewerBase() override
Destructor.
virtual void AddOverlayElement(TGLOverlayElement *el)
Add overlay element.
Bool_t FindClosestRecord(TGLSelectRecord &rec, Int_t &recIdx)
Find next select record that can be resolved, starting from position 'recIdx'.
Mother of all ROOT objects.