2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #if !defined(__CINT__) || defined(__MAKECINT__)
12 #include <TGLViewer.h>
13 #include <TEveManager.h>
14 #include <TEveElement.h>
15 #include <TEveGeoShape.h>
16 #include <TEveGeoShapeExtract.h>
18 #include <AliEveEventManager.h>
19 #include <AliEveMultiView.h>
22 void geom_gentle_transparentdark(Bool_t register_as_global=kTRUE)
29 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_geo.root");
30 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
31 gsre1 = TEveGeoShape::ImportShapeExtract(gse);
34 if (register_as_global)
36 gEve->AddGlobalElement(gsre1);
39 //======================================
41 // Fix visibility, color and transparency
43 gsre1->SetRnrSelf(kFALSE);
44 TEveElement::List_i i = gsre1->BeginChildren();
48 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
49 lvl1->SetRnrSelf(kFALSE);
50 TEveElement::List_i j = lvl1->BeginChildren();
52 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
53 lvl2->SetRnrSelf(kFALSE);
54 TEveElement::List_i k = lvl2->BeginChildren();
56 TEveGeoShape* its1 = (TEveGeoShape*) *k;
57 its1->SetRnrSelf(kTRUE);
58 its1->SetMainColor(0);
59 its1->SetMainTransparency(80);
62 TEveGeoShape* its2 = (TEveGeoShape*) *k;
63 its2->SetRnrSelf(kTRUE);
64 its2->SetMainColor(0);
65 its2->SetMainTransparency(80);
68 TEveGeoShape* its3 = (TEveGeoShape*) *k;
69 its3->SetRnrSelf(kTRUE);
70 its3->SetMainColor(0);
71 its3->SetMainTransparency(80);
77 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
78 lvl1->SetRnrSelf(kFALSE);
79 TEveElement::List_i j = lvl1->BeginChildren();
81 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
82 lvl2->SetRnrSelf(kFALSE);
83 TEveElement::List_i k = lvl2->BeginChildren();
85 TEveGeoShape* lvl3 = (TEveGeoShape*) *k;
86 lvl3->SetRnrSelf(kTRUE);
87 lvl3->SetMainColor(0);
88 lvl3->SetMainTransparency(80);
89 TEveElement::List_i l = lvl3->BeginChildren();
91 TEveGeoShape* lvl4 = (TEveGeoShape*) *l;
92 lvl4->SetRnrSelf(kFALSE);
93 TEveElement::List_i m = lvl4->BeginChildren();
95 TEveGeoShape* tpc1 = (TEveGeoShape*) *m;
96 tpc1->SetRnrSelf(kTRUE);
97 tpc1->SetMainColor(0);
98 tpc1->SetMainTransparency(80);
101 TEveGeoShape* tpc2 = (TEveGeoShape*) *m;
102 tpc2->SetMainColor(kGray);
103 tpc2->SetMainColor(0);
104 tpc2->SetMainTransparency(80);
107 TEveGeoShape* tpc3 = (TEveGeoShape*) *m;
108 tpc3->SetRnrSelf(kTRUE);
109 tpc3->SetMainColor(0);
110 tpc3->SetMainTransparency(80);
117 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
118 lvl1->SetRnrSelf(kFALSE);
119 TEveElement::List_i j = lvl1->BeginChildren();
121 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
122 lvl2->SetRnrSelf(kTRUE);
123 lvl2->SetMainColor(0);
124 lvl2->SetMainTransparency(80);
127 TEveGeoShape* lvl3 = (TEveGeoShape*) *j;
128 lvl3->SetRnrSelf(kTRUE);
129 lvl3->SetMainColor(0);
130 lvl3->SetMainTransparency(80);
136 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
137 lvl1->SetRnrSelf(kFALSE);
138 // TEveElement::List_i j = lvl1->BeginChildren();
140 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
142 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
143 lvl2->SetRnrSelf(kTRUE);
144 lvl2->SetMainColor(0);
145 lvl2->SetMainTransparency(80);
152 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
153 lvl1->SetRnrSelf(kFALSE);
154 // TEveElement::List_i j = lvl1->BeginChildren();
156 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
158 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
159 lvl2->SetRnrSelf(kTRUE);
160 lvl2->SetMainColor(0);
161 lvl2->SetMainTransparency(80);
166 //======================================
168 // The resulting geometry is NOT added into the global scene!
170 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
171 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
172 gsre2 = TEveGeoShape::ImportShapeExtract(gse);
175 // Fix visibility, color and transparency
177 gsre2->SetRnrSelf(kFALSE);
178 TEveElement::List_i i = gsre2->BeginChildren();
182 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
183 lvl1->SetRnrSelf(kFALSE);
184 TEveElement::List_i j = lvl1->BeginChildren();
186 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
187 lvl2->SetRnrSelf(kFALSE);
188 TEveElement::List_i k = lvl2->BeginChildren();
190 TEveGeoShape* its1 = (TEveGeoShape*) *k;
191 its1->SetRnrSelf(kTRUE);
192 its1->SetMainColor(0);
193 its1->SetMainTransparency(80);
197 TEveGeoShape* its2 = (TEveGeoShape*) *k;
198 its2->SetRnrSelf(kTRUE);
199 its2->SetMainColor(0);
200 its2->SetMainTransparency(80);
203 TEveGeoShape* its3 = (TEveGeoShape*) *k;
204 its3->SetRnrSelf(kTRUE);
205 its3->SetMainColor(0);
206 its3->SetMainTransparency(80);
212 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
213 lvl1->SetRnrSelf(kFALSE);
214 // TEveElement::List_i j = lvl1->BeginChildren();
216 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
218 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
219 lvl2->SetRnrSelf(kTRUE);
220 lvl2->SetMainColor(0);
221 lvl2->SetMainTransparency(80);
229 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
230 lvl1->SetRnrSelf(kFALSE);
231 // TEveElement::List_i j = lvl1->BeginChildren();
233 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
235 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
236 lvl2->SetRnrSelf(kTRUE);
237 lvl2->SetMainColor(0);
238 lvl2->SetMainTransparency(80);
246 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
247 lvl1->SetRnrSelf(kFALSE);
248 // TEveElement::List_i j = lvl1->BeginChildren();
250 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
252 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
253 lvl2->SetRnrSelf(kTRUE);
254 lvl2->SetMainColor(0);
255 lvl2->SetMainTransparency(80);
259 //======================================
261 // The resulting geometry is NOT added into the global scene!
263 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
264 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
265 gsre3 = TEveGeoShape::ImportShapeExtract(gse);
268 // Fix visibility, color and transparency
270 gsre3->SetRnrSelf(kFALSE);
271 TEveElement::List_i i = gsre3->BeginChildren();
275 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
276 lvl1->SetRnrSelf(kFALSE);
277 TEveElement::List_i j = lvl1->BeginChildren();
279 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
280 lvl2->SetRnrSelf(kFALSE);
281 TEveElement::List_i k = lvl2->BeginChildren();
283 TEveGeoShape* its1 = (TEveGeoShape*) *k;
284 its1->SetRnrSelf(kTRUE);
285 its1->SetMainColor(0);
288 TEveGeoShape* its2 = (TEveGeoShape*) *k;
289 its2->SetRnrSelf(kTRUE);
290 its2->SetMainColor(0);
293 TEveGeoShape* its3 = (TEveGeoShape*) *k;
294 its3->SetRnrSelf(kTRUE);
295 its3->SetMainColor(0);
301 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
302 lvl1->SetRnrSelf(kFALSE);
303 // TEveElement::List_i j = lvl1->BeginChildren();
305 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
307 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
308 lvl2->SetRnrSelf(kTRUE);
309 lvl2->SetMainColor(0);
310 lvl2->SetMainTransparency(80);
319 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
320 lvl1->SetRnrSelf(kFALSE);
321 // TEveElement::List_i j = lvl1->BeginChildren();
323 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
325 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
326 lvl2->SetRnrSelf(kTRUE);
327 lvl2->SetMainColor(0);
328 lvl2->SetMainTransparency(80);
335 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
336 lvl1->SetRnrSelf(kFALSE);
337 // TEveElement::List_i j = lvl1->BeginChildren();
339 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
341 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
342 lvl2->SetRnrSelf(kTRUE);
343 lvl2->SetMainColor(0);
344 lvl2->SetMainTransparency(80);
349 TEveElement* top = gEve->GetCurrentEvent();
351 AliEveMultiView *mv = AliEveMultiView::Instance();
353 mv->InitGeomGentle(gsre1, gsre2, gsre3, 0);
355 gEve->FullRedraw3D(kTRUE, kTRUE);