File indexing completed on 2025-01-18 10:12:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGLLogicalShape
0013 #define ROOT_TGLLogicalShape
0014
0015 #include "TGLBoundingBox.h"
0016
0017 class TBuffer3D;
0018 class TObject;
0019 class TContextMenu;
0020
0021 class TGLPhysicalShape;
0022 class TGLRnrCtx;
0023 class TGLSelectRecord;
0024 class TGLViewer;
0025 class TGLSceneBase;
0026 class TGLScene;
0027
0028
0029 class TGLLogicalShape
0030 {
0031 friend class TGLScene;
0032
0033 private:
0034 TGLLogicalShape(const TGLLogicalShape&) = delete;
0035 TGLLogicalShape& operator=(const TGLLogicalShape&) = delete;
0036
0037 public:
0038 enum ELODAxes { kLODAxesNone = 0,
0039 kLODAxesX = 1 << 0,
0040 kLODAxesY = 1 << 1,
0041 kLODAxesZ = 1 << 2,
0042 kLODAxesAll = kLODAxesX | kLODAxesY | kLODAxesZ
0043 };
0044
0045 protected:
0046 mutable UInt_t fRef;
0047 mutable TGLPhysicalShape *fFirstPhysical;
0048
0049 TObject *fExternalObj;
0050 TGLBoundingBox fBoundingBox;
0051 mutable TGLScene *fScene;
0052 mutable UInt_t fDLBase;
0053 mutable Int_t fDLSize;
0054 mutable UShort_t fDLValid;
0055 mutable Bool_t fDLCache;
0056 mutable Bool_t fRefStrong;
0057 mutable Bool_t fOwnExtObj;
0058
0059 void PurgeDLRange(UInt_t base, Int_t size) const;
0060
0061 static Bool_t fgIgnoreSizeForCameraInterest;
0062
0063 static Bool_t fgUseDLs;
0064 static Bool_t fgUseDLsForVertArrs;
0065
0066 public:
0067 TGLLogicalShape();
0068 TGLLogicalShape(TObject* obj);
0069 TGLLogicalShape(const TBuffer3D & buffer);
0070 virtual ~TGLLogicalShape();
0071
0072
0073 UInt_t Ref() const { return fRef; }
0074 void AddRef(TGLPhysicalShape* phys) const;
0075 void SubRef(TGLPhysicalShape* phys) const;
0076 void StrongRef(Bool_t strong) const { fRefStrong = strong; }
0077 void DestroyPhysicals();
0078 UInt_t UnrefFirstPhysical();
0079
0080 const TGLPhysicalShape* GetFirstPhysical() const { return fFirstPhysical; }
0081
0082 TObject* ID() const { return fExternalObj; }
0083 TObject* GetExternal() const { return fExternalObj; }
0084 TGLScene* GetScene() const { return fScene; }
0085
0086 const TGLBoundingBox& BoundingBox() const { return fBoundingBox; }
0087 virtual void UpdateBoundingBox() {}
0088 void UpdateBoundingBoxesOfPhysicals();
0089
0090
0091 Bool_t SetDLCache(Bool_t cached);
0092 virtual Bool_t ShouldDLCache(const TGLRnrCtx & rnrCtx) const;
0093 virtual UInt_t DLOffset(Short_t ) const { return 0; }
0094 virtual void DLCacheClear();
0095 virtual void DLCacheDrop();
0096 virtual void DLCachePurge();
0097
0098 virtual ELODAxes SupportedLODAxes() const { return kLODAxesNone; }
0099 virtual Short_t QuantizeShapeLOD(Short_t shapeLOD, Short_t combiLOD) const;
0100 virtual void Draw(TGLRnrCtx& rnrCtx) const;
0101 virtual void DirectDraw(TGLRnrCtx& rnrCtx) const = 0;
0102
0103 virtual void DrawHighlight(TGLRnrCtx& rnrCtx, const TGLPhysicalShape* pshp, Int_t lvl=-1) const;
0104
0105 virtual Bool_t IgnoreSizeForOfInterest() const;
0106
0107
0108 virtual Bool_t KeepDuringSmartRefresh() const { return kFALSE; }
0109
0110 virtual Bool_t SupportsSecondarySelect() const { return kFALSE; }
0111 virtual Bool_t AlwaysSecondarySelect() const { return kFALSE; }
0112 virtual void ProcessSelection(TGLRnrCtx& rnrCtx, TGLSelectRecord& rec);
0113
0114 void InvokeContextMenu(TContextMenu & menu, UInt_t x, UInt_t y) const;
0115
0116 static Bool_t GetIgnoreSizeForCameraInterest();
0117 static void SetIgnoreSizeForCameraInterest(Bool_t isfci);
0118
0119 static void SetEnvDefaults();
0120
0121 ClassDef(TGLLogicalShape,0)
0122 };
0123
0124
0125 #endif