12#ifndef ROOT_TGLScene_H
13#define ROOT_TGLScene_H
#define ClassDef(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.
DrawElementVec_t fVisibleElements
void PreDraw()
Prepare for drawing - fill DrawElementPtrVectors from the contents of fVisibleElements if there was s...
virtual ~TSceneInfo()
Destructor.
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
virtual void RenderSelOpaque(TGLRnrCtx &rnrCtx)
Render selected opaque elements.
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
virtual TSceneInfo * CreateSceneInfo(TGLViewerBase *view)
Create a scene-info instance appropriate for this scene class.
virtual void DestroyPhysicalInternal(PhysicalShapeMapIt_t pit)
Virtual function to destroy a physical.
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
virtual void RenderSelTransp(TGLRnrCtx &rnrCtx)
Render selected transparent elements.
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 void PreDraw(TGLRnrCtx &rnrCtx)
Initialize rendering.
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.
virtual void RenderTransp(TGLRnrCtx &rnrCtx)
Render transparent elements.
virtual void RenderElements(TGLRnrCtx &rnrCtx, DrawElementPtrVec_t &elVec, Bool_t check_timeout, const TGLPlaneSet_t *clipPlanes=nullptr)
Render DrawElements in elementVec with given timeout.
static Bool_t IsOutside(const TGLBoundingBox &box, const TGLPlaneSet_t &planes)
Check if box is outside of all planes.
TGLScene(const TGLScene &)
virtual void PostDraw(TGLRnrCtx &rnrCtx)
Called after the rendering is finished.
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
UInt_t SizeOfScene() const
Return memory cost of scene.
PhysicalShapeMap_t::iterator PhysicalShapeMapIt_t
LogicalShapeMap_t fSmartRefreshCache
virtual void RenderHighlight(TGLRnrCtx &rnrCtx, DrawElementPtrVec_t &elVec)
PhysicalShapeMap_t fPhysicalShapes
std::vector< DrawElement_t >::iterator DrawElementVec_i
LogicalShapeMap_t::iterator LogicalShapeMapIt_t
PhysicalShapeMap_t::value_type PhysicalShapeMapValueType_t
virtual void RenderOpaque(TGLRnrCtx &rnrCtx)
Render opaque elements.
LogicalShapeMap_t::value_type LogicalShapeMapValueType_t
TGLScene & operator=(const TGLScene &)
std::vector< DrawElement_t * > DrawElementPtrVec_t
std::map< TObject *, TGLLogicalShape * > LogicalShapeMap_t
virtual Bool_t ResolveSelectRecord(TGLSelectRecord &rec, Int_t curIdx)
Process selection record rec.
ShapeVec_t::iterator ShapeVec_i
virtual void UpdatePhysioLogical(TObject *logid, Double_t *trans, UChar_t *col)
Reposition/recolor physical for given logical (assume TGLObject and a single physical).
virtual void RenderSelOpaqueForHighlight(TGLRnrCtx &rnrCtx)
Render selected opaque elements for highlight.
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).
virtual void RebuildSceneInfo(TGLRnrCtx &rnrCtx)
Major change in scene, need to rebuild all-element draw-vector and sort it.
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.
virtual void LodifySceneInfo(TGLRnrCtx &rnrCtx)
Setup LOD-dependant values in scene-info.
virtual void UpdateSceneInfo(TGLRnrCtx &rnrCtx)
Fill scene-info with information needed for rendering, take into account the render-context (viewer s...
LogicalShapeMap_t & RefLogicalShapes()
virtual ~TGLScene()
Destroy scene objects.
std::vector< DrawElement_t * >::iterator DrawElementPtrVec_i
virtual void UpdateLogical(TObject *logid)
Drop display-lists for the logical (assume TGLObject/direct rendering).
virtual void RenderSelTranspForHighlight(TGLRnrCtx &rnrCtx)
Render selected transparent elements for highlight.
TGLContextIdentity * fGLCtxIdentity
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 TGLLogicalShape * FindLogical(TObject *logid) const
Find and return logical shape identified by unique logid.
virtual UInt_t GetMaxPhysicalID()
Returns the maximum used physical id.
UInt_t BeginSmartRefresh()
Moves logicals that support smart-refresh to intermediate cache.
virtual void CalcBoundingBox() const
Encapsulates all physical shapes bounding box with axes aligned box.
static Bool_t ComparePhysicalDiagonals(const TGLPhysicalShape *shape1, const TGLPhysicalShape *shape2)
Compare 'shape1' and 'shape2' bounding box volumes - return kTRUE if 'shape1' bigger than 'shape2'.
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)