Logo ROOT  
Reference Guide
TGLSceneInfo.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Matevz Tadel, Feb 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGLSceneInfo_H
13#define ROOT_TGLSceneInfo_H
14
15#include "Rtypes.h"
16
17#include "TGLBoundingBox.h"
18#include "TGLUtil.h"
19
20class TGLViewerBase;
21class TGLSceneBase;
22class TGLClip;
23class TGLRenderContext;
24class TGLCamera;
25
27{
28 friend class TGLSceneBase;
29
30public:
32
33private:
34 TGLSceneInfo(const TGLSceneInfo&); // Not implemented
35 TGLSceneInfo& operator=(const TGLSceneInfo&); // Not implemented
36
37protected:
40 Bool_t fActive; // Show fScene in fViewer
41
42 Short_t fLOD; // Optional override of scene lod
43 Short_t fStyle; // Optional override of scene style
44 Float_t fWFLineW; // Optional override of scene wire-frame line-width
45 Float_t fOLLineW; // Optional override of scene outline line-width
46 TGLClip * fClip; // Optional override of clipping-plane
47
48 Short_t fLastLOD; // Last combined viewer/scene lod (set in scene::lodify-scene-info).
49 Short_t fLastStyle; // Last combined viewer/scene style (set in scene::pre-draw).
50 Float_t fLastWFLineW; // Last combined viewer/scene wire-frame line-width (set in scene::pre-draw).
51 Float_t fLastOLLineW; // Last combined viewer/scene outline line-width (set in scene::pre-draw).
52 TGLClip * fLastClip; // Last combined viewer/scene clip (set in scene::update)
53 TGLCamera * fLastCamera; // Last camera used.
54
55 UInt_t fSceneStamp; // Scene's time-stamp on last update.
56 UInt_t fClipStamp; // Clip's time-stamp on last update.
57 UInt_t fCameraStamp; // Camera's time-stamp on last update.
58 Bool_t fUpdateTimeouted; // Set if update was interrupted.
59
60 // Eventually we will allow additional per-scene transforamtion.
61 // TGLMatrix fSceneTrans;
62 // Also needed:
63 // *) transformed clipping planes of the camera
64 // *) transformed bounding-box of the scene
66
67 Bool_t fViewCheck; // Viewer side check if render is necessary.
68 Bool_t fInFrustum; // Is scene intersecting view-frustum.
69 Bool_t fInClip; // Is scene contained within clipping-volume.
70 Char_t fClipMode; // Clipping mode, can be disbled.
71 TGLPlaneSet_t fFrustumPlanes; // Clipping planes defined by frustum; only those intersecting the scene volume are kept.
72 TGLPlaneSet_t fClipPlanes; // Clipping planes from clip-object; which planes are kept depends on inside/outside mode.
73
74 // Additional stuff (scene-class specific) can be added by sub-classing.
75 // For TGLScene these data include draw-lists after clipping.
76
77public:
78 TGLSceneInfo(TGLViewerBase* view=0, TGLSceneBase* scene=0);
79 virtual ~TGLSceneInfo() {}
80
81 TGLViewerBase * GetViewer() const { return fViewer; }
82 TGLViewerBase & RefViewer() const { return *fViewer; }
83 TGLSceneBase * GetScene() const { return fScene; }
84 TGLSceneBase & RefScene() const { return *fScene; }
85
86 Bool_t GetActive() const { return fActive; }
87 void SetActive(Bool_t a);
88
90
92
94
95 Bool_t ViewCheck() const { return fViewCheck; }
97 Bool_t IsInFrustum() const { return fInFrustum; }
99 Bool_t IsInClip() const { return fInClip; }
100 void InClip(Bool_t c) { fInClip = c; }
101 Char_t ClipMode() const { return fClipMode; }
103
104 Bool_t ShouldClip() const { return fClipMode != kClipNone; }
105 Bool_t IsVisible() const { return fInFrustum && fInClip; }
106
107 std::vector<TGLPlane>& FrustumPlanes() { return fFrustumPlanes; }
108 std::vector<TGLPlane>& ClipPlanes() { return fClipPlanes; }
109
110 Short_t LOD() const { return fLOD; }
111 void SetLOD(Short_t lod) { fLOD = lod; }
112
113 Short_t Style() const { return fStyle; }
114 void SetStyle(Short_t st) { fStyle = st; }
115
116 Float_t WFLineW() const { return fWFLineW; }
117 void SetWFLineW(Float_t w) { fWFLineW = w; }
118 Float_t OLLineW() const { return fOLLineW; }
119 void SetOLLineW(Float_t w) { fOLLineW = w; }
120
121 TGLClip* Clip() const { return fClip; }
122 void SetClip(TGLClip *p) { fClip = p; }
123
124 Short_t LastLOD() const { return fLastLOD; }
125 void SetLastLOD(Short_t ld) { fLastLOD = ld; }
126
127 Short_t LastStyle() const { return fLastStyle; }
128 void SetLastStyle(Short_t st) { fLastStyle = st; }
129
130 Float_t LastWFLineW() const { return fLastWFLineW; }
132 Float_t LastOLLineW() const { return fLastOLLineW; }
134
135 TGLClip* LastClip() const { return fLastClip; }
136 void SetLastClip(TGLClip *p) { fLastClip = p; }
137
138 TGLCamera* LastCamera() const { return fLastCamera; }
140
141 UInt_t SceneStamp() const { return fSceneStamp; }
144
145 UInt_t ClipStamp() const { return fClipStamp; }
146 void SetClipStamp(UInt_t ts) { fClipStamp = ts; }
148
149 UInt_t CameraStamp() const { return fCameraStamp; }
152
156
157 ClassDef(TGLSceneInfo, 0) // Data about a scene within a viewer context.
158}; // endclass TGLSceneInfo
159
160
161#endif
#define f(i)
Definition: RSha256.hxx:104
#define c(i)
Definition: RSha256.hxx:101
char Char_t
Definition: RtypesCore.h:29
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
short Short_t
Definition: RtypesCore.h:35
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
std::vector< TGLPlane > TGLPlaneSet_t
Definition: TGLUtil.h:570
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
Abstract base camera class - concrete classes for orthographic and perspective cameras derive from it...
Definition: TGLCamera.h:44
Abstract clipping shape - derives from TGLPhysicalShape Adds clip mode (inside/outside) and pure virt...
Definition: TGLClip.h:32
16 component (4x4) transform matrix - column MAJOR as per GL.
Definition: TGLUtil.h:597
Scene base-class – provides basic interface expected by the TGLViewer or its sub-classes:
Definition: TGLSceneBase.h:33
Base class for extended scene context.
Definition: TGLSceneInfo.h:27
UInt_t SceneStamp() const
Definition: TGLSceneInfo.h:141
Bool_t IsInClip() const
Definition: TGLSceneInfo.h:99
Short_t fLOD
Definition: TGLSceneInfo.h:42
UInt_t fCameraStamp
Definition: TGLSceneInfo.h:57
Short_t Style() const
Definition: TGLSceneInfo.h:113
Bool_t fViewCheck
Definition: TGLSceneInfo.h:67
UInt_t fClipStamp
Definition: TGLSceneInfo.h:56
void SetOLLineW(Float_t w)
Definition: TGLSceneInfo.h:119
TGLCamera * fLastCamera
Definition: TGLSceneInfo.h:53
TGLViewerBase * GetViewer() const
Definition: TGLSceneInfo.h:81
Bool_t ViewCheck() const
Definition: TGLSceneInfo.h:95
void SetClip(TGLClip *p)
Definition: TGLSceneInfo.h:122
TGLSceneBase & RefScene() const
Definition: TGLSceneInfo.h:84
void SetLastClip(TGLClip *p)
Definition: TGLSceneInfo.h:136
Float_t fLastWFLineW
Definition: TGLSceneInfo.h:50
Float_t fLastOLLineW
Definition: TGLSceneInfo.h:51
void ClipMode(Char_t m)
Definition: TGLSceneInfo.h:102
void ViewCheck(Bool_t c)
Definition: TGLSceneInfo.h:96
Short_t LastStyle() const
Definition: TGLSceneInfo.h:127
Bool_t fActive
Definition: TGLSceneInfo.h:40
void UpdateTimeouted()
Definition: TGLSceneInfo.h:154
Bool_t IsInFrustum() const
Definition: TGLSceneInfo.h:97
void SetLastWFLineW(Float_t w)
Definition: TGLSceneInfo.h:131
TGLSceneBase * fScene
Definition: TGLSceneInfo.h:39
void InClip(Bool_t c)
Definition: TGLSceneInfo.h:100
void ResetClipStamp()
Definition: TGLSceneInfo.h:147
Bool_t fInFrustum
Definition: TGLSceneInfo.h:68
Float_t WFLineW() const
Definition: TGLSceneInfo.h:116
void SetCameraStamp(UInt_t ts)
Definition: TGLSceneInfo.h:150
void SetStyle(Short_t st)
Definition: TGLSceneInfo.h:114
void SetupTransformsAndBBox()
Combine information from scene, scene-info and camera (should be optional) into transformation matric...
TGLPlaneSet_t fClipPlanes
Definition: TGLSceneInfo.h:72
Bool_t ShouldClip() const
Definition: TGLSceneInfo.h:104
TGLClip * LastClip() const
Definition: TGLSceneInfo.h:135
Float_t fOLLineW
Definition: TGLSceneInfo.h:45
TGLClip * fClip
Definition: TGLSceneInfo.h:46
Short_t fLastStyle
Definition: TGLSceneInfo.h:49
Bool_t fInClip
Definition: TGLSceneInfo.h:69
Bool_t GetActive() const
Definition: TGLSceneInfo.h:86
TGLViewerBase & RefViewer() const
Definition: TGLSceneInfo.h:82
void SetLOD(Short_t lod)
Definition: TGLSceneInfo.h:111
TGLClip * Clip() const
Definition: TGLSceneInfo.h:121
Char_t ClipMode() const
Definition: TGLSceneInfo.h:101
const TGLBoundingBox & GetTransformedBBox()
Definition: TGLSceneInfo.h:91
void SetLastLOD(Short_t ld)
Definition: TGLSceneInfo.h:125
virtual void SetSceneTrans(TGLMatrix &)
Definition: TGLSceneInfo.h:93
Short_t LastLOD() const
Definition: TGLSceneInfo.h:124
virtual ~TGLSceneInfo()
Definition: TGLSceneInfo.h:79
TGLBoundingBox fTransformedBBox
Definition: TGLSceneInfo.h:65
void SetActive(Bool_t a)
Set active state of the scene, mark viewer as changed.
UInt_t CameraStamp() const
Definition: TGLSceneInfo.h:149
void ResetCameraStamp()
Definition: TGLSceneInfo.h:151
void SetLastCamera(TGLCamera *p)
Definition: TGLSceneInfo.h:139
void InFrustum(Bool_t f)
Definition: TGLSceneInfo.h:98
TGLSceneInfo & operator=(const TGLSceneInfo &)
TGLClip * fLastClip
Definition: TGLSceneInfo.h:52
Short_t fStyle
Definition: TGLSceneInfo.h:43
Bool_t IsVisible() const
Definition: TGLSceneInfo.h:105
Float_t OLLineW() const
Definition: TGLSceneInfo.h:118
void SetSceneStamp(UInt_t ts)
Definition: TGLSceneInfo.h:142
TGLSceneInfo(const TGLSceneInfo &)
TGLCamera * LastCamera() const
Definition: TGLSceneInfo.h:138
TGLPlaneSet_t fFrustumPlanes
Definition: TGLSceneInfo.h:71
Char_t fClipMode
Definition: TGLSceneInfo.h:70
Float_t LastWFLineW() const
Definition: TGLSceneInfo.h:130
Bool_t HasUpdateTimeouted() const
Definition: TGLSceneInfo.h:153
TGLViewerBase * fViewer
Definition: TGLSceneInfo.h:38
Short_t LOD() const
Definition: TGLSceneInfo.h:110
std::vector< TGLPlane > & ClipPlanes()
Definition: TGLSceneInfo.h:108
void SetLastStyle(Short_t st)
Definition: TGLSceneInfo.h:128
UInt_t fSceneStamp
Definition: TGLSceneInfo.h:55
Float_t LastOLLineW() const
Definition: TGLSceneInfo.h:132
Bool_t fUpdateTimeouted
Definition: TGLSceneInfo.h:58
Float_t fWFLineW
Definition: TGLSceneInfo.h:44
void SetClipStamp(UInt_t ts)
Definition: TGLSceneInfo.h:146
std::vector< TGLPlane > & FrustumPlanes()
Definition: TGLSceneInfo.h:107
void SetWFLineW(Float_t w)
Definition: TGLSceneInfo.h:117
void ResetUpdateTimeouted()
Definition: TGLSceneInfo.h:155
UInt_t ClipStamp() const
Definition: TGLSceneInfo.h:145
TGLSceneBase * GetScene() const
Definition: TGLSceneInfo.h:83
void ResetSceneStamp()
Definition: TGLSceneInfo.h:143
void SetLastOLLineW(Float_t w)
Definition: TGLSceneInfo.h:133
Short_t fLastLOD
Definition: TGLSceneInfo.h:48
Base class for GL viewers.
Definition: TGLViewerBase.h:37
auto * m
Definition: textangle.C:8
auto * a
Definition: textangle.C:12