12 #ifndef ROOT_TGLSceneBase_H
13 #define ROOT_TGLSceneBase_H
26 class TGLLogicalShape;
27 class TGLSelectRecord;
32 class TGLSceneBase :
public TGLLockable
35 TGLSceneBase(
const TGLSceneBase&);
36 TGLSceneBase& operator=(
const TGLSceneBase&);
38 static UInt_t fgSceneIDSrc;
55 mutable TGLBoundingBox fBoundingBox;
56 mutable Bool_t fBoundingBoxValid;
58 Bool_t fDoFrustumCheck;
62 typedef std::list<TGLViewerBase*> ViewerList_t;
63 typedef std::list<TGLViewerBase*>::iterator ViewerList_i;
65 ViewerList_t fViewers;
73 virtual ~TGLSceneBase();
75 void AddViewer(TGLViewerBase* viewer);
76 void RemoveViewer(TGLViewerBase* viewer);
77 void TagViewersChanged();
79 virtual const char* LockIdStr()
const;
81 virtual const char *GetName()
const {
return fName; }
82 virtual const char *GetTitle()
const {
return fTitle; }
83 virtual void SetName (
const char *name) { fName = name; }
84 virtual void SetTitle(
const char *title) { fTitle = title; }
85 virtual void SetNameTitle(
const char *name,
const char *title) { SetName(name); SetTitle(title); }
87 virtual TGLSceneInfo* CreateSceneInfo(TGLViewerBase* view);
88 virtual void RebuildSceneInfo(TGLRnrCtx& ctx);
89 virtual void UpdateSceneInfo(TGLRnrCtx& ctx);
90 virtual void LodifySceneInfo(TGLRnrCtx& ctx);
93 virtual void PreDraw (TGLRnrCtx& rnrCtx);
94 virtual void PreRender (TGLRnrCtx& rnrCtx);
95 virtual void Render (TGLRnrCtx& rnrCtx);
96 virtual void RenderOpaque (TGLRnrCtx& rnrCtx);
97 virtual void RenderTransp (TGLRnrCtx& rnrCtx);
98 virtual void RenderSelOpaque(TGLRnrCtx& rnrCtx);
99 virtual void RenderSelTransp(TGLRnrCtx& rnrCtx);
100 virtual void RenderSelOpaqueForHighlight(TGLRnrCtx& rnrCtx);
101 virtual void RenderSelTranspForHighlight(TGLRnrCtx& rnrCtx);
102 virtual void PostRender(TGLRnrCtx& rnrCtx);
103 virtual void PostDraw (TGLRnrCtx& rnrCtx);
105 virtual TGLLogicalShape* FindLogical(TObject*)
const {
return 0; }
108 virtual Bool_t ResolveSelectRecord(TGLSelectRecord& rec, Int_t curIdx);
113 UInt_t GetTimeStamp()
const {
return fTimeStamp; }
114 void IncTimeStamp() { ++fTimeStamp; fMinorStamp = 1; }
116 UInt_t GetMinorStamp()
const {
return fMinorStamp; }
117 void IncMinorStamp() { ++fMinorStamp; }
119 Short_t LOD()
const {
return fLOD; }
120 void SetLOD(Short_t lod) { fLOD = lod; }
122 Short_t Style()
const {
return fStyle; }
123 void SetStyle(Short_t st) { fStyle = st; }
125 TGLClip* Clip()
const {
return fClip; }
126 void SetClip(TGLClip *p) { fClip = p; }
128 Bool_t GetSelectable()
const {
return fSelectable; }
129 void SetSelectable(Bool_t a) { fSelectable = a; }
131 Bool_t GetAutoDestruct()
const {
return fAutoDestruct; }
132 void SetAutoDestruct(Bool_t a) { fAutoDestruct = a; }
136 virtual void CalcBoundingBox()
const = 0;
137 void InvalidateBoundingBox() { fBoundingBoxValid = kFALSE; }
138 const TGLBoundingBox& BoundingBox()
const
139 {
if (!fBoundingBoxValid) CalcBoundingBox();
return fBoundingBox; }
142 ClassDef(TGLSceneBase, 0)