12#ifndef ROOT_TGLScene_H 
   13#define ROOT_TGLScene_H 
#define ClassDefOverride(name, id)
 
std::vector< TGLPlane > TGLPlaneSet_t
 
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
 
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
 
Identifier of a shared GL-context.
 
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
 
Base-class for direct OpenGL renderers.
 
Concrete physical shape - a GL drawable.
 
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
 
Scene base-class – provides basic interface expected by the TGLViewer or its sub-classes:
 
Base class for extended scene context.
 
DrawElementPtrVec_t fSelTranspElements
 
void PostDraw()
Clean-up after drawing, nothing to be done here.
 
DrawElementPtrVec_t fTranspElements
 
void ClearAfterRebuild()
Clear DrawElementVector fVisibleElement and optionally resize it so that it doesn't take more space t...
 
Bool_t CmpDrawElements(const DrawElement_t &de1, const DrawElement_t &de2)
 
void ResetDrawStats()
Reset draw statistics.
 
void DumpDrawStats()
Output draw stats to Info stream.
 
~TSceneInfo() override
Destructor.
 
DrawElementVec_t fVisibleElements
 
void PreDraw()
Prepare for drawing - fill DrawElementPtrVectors from the contents of fVisibleElements if there was s...
 
DrawElementPtrVec_t fOpaqueElements
 
ShapeVec_t fShapesOfInterest
 
void ClearDrawElementVec(DrawElementVec_t &vec, Int_t maxSize)
Clear given vec and if it grew too large compared to the size of shape-of-interest also resize it.
 
void UpdateDrawStats(const TGLPhysicalShape &shape, Short_t lod)
Update draw stats, for newly drawn 'shape'.
 
std::map< TClass *, UInt_t > fByShapeCnt
 
DrawElementPtrVec_t fSelOpaqueElements
 
void ClearAfterUpdate()
Clear DrawElementPtrVectors and optionally resize them so that they don't take more space then requir...
 
void Lodify(TGLRnrCtx &ctx)
Quantize LODs for given render-context.
 
void ClearDrawElementPtrVec(DrawElementPtrVec_t &vec, Int_t maxSize)
Clear given vec and if it grew too large compared to the size of shape-of-interest also resize it.
 
TGLScene provides management and rendering of ROOT's default 3D /object representation as logical and...
 
Float_t fLastLineWidthScale
 
