63 fResetSceneInfosOnRender (
kFALSE),
81 (*i)->GetScene()->RemoveViewer(
this);
95 return "TGLViewerBase";
109 while (i !=
fScenes.end() && (*i)->GetScene() != scene) ++i;
126 Warning(
"TGLViewerBase::AddScene",
"scene '%s' already in the list.",
144 Warning(
"TGLViewerBase::RemoveScene",
"scene '%s' not found.",
177 Warning(
"TGLViewerBase::SceneDestructing",
"scene not found.");
270 (*i)->ResetSceneStamp();
327 Warning(
"TGLViewerBase::PreRender",
"Switching to another GL context; maybe you should use context-sharing.");
357 Warning(
"TGLViewerBase::PreRender",
"locking of scene '%s' failed, skipping.",
361 locked_scenes.push_back(sinfo);
374 for (
SceneInfoList_i i=locked_scenes.begin(); i!=locked_scenes.end(); ++i)
404 for (
Int_t i = 0; i < nScenes; ++i)
411 (scene->*render_foo)(*
fRnrCtx);
437 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
438 glDepthMask(GL_FALSE);
442 glDepthMask(GL_TRUE);
455 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
456 glDepthMask(GL_FALSE);
460 glDepthMask(GL_TRUE);
475 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
476 glDepthMask(GL_FALSE);
480 glDepthMask(GL_TRUE);
490 if (rnr_non_selected)
508 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
509 glDepthMask(GL_FALSE);
511 if (rnr_non_selected)
520 glDepthMask(GL_TRUE);
531 for (
Int_t i = 0; i < nOvl; ++i)
536 if (selection) glPushName(i);
538 if (selection) glPopName();
628 while (recIdx < sb->GetNRecords())
646 while (recIdx < sb->GetNRecords())
665 while (recIdx < sb->GetNRecords())
void AddViewer(TGLViewerBase *viewer)
Add viewer to the list.
void SceneDestructing(TGLSceneBase *scene)
Remove scene, its scene-info is deleted.
TGLScene * GetScene() const
std::vector< TGLOverlayElement * > OverlayElmVec_t
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
virtual void SetupClipObject()
Setup clip-object. Protected virtual method.
virtual TGLLogicalShape * FindLogical(TObject *logid) const
Find and return logical shape identified by unique logid.
SceneInfoVec_t fVisScenes
virtual TGLSceneInfo * CreateSceneInfo(TGLViewerBase *view)
Create a scene-info instance appropriate for this scene class.
virtual void Setup(const TGLBoundingBox &bbox)=0
void(TGLSceneBase::* SubRender_foo)(TGLRnrCtx &)
void SetOvlElement(TGLOverlayElement *e)
std::list< TGLSceneInfo * > SceneInfoList_t
OverlayElmVec_t::iterator OverlayElmVec_i
virtual void Render()
Render all scenes.
void SetupTransformsAndBBox()
Combine information from scene, scene-info and camera (should be optional) into transformation matric...
Identifier of a shared GL-context.
Int_t SelectRecord(TGLSelectRecordBase &rec, Int_t i)
Fill select record rec with data on (sorted) position i.
void RemoveViewer(TGLViewerBase *viewer)
Remove viewer from the list.
Scene base-class – provides basic interface expected by the TGLViewer or its sub-classes: ...
virtual void PreRender(TGLRnrCtx &rnrCtx)
Perform pre-render initialization - fill rnrCtx with values stored during PreDraw().
Bool_t FindClosestRecord(TGLSelectRecord &rec, Int_t &recIdx)
Find next select record that can be resolved, starting from position 'recIdx'.
virtual void RemoveOverlayElement(TGLOverlayElement *el)
Remove overlay element.
virtual void RenderSelTransp(TGLRnrCtx &rnrCtx)
Render selected transparent elements for highlight.
virtual ~TGLViewerBase()
Destructor.
void SetViewerLOD(Short_t LOD)
virtual void RenderSelOpaque(TGLRnrCtx &rnrCtx)
Render selected opaque elements.
virtual void RenderSelected()
Render selected objects from all scenes.
Int_t GetNRecords() const
TGLRect * GetPickRectangle()
Return current pick rectangle.
Base class for GL viewers.
virtual const char * GetName() const
Encapsulates OpenGL select buffer.
void SetViewerOLLineW(Float_t w)
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 PostRenderOverlaySelection()
Perform cleanup after overlay selection.
void SetViewerStyle(Short_t sty)
virtual void Apply(const TGLBoundingBox &sceneBox, const TGLRect *pickRect=0) const =0
virtual void ResetSceneInfos()
Force rebuild of view-dependent scene-info structures.
Bool_t GetTransparent() const
void SetSceneInfo(TGLSceneInfo *si)
TGLContextIdentity * GetGLCtxIdentity() const
virtual void RenderSelectedForHighlight()
Render selected objects from all scenes for highlight.
TGLSelectBuffer * GetSelectBuffer() const
virtual void RenderTransp(TGLRnrCtx &rnrCtx)
Render transparent elements.
static TGLContextIdentity * GetCurrent()
Find identitfy of current context. Static.
Bool_t GetSelectable() const
virtual void RenderSelOpaqueForHighlight(TGLRnrCtx &rnrCtx)
Render selected opaque elements for highlight.
TGLLogicalShape * FindLogicalInScenes(TObject *id)
Find logical-shape representing object id in the list of scenes.
virtual void RenderSelTranspForHighlight(TGLRnrCtx &rnrCtx)
Render selected transparent elements.
TGLBoundingBox fOverallBoundingBox
void SetCamera(TGLCamera *c)
void SetHighlight(Bool_t hil)
virtual void PreRender()
Initialize render-context, setup camera, GL, render-area.
virtual void Render(TGLRnrCtx &rnrCtx)=0
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
Standard selection record including information about containing scene and details ob out selected ob...
void SubRenderScenes(SubRender_foo render_foo)
Call sub-rendering function render_foo on all currently visible scenes.
virtual Bool_t ResolveSelectRecord(TGLSelectRecord &rec, Int_t curIdx)
Process selection record rec.
virtual void RenderTransparent(Bool_t rnr_non_selected=kTRUE, Bool_t rnr_selected=kTRUE)
Render transparent objects from all scenes.
const TGLBoundingBox & GetTransformedBBox()
virtual void PostRender()
Function called after rendering is finished.
Bool_t ReleaseLock(ELock lock) const
Release current lock, make sure it the same as the 'lock' argument.
virtual void RenderOpaque(Bool_t rnr_non_selected=kTRUE, Bool_t rnr_selected=kTRUE)
Render opaque objects from all scenes.
void Warning(const char *location, const char *msgfmt,...)
virtual void DeleteOverlayElements(TGLOverlayElement::ERole r)
Delete overlay elements.
void MergeAligned(const TGLBoundingBox &other)
Expand current bbox so that it includes other's bbox.
Bool_t fResetSceneInfosOnRender
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
SceneInfoVec_t::iterator SceneInfoVec_i
virtual void PreRenderOverlaySelection()
Perform minimal initialization for overlay selection.
virtual void RenderOverlay(Int_t state, Bool_t selection)
Render overlay objects.
virtual void AddOverlayElement(TGLOverlayElement *el)
Add overlay element.
TGLSceneBase * GetScene() const
TGLSceneInfo * AddScene(TGLSceneBase *scene)
Add new scene, appropriate scene-info is created.
UInt_t GetItem(Int_t i) const
void SetEmpty()
Set bounding box empty - all vertices at (0,0,0)
virtual void RenderNonSelected()
Render non-selected objects from all scenes.
Bool_t FindClosestOverlayRecord(TGLOvlSelectRecord &rec, Int_t &recIdx)
Find next overlay-select record that can be resolved, starting from position 'recIdx'.
Rgl::EOverlap FrustumOverlap(const TGLBoundingBox &box) const
Calculate overlap (kInside, kOutside, kPartial) of box with camera frustum Camera must have valid fru...
virtual void MergeSceneBBoxes(TGLBoundingBox &bbox)
Merge bounding-boxes of all active registered scenes.
Bool_t TakeLock(ELock lock) const
Lock the object in mode 'lock'.
SceneInfoList_i FindScene(TGLSceneBase *scene)
Find scene-info corresponding to scene.
void RemoveAllScenes()
Remove all scenes from the viewer, their scene-infos are deleted.
Mother of all ROOT objects.
static Int_t CheckError(const char *loc)
Check current GL error state, outputting details via ROOT Error method if one.
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
virtual void DeleteOverlayAnnotations()
Delete overlay elements that are annotations.
void RemoveScene(TGLSceneBase *scene)
Remove scene from the viewer, its scene-info is deleted.
Base class for extended scene context.
virtual void RenderOpaque(TGLRnrCtx &rnrCtx)
Render opaque elements.
virtual void PreDraw(TGLRnrCtx &rnrCtx)
Perform basic pre-render initialization:
SceneInfoList_t::iterator SceneInfoList_i
virtual const char * LockIdStr() const
Name to print in locking output.
Selection record for overlay objects.
void SetViewerWFLineW(Float_t w)
Bool_t ResolveSelectRecord(TGLSelectRecord &rec, Int_t recIdx)
Process selection record on buffer-position 'recIdx' and fill the data into 'rec'.
virtual void PostRender(TGLRnrCtx &rnrCtx)
Perform post-render clean-up.
void SetViewerClip(TGLClip *p)
TGLSceneInfo * GetSceneInfo(TGLSceneBase *scene)
Find scene-info corresponding to scene.
void SetSceneInfo(TGLSceneInfo *si)
virtual void PostDraw(TGLRnrCtx &rnrCtx)
Finalize drawing.
void SetGLCtxIdentity(TGLContextIdentity *cid)