Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
MultiView.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_eve
3/// Multi-view (3d, rphi, rhoz) service class using EVE Window Manager.
4/// Used together with alice_esd.C macro
5///
6/// \macro_code
7///
8/// \author Matevz Tadel
9
10#include <TEveManager.h>
11
12#include <TEveViewer.h>
13#include <TGLViewer.h>
14
15#include <TEveScene.h>
16
18#include <TEveProjectionAxes.h>
19
20#include <TEveBrowser.h>
21#include <TEveWindow.h>
22
23// MultiView
24//
25// Structure encapsulating standard views: 3D, r-phi and rho-z.
26// Includes scenes and projection managers.
27//
28// Should be used in compiled mode.
29
30struct MultiView {
33
37
42
43 //---------------------------------------------------------------------------
44
45 MultiView()
46 {
47 // Constructor --- creates required scenes, projection managers
48 // and GL viewers.
49
50 // Scenes
51 //========
52
53 fRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry",
54 "Scene holding projected geometry for the RPhi view.");
55 fRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry",
56 "Scene holding projected geometry for the RhoZ view.");
57 fRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",
58 "Scene holding projected event-data for the RPhi view.");
59 fRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",
60 "Scene holding projected event-data for the RhoZ view.");
61
62
63 // Projection managers
64 //=====================
65
68 {
70 a->SetMainColor(kWhite);
71 a->SetTitle("R-Phi");
72 a->SetTitleSize(0.05);
73 a->SetTitleFont(102);
74 a->SetLabelSize(0.025);
75 a->SetLabelFont(102);
76 fRPhiGeomScene->AddElement(a);
77 }
78
81 {
83 a->SetMainColor(kWhite);
84 a->SetTitle("Rho-Z");
85 a->SetTitleSize(0.05);
86 a->SetTitleFont(102);
87 a->SetLabelSize(0.025);
88 a->SetLabelFont(102);
89 fRhoZGeomScene->AddElement(a);
90 }
91
92
93 // Viewers
94 //=========
95
96 TEveWindowSlot *slot = nullptr;
97 TEveWindowPack *pack = nullptr;
98
100 pack = slot->MakePack();
101 pack->SetElementName("Multi View");
102 pack->SetHorizontal();
103 pack->SetShowTitleBar(kFALSE);
104 pack->NewSlot()->MakeCurrent();
105 f3DView = gEve->SpawnNewViewer("3D View", "");
106 f3DView->AddScene(gEve->GetGlobalScene());
107 f3DView->AddScene(gEve->GetEventScene());
108
109 pack = pack->NewSlot()->MakePack();
110 pack->SetShowTitleBar(kFALSE);
111 pack->NewSlot()->MakeCurrent();
112 fRPhiView = gEve->SpawnNewViewer("RPhi View", "");
113 fRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
114 fRPhiView->AddScene(fRPhiGeomScene);
115 fRPhiView->AddScene(fRPhiEventScene);
116
117 pack->NewSlot()->MakeCurrent();
118 fRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
119 fRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
120 fRhoZView->AddScene(fRhoZGeomScene);
121 fRhoZView->AddScene(fRhoZEventScene);
122 }
123
124 //---------------------------------------------------------------------------
125
126 void SetDepth(Float_t d)
127 {
128 // Set current depth on all projection managers.
129
130 fRPhiMgr->SetCurrentDepth(d);
131 fRhoZMgr->SetCurrentDepth(d);
132 }
133
134 //---------------------------------------------------------------------------
135
137 {
138 fRPhiMgr->ImportElements(el, fRPhiGeomScene);
139 }
140
142 {
143 fRhoZMgr->ImportElements(el, fRhoZGeomScene);
144 }
145
147 {
148 fRPhiMgr->ImportElements(el, fRPhiEventScene);
149 }
150
152 {
153 fRhoZMgr->ImportElements(el, fRhoZEventScene);
154 }
155
156 //---------------------------------------------------------------------------
157
158 void DestroyEventRPhi()
159 {
160 fRPhiEventScene->DestroyElements();
161 }
162
163 void DestroyEventRhoZ()
164 {
165 fRhoZEventScene->DestroyElements();
166 }
167};
168
#define d(i)
Definition RSha256.hxx:102
#define a(i)
Definition RSha256.hxx:99
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
@ kWhite
Definition Rtypes.h:65
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TEveManager * gEve
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
TEveScene * GetGlobalScene() const
TEveBrowser * GetBrowser() const
TEveViewer * SpawnNewViewer(const char *name, const char *title="", Bool_t embed=kTRUE)
Create a new GL viewer.
TGListTreeItem * AddToListTree(TEveElement *re, Bool_t open, TGListTree *lt=nullptr)
TEveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
TEveScene * GetEventScene() const
Axes for non-linear projections.
Manager class for steering of projections and managing projected objects.
Eve representation of TGLScene.
Definition TEveScene.h:27
Eve representation of TGLViewer.
Definition TEveViewer.h:31
Encapsulates TGPack into an eve-window.
Definition TEveWindow.h:361
Description of TEveWindowSlot.
Definition TEveWindow.h:302
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=nullptr)
Create a new tab in a given tab-widget and populate it with a default window-slot.
@ kCameraOrthoXOY
Definition TGLViewer.h:62
TGTab * GetTabRight() const