void UpdateSceneInfo(TGLRnrCtx &rnrCtx) override
Fill scene-info with information needed for rendering, take into account the render-context (viewer s...
 
std::vector< DrawElement_t > DrawElementVec_t
 
virtual TGLPhysicalShape * FindPhysical(UInt_t phid) const
Find and return physical shape identified by unique 'ID'.
 
std::map< UInt_t, TGLPhysicalShape * > PhysicalShapeMap_t
 
PhysicalShapeMap_t::const_iterator PhysicalShapeMapCIt_t
 
void RenderOpaque(TGLRnrCtx &rnrCtx) override
Render opaque elements.
 
void CalcBoundingBox() const override
Encapsulates all physical shapes bounding box with axes aligned box.
 
virtual void DestroyPhysicalInternal(PhysicalShapeMapIt_t pit)
Virtual function to destroy a physical.
 
void PostDraw(TGLRnrCtx &rnrCtx) override
Called after the rendering is finished.
 
virtual Bool_t BeginUpdate()
Put scene in update mode, return true if lock acquired.
 
virtual void AdoptPhysical(TGLPhysicalShape &shape)
Adopt dynamically created physical 'shape' - add to internal map and take responsibility for deleting...
 
void ReleaseGLCtxIdentity()
Release all GL resources for current context identity.
 
LogicalShapeMap_t::const_iterator LogicalShapeMapCIt_t
 
TGLContextIdentity * GetGLCtxIdentity() const
 
void RebuildSceneInfo(TGLRnrCtx &rnrCtx) override
Major change in scene, need to rebuild all-element draw-vector and sort it.
 
virtual void EndUpdate(Bool_t minorChange=kTRUE, Bool_t sceneChanged=kTRUE, Bool_t updateViewers=kTRUE)
Exit scene update mode.
 
Float_t fLastPointSizeScale
 
static Bool_t ComparePhysicalVolumes(const TGLPhysicalShape *shape1, const TGLPhysicalShape *shape2)
Compare 'shape1' and 'shape2' bounding box volumes - return kTRUE if 'shape1' bigger than 'shape2'.
 
LogicalShapeMap_t fLogicalShapes
 
virtual Int_t DestroyPhysicals()
Destroy physical shapes.
 
virtual void RenderAllPasses(TGLRnrCtx &rnrCtx, DrawElementPtrVec_t &elVec, Bool_t check_timeout)
Do full rendering of scene.
 
virtual void AdoptLogical(TGLLogicalShape &shape)
Adopt dynamically created logical 'shape' - add to internal map and take responsibility for deleting.
 
void LodifySceneInfo(TGLRnrCtx &rnrCtx) override
Setup LOD-dependant values in scene-info.
 
virtual void RenderElements(TGLRnrCtx &rnrCtx, DrawElementPtrVec_t &elVec, Bool_t check_timeout, const TGLPlaneSet_t *clipPlanes=nullptr)
Render DrawElements in elementVec with given timeout.
 
Bool_t ResolveSelectRecord(TGLSelectRecord &rec, Int_t curIdx) override
Process selection record rec.
 
static Bool_t IsOutside(const TGLBoundingBox &box, const TGLPlaneSet_t &planes)
Check if box is outside of all planes.
 
void RenderSelTranspForHighlight(TGLRnrCtx &rnrCtx) override
Render selected transparent elements for highlight.
 
void EndSmartRefresh()
Wipes logicals in refresh-cache.
 
virtual Bool_t DestroyLogical(TObject *logid, Bool_t mustFind=kTRUE)
Destroy logical shape defined by unique 'ID'.
 
std::vector< const TGLPhysicalShape * > ShapeVec_t
 
TGLScene & operator=(const TGLScene &)=delete
 
UInt_t SizeOfScene() const
Return memory cost of scene.
 
PhysicalShapeMap_t::iterator PhysicalShapeMapIt_t
 
LogicalShapeMap_t fSmartRefreshCache
 
TGLScene(const TGLScene &)=delete
 
virtual void RenderHighlight(TGLRnrCtx &rnrCtx, DrawElementPtrVec_t &elVec)
 
PhysicalShapeMap_t fPhysicalShapes
 
std::vector< DrawElement_t >::iterator DrawElementVec_i
 
TSceneInfo * CreateSceneInfo(TGLViewerBase *view) override
Create a scene-info instance appropriate for this scene class.
 
LogicalShapeMap_t::iterator LogicalShapeMapIt_t
 
PhysicalShapeMap_t::value_type PhysicalShapeMapValueType_t
 
LogicalShapeMap_t::value_type LogicalShapeMapValueType_t
 
std::vector< DrawElement_t * > DrawElementPtrVec_t
 
std::map< TObject *, TGLLogicalShape * > LogicalShapeMap_t
 
ShapeVec_t::iterator ShapeVec_i
 
void RenderSelOpaqueForHighlight(TGLRnrCtx &rnrCtx) override
Render selected opaque elements for highlight.
 
virtual void UpdatePhysioLogical(TObject *logid, Double_t *trans, UChar_t *col)
Reposition/recolor physical for given logical (assume TGLObject and a single physical).
 
virtual Bool_t DestroyPhysical(UInt_t phid)
Destroy physical shape defined by unique 'ID'.
 
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).
 
void RenderTransp(TGLRnrCtx &rnrCtx) override
Render transparent elements.
 
virtual Int_t DestroyLogicals()
Destroy all logical shapes in scene.
 
TGLLogicalShape * FindLogicalSmartRefresh(TObject *ID) const
Find and return logical shape identified by unique 'ID' in refresh-cache.
 
~TGLScene() override
Destroy scene objects.
 
LogicalShapeMap_t & RefLogicalShapes()
 
std::vector< DrawElement_t * >::iterator DrawElementPtrVec_i
 
void RenderSelTransp(TGLRnrCtx &rnrCtx) override
Render selected transparent elements.
 
virtual void UpdateLogical(TObject *logid)
Drop display-lists for the logical (assume TGLObject/direct rendering).
 
TGLContextIdentity * fGLCtxIdentity
 
void PreDraw(TGLRnrCtx &rnrCtx) override
Initialize rendering.
 
void DumpMapSizes() const
Print sizes of logical and physical-shape maps.
 
virtual void UpdatePhysical(UInt_t phid, Double_t *trans, UChar_t *col)
Reposition/recolor physical shape.
 
virtual UInt_t GetMaxPhysicalID()
Returns the maximum used physical id.
 
TGLLogicalShape * FindLogical(TObject *logid) const override
Find and return logical shape identified by unique logid.
 
UInt_t BeginSmartRefresh()
Moves logicals that support smart-refresh to intermediate cache.
 
static Bool_t ComparePhysicalDiagonals(const TGLPhysicalShape *shape1, const TGLPhysicalShape *shape2)
Compare 'shape1' and 'shape2' bounding box volumes - return kTRUE if 'shape1' bigger than 'shape2'.
 
void RenderSelOpaque(TGLRnrCtx &rnrCtx) override
Render selected opaque elements.
 
Standard selection record including information about containing scene and details ob out selected ob...
 
Base class for GL viewers.
 
Mother of all ROOT objects.
 
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 
const TGLPhysicalShape * fPhysical
 
DrawElement_t(const TGLPhysicalShape *pshp=nullptr)