#ifndef ROOT_TGLLogicalShape
#define ROOT_TGLLogicalShape
#ifndef ROOT_TGLBoundingBox
#include "TGLBoundingBox.h"
#endif
class TBuffer3D;
class TObject;
class TContextMenu;
class TGLPhysicalShape;
class TGLRnrCtx;
class TGLSelectRecord;
class TGLViewer;
class TGLSceneBase;
class TGLScene;
class TGLLogicalShape
{
friend class TGLScene;
private:
TGLLogicalShape(const TGLLogicalShape&);
TGLLogicalShape& operator=(const TGLLogicalShape&);
public:
enum ELODAxes { kLODAxesNone = 0,
kLODAxesX = 1 << 0,
kLODAxesY = 1 << 1,
kLODAxesZ = 1 << 2,
kLODAxesAll = kLODAxesX | kLODAxesY | kLODAxesZ
};
protected:
mutable UInt_t fRef;
mutable TGLPhysicalShape *fFirstPhysical;
TObject *fExternalObj;
TGLBoundingBox fBoundingBox;
mutable TGLScene *fScene;
mutable UInt_t fDLBase;
mutable Int_t fDLSize;
mutable UShort_t fDLValid;
mutable Bool_t fDLCache;
mutable Bool_t fRefStrong;
mutable Bool_t fOwnExtObj;
void PurgeDLRange(UInt_t base, Int_t size) const;
static Bool_t fgIgnoreSizeForCameraInterest;
public:
TGLLogicalShape();
TGLLogicalShape(TObject* obj);
TGLLogicalShape(const TBuffer3D & buffer);
virtual ~TGLLogicalShape();
UInt_t Ref() const { return fRef; }
void AddRef(TGLPhysicalShape* phys) const;
void SubRef(TGLPhysicalShape* phys) const;
void StrongRef(Bool_t strong) const { fRefStrong = strong; }
void DestroyPhysicals();
UInt_t UnrefFirstPhysical();
const TGLPhysicalShape* GetFirstPhysical() const { return fFirstPhysical; }
TObject* ID() const { return fExternalObj; }
TObject* GetExternal() const { return fExternalObj; }
TGLScene* GetScene() const { return fScene; }
const TGLBoundingBox& BoundingBox() const { return fBoundingBox; }
virtual void UpdateBoundingBox() {}
void UpdateBoundingBoxesOfPhysicals();
Bool_t SetDLCache(Bool_t cached);
virtual Bool_t ShouldDLCache(const TGLRnrCtx & rnrCtx) const;
virtual UInt_t DLOffset(Short_t ) const { return 0; }
virtual void DLCacheClear();
virtual void DLCacheDrop();
virtual void DLCachePurge();
virtual ELODAxes SupportedLODAxes() const { return kLODAxesNone; }
virtual Short_t QuantizeShapeLOD(Short_t shapeLOD, Short_t combiLOD) const;
virtual void Draw(TGLRnrCtx& rnrCtx) const;
virtual void DirectDraw(TGLRnrCtx& rnrCtx) const = 0;
virtual void DrawHighlight(TGLRnrCtx& rnrCtx, const TGLPhysicalShape* pshp, Int_t lvl=-1) const;
virtual Bool_t IgnoreSizeForOfInterest() const;
virtual Bool_t KeepDuringSmartRefresh() const { return kFALSE; }
virtual Bool_t SupportsSecondarySelect() const { return kFALSE; }
virtual Bool_t AlwaysSecondarySelect() const { return kFALSE; }
virtual void ProcessSelection(TGLRnrCtx& rnrCtx, TGLSelectRecord& rec);
void InvokeContextMenu(TContextMenu & menu, UInt_t x, UInt_t y) const;
static Bool_t GetIgnoreSizeForCameraInterest();
static void SetIgnoreSizeForCameraInterest(Bool_t isfci);
ClassDef(TGLLogicalShape,0)
};
#endif // ROOT_TGLLogicalShape