forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiView.C
More file actions
167 lines (133 loc) · 4.71 KB
/
MultiView.C
File metadata and controls
167 lines (133 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/// \file
/// \ingroup tutorial_eve
/// Multi-view (3d, rphi, rhoz) service class using EVE Window Manager.
///
/// \macro_code
///
/// \author Matevz Tadel
#include <TEveManager.h>
#include <TEveViewer.h>
#include <TGLViewer.h>
#include <TEveScene.h>
#include <TEveProjectionManager.h>
#include <TEveProjectionAxes.h>
#include <TEveBrowser.h>
#include <TEveWindow.h>
// MultiView
//
// Structure encapsulating standard views: 3D, r-phi and rho-z.
// Includes scenes and projection managers.
//
// Should be used in compiled mode.
struct MultiView
{
TEveProjectionManager *fRPhiMgr;
TEveProjectionManager *fRhoZMgr;
TEveViewer *f3DView;
TEveViewer *fRPhiView;
TEveViewer *fRhoZView;
TEveScene *fRPhiGeomScene;
TEveScene *fRhoZGeomScene;
TEveScene *fRPhiEventScene;
TEveScene *fRhoZEventScene;
//---------------------------------------------------------------------------
MultiView()
{
// Constructor --- creates required scenes, projection managers
// and GL viewers.
// Scenes
//========
fRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry",
"Scene holding projected geometry for the RPhi view.");
fRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry",
"Scene holding projected geometry for the RhoZ view.");
fRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",
"Scene holding projected event-data for the RPhi view.");
fRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",
"Scene holding projected event-data for the RhoZ view.");
// Projection managers
//=====================
fRPhiMgr = new TEveProjectionManager(TEveProjection::kPT_RPhi);
gEve->AddToListTree(fRPhiMgr, kFALSE);
{
TEveProjectionAxes* a = new TEveProjectionAxes(fRPhiMgr);
a->SetMainColor(kWhite);
a->SetTitle("R-Phi");
a->SetTitleSize(0.05);
a->SetTitleFont(102);
a->SetLabelSize(0.025);
a->SetLabelFont(102);
fRPhiGeomScene->AddElement(a);
}
fRhoZMgr = new TEveProjectionManager(TEveProjection::kPT_RhoZ);
gEve->AddToListTree(fRhoZMgr, kFALSE);
{
TEveProjectionAxes* a = new TEveProjectionAxes(fRhoZMgr);
a->SetMainColor(kWhite);
a->SetTitle("Rho-Z");
a->SetTitleSize(0.05);
a->SetTitleFont(102);
a->SetLabelSize(0.025);
a->SetLabelFont(102);
fRhoZGeomScene->AddElement(a);
}
// Viewers
//=========
TEveWindowSlot *slot = 0;
TEveWindowPack *pack = 0;
slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());
pack = slot->MakePack();
pack->SetElementName("Multi View");
pack->SetHorizontal();
pack->SetShowTitleBar(kFALSE);
pack->NewSlot()->MakeCurrent();
f3DView = gEve->SpawnNewViewer("3D View", "");
f3DView->AddScene(gEve->GetGlobalScene());
f3DView->AddScene(gEve->GetEventScene());
pack = pack->NewSlot()->MakePack();
pack->SetShowTitleBar(kFALSE);
pack->NewSlot()->MakeCurrent();
fRPhiView = gEve->SpawnNewViewer("RPhi View", "");
fRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
fRPhiView->AddScene(fRPhiGeomScene);
fRPhiView->AddScene(fRPhiEventScene);
pack->NewSlot()->MakeCurrent();
fRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
fRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
fRhoZView->AddScene(fRhoZGeomScene);
fRhoZView->AddScene(fRhoZEventScene);
}
//---------------------------------------------------------------------------
void SetDepth(Float_t d)
{
// Set current depth on all projection managers.
fRPhiMgr->SetCurrentDepth(d);
fRhoZMgr->SetCurrentDepth(d);
}
//---------------------------------------------------------------------------
void ImportGeomRPhi(TEveElement* el)
{
fRPhiMgr->ImportElements(el, fRPhiGeomScene);
}
void ImportGeomRhoZ(TEveElement* el)
{
fRhoZMgr->ImportElements(el, fRhoZGeomScene);
}
void ImportEventRPhi(TEveElement* el)
{
fRPhiMgr->ImportElements(el, fRPhiEventScene);
}
void ImportEventRhoZ(TEveElement* el)
{
fRhoZMgr->ImportElements(el, fRhoZEventScene);
}
//---------------------------------------------------------------------------
void DestroyEventRPhi()
{
fRPhiEventScene->DestroyElements();
}
void DestroyEventRhoZ()
{
fRhoZEventScene->DestroyElements();
}
};