Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TGLSceneInfo.cxx
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#include "TGLSceneInfo.h"
13#include "TGLRnrCtx.h"
14#include "TGLSceneBase.h"
15#include "TGLViewerBase.h"
16
17/** \class TGLSceneInfo
18\ingroup opengl
19Base class for extended scene context.
20
21Scenes can be shared among several viewers and each scene needs to
22cache some viewer/camera/clipping specific state => this is a
23storage class for this data.
24
25Sub-classes of TGLSceneBase can override the virtual
26CreateSceneInfo() method and in it instantiate a sub-class of
27TGLSceneInfo containing the needed information. See TGLScene and
28inner class SceneInfo; note that some casting is needed in actual
29methods as TGLRnrCtx holds the base-class pointer.
30*/
31
32
33////////////////////////////////////////////////////////////////////////////////
34
36 fViewer (view),
37 fScene (scene),
38 fActive (kTRUE),
39
40 fLOD (TGLRnrCtx::kLODUndef),
41 fStyle (TGLRnrCtx::kStyleUndef),
42 fWFLineW (0),
43 fOLLineW (0),
44 fClip (nullptr),
45
46 fLastLOD (TGLRnrCtx::kLODUndef),
47 fLastStyle (TGLRnrCtx::kStyleUndef),
48 fLastWFLineW (0),
49 fLastOLLineW (0),
50 fLastClip (nullptr),
51 fLastCamera(nullptr),
52
53 fSceneStamp (0),
54 fClipStamp (0),
55 fCameraStamp(0),
57
60 fInClip (kTRUE),
62{
63 // Default constructor.
64}
65
66////////////////////////////////////////////////////////////////////////////////
67/// Set active state of the scene, mark viewer as changed.
68
70{
71 if (a != fActive)
72 {
73 fActive = a;
74 fViewer->Changed();
75 }
76}
77
78////////////////////////////////////////////////////////////////////////////////
79/// Combine information from scene, scene-info and camera (should be
80/// optional) into transformation matrices.
81///
82/// Transform scene bounding box using this transformation.
83
85{
86 // !!! Transforms not implemented yet, just copy the scene bounding
87 // box.
88
89 fTransformedBBox = fScene->BoundingBox();
90}
#define a(i)
Definition RSha256.hxx:99
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition TGLRnrCtx.h:41
UInt_t fCameraStamp
Bool_t fViewCheck
UInt_t fClipStamp
TGLCamera * fLastCamera
Float_t fLastWFLineW
Float_t fLastOLLineW
TGLSceneBase * fScene
Bool_t fInFrustum
void SetupTransformsAndBBox()
Combine information from scene, scene-info and camera (should be optional) into transformation matric...
Float_t fOLLineW
TGLClip * fClip
Short_t fLastStyle
friend class TGLSceneBase
TGLBoundingBox fTransformedBBox
void SetActive(Bool_t a)
Set active state of the scene, mark viewer as changed.
TGLClip * fLastClip
Short_t fStyle
Char_t fClipMode
TGLViewerBase * fViewer
UInt_t fSceneStamp
Bool_t fUpdateTimeouted
Float_t fWFLineW
Short_t fLastLOD
TGLSceneInfo(const TGLSceneInfo &)=delete
Base class for GL viewers.