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