Warning, file /include/root/TGLSceneInfo.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGLSceneInfo_H
0013 #define ROOT_TGLSceneInfo_H
0014
0015 #include "Rtypes.h"
0016
0017 #include "TGLBoundingBox.h"
0018 #include "TGLUtil.h"
0019 #include <vector>
0020
0021 class TGLViewerBase;
0022 class TGLSceneBase;
0023 class TGLClip;
0024 class TGLRenderContext;
0025 class TGLCamera;
0026
0027 class TGLSceneInfo
0028 {
0029 friend class TGLSceneBase;
0030
0031 public:
0032 enum EClipTest { kClipNone, kClipOutside, kClipInside };
0033
0034 private:
0035 TGLSceneInfo(const TGLSceneInfo&) = delete;
0036 TGLSceneInfo& operator=(const TGLSceneInfo&) = delete;
0037
0038 protected:
0039 TGLViewerBase * fViewer;
0040 TGLSceneBase * fScene;
0041 Bool_t fActive;
0042
0043 Short_t fLOD;
0044 Short_t fStyle;
0045 Float_t fWFLineW;
0046 Float_t fOLLineW;
0047 TGLClip * fClip;
0048
0049 Short_t fLastLOD;
0050 Short_t fLastStyle;
0051 Float_t fLastWFLineW;
0052 Float_t fLastOLLineW;
0053 TGLClip * fLastClip;
0054 TGLCamera * fLastCamera;
0055
0056 UInt_t fSceneStamp;
0057 UInt_t fClipStamp;
0058 UInt_t fCameraStamp;
0059 Bool_t fUpdateTimeouted;
0060
0061
0062
0063
0064
0065
0066 TGLBoundingBox fTransformedBBox;
0067
0068 Bool_t fViewCheck;
0069 Bool_t fInFrustum;
0070 Bool_t fInClip;
0071 Char_t fClipMode;
0072 TGLPlaneSet_t fFrustumPlanes;
0073 TGLPlaneSet_t fClipPlanes;
0074
0075
0076
0077
0078 public:
0079 TGLSceneInfo(TGLViewerBase* view=nullptr, TGLSceneBase* scene=nullptr);
0080 virtual ~TGLSceneInfo() {}
0081
0082 TGLViewerBase * GetViewer() const { return fViewer; }
0083 TGLViewerBase & RefViewer() const { return *fViewer; }
0084 TGLSceneBase * GetScene() const { return fScene; }
0085 TGLSceneBase & RefScene() const { return *fScene; }
0086
0087 Bool_t GetActive() const { return fActive; }
0088 void SetActive(Bool_t a);
0089
0090 void SetupTransformsAndBBox();
0091
0092 const TGLBoundingBox& GetTransformedBBox() { return fTransformedBBox; }
0093
0094 virtual void SetSceneTrans(TGLMatrix&) { ResetSceneStamp(); }
0095
0096 Bool_t ViewCheck() const { return fViewCheck; }
0097 void ViewCheck(Bool_t c) { fViewCheck = c; }
0098 Bool_t IsInFrustum() const { return fInFrustum; }
0099 void InFrustum(Bool_t f) { fInFrustum = f; }
0100 Bool_t IsInClip() const { return fInClip; }
0101 void InClip(Bool_t c) { fInClip = c; }
0102 Char_t ClipMode() const { return fClipMode; }
0103 void ClipMode(Char_t m) { fClipMode = m; }
0104
0105 Bool_t ShouldClip() const { return fClipMode != kClipNone; }
0106 Bool_t IsVisible() const { return fInFrustum && fInClip; }
0107
0108 std::vector<TGLPlane>& FrustumPlanes() { return fFrustumPlanes; }
0109 std::vector<TGLPlane>& ClipPlanes() { return fClipPlanes; }
0110
0111 Short_t LOD() const { return fLOD; }
0112 void SetLOD(Short_t lod) { fLOD = lod; }
0113
0114 Short_t Style() const { return fStyle; }
0115 void SetStyle(Short_t st) { fStyle = st; }
0116
0117 Float_t WFLineW() const { return fWFLineW; }
0118 void SetWFLineW(Float_t w) { fWFLineW = w; }
0119 Float_t OLLineW() const { return fOLLineW; }
0120 void SetOLLineW(Float_t w) { fOLLineW = w; }
0121
0122 TGLClip* Clip() const { return fClip; }
0123 void SetClip(TGLClip *p) { fClip = p; }
0124
0125 Short_t LastLOD() const { return fLastLOD; }
0126 void SetLastLOD(Short_t ld) { fLastLOD = ld; }
0127
0128 Short_t LastStyle() const { return fLastStyle; }
0129 void SetLastStyle(Short_t st) { fLastStyle = st; }
0130
0131 Float_t LastWFLineW() const { return fLastWFLineW; }
0132 void SetLastWFLineW(Float_t w) { fLastWFLineW = w; }
0133 Float_t LastOLLineW() const { return fLastOLLineW; }
0134 void SetLastOLLineW(Float_t w) { fLastOLLineW = w; }
0135
0136 TGLClip* LastClip() const { return fLastClip; }
0137 void SetLastClip(TGLClip *p) { fLastClip = p; }
0138
0139 TGLCamera* LastCamera() const { return fLastCamera; }
0140 void SetLastCamera(TGLCamera *p) { fLastCamera = p; }
0141
0142 UInt_t SceneStamp() const { return fSceneStamp; }
0143 void SetSceneStamp(UInt_t ts) { fSceneStamp = ts; }
0144 void ResetSceneStamp() { fSceneStamp = 0; }
0145
0146 UInt_t ClipStamp() const { return fClipStamp; }
0147 void SetClipStamp(UInt_t ts) { fClipStamp = ts; }
0148 void ResetClipStamp() { fClipStamp = 0; }
0149
0150 UInt_t CameraStamp() const { return fCameraStamp; }
0151 void SetCameraStamp(UInt_t ts) { fCameraStamp = ts; }
0152 void ResetCameraStamp() { fCameraStamp = 0; }
0153
0154 Bool_t HasUpdateTimeouted() const { return fUpdateTimeouted; }
0155 void UpdateTimeouted() { fUpdateTimeouted = kTRUE; }
0156 void ResetUpdateTimeouted() { fUpdateTimeouted = kFALSE; }
0157
0158 ClassDef(TGLSceneInfo, 0)
0159 };
0160
0161
0162 #endif