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_yellow(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 // Fix visibility, color and transparency
41 gsre1->SetRnrSelf(kFALSE);
42 TEveElement::List_i i = gsre1->BeginChildren();
46 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
47 lvl1->SetRnrSelf(kFALSE);
48 TEveElement::List_i j = lvl1->BeginChildren();
50 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
51 lvl2->SetRnrSelf(kFALSE);
52 TEveElement::List_i k = lvl2->BeginChildren();
54 TEveGeoShape* its1 = (TEveGeoShape*) *k;
55 its1->SetRnrSelf(kTRUE);
56 its1->SetMainColor(kYellow-4);
57 its1->SetMainTransparency(50);
60 TEveGeoShape* its2 = (TEveGeoShape*) *k;
61 its2->SetRnrSelf(kTRUE);
62 its2->SetMainColor(kYellow-7);
63 its2->SetMainTransparency(50);
66 TEveGeoShape* its3 = (TEveGeoShape*) *k;
67 its3->SetRnrSelf(kTRUE);
68 its3->SetMainColor(kYellow-9);
69 its3->SetMainTransparency(50);
75 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
76 lvl1->SetRnrSelf(kFALSE);
77 TEveElement::List_i j = lvl1->BeginChildren();
79 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
80 lvl2->SetRnrSelf(kFALSE);
81 TEveElement::List_i k = lvl2->BeginChildren();
83 TEveGeoShape* lvl3 = (TEveGeoShape*) *k;
84 lvl3->SetRnrSelf(kTRUE);
85 lvl3->SetMainColor(kGray);
86 lvl3->SetMainTransparency(80);
87 TEveElement::List_i l = lvl3->BeginChildren();
89 TEveGeoShape* lvl4 = (TEveGeoShape*) *l;
90 lvl4->SetRnrSelf(kFALSE);
91 TEveElement::List_i m = lvl4->BeginChildren();
93 TEveGeoShape* tpc1 = (TEveGeoShape*) *m;
94 tpc1->SetRnrSelf(kTRUE);
95 tpc1->SetMainColor(kGray+2);
96 tpc1->SetMainTransparency(80);
99 TEveGeoShape* tpc2 = (TEveGeoShape*) *m;
100 tpc2->SetMainColor(kGray);
101 tpc2->SetMainColor(kGray+2);
102 tpc2->SetMainTransparency(80);
105 TEveGeoShape* tpc3 = (TEveGeoShape*) *m;
106 tpc3->SetRnrSelf(kTRUE);
107 tpc3->SetMainColor(kGray+2);
108 tpc3->SetMainTransparency(80);
115 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
116 lvl1->SetRnrSelf(kFALSE);
118 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
120 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
121 lvl2->SetRnrSelf(kFALSE);
122 lvl2->SetMainColor(0);
123 lvl2->SetMainTransparency(80);
131 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
132 lvl1->SetRnrSelf(kFALSE);
134 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
136 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
137 lvl2->SetRnrSelf(kTRUE);
138 lvl2->SetMainTransparency(30);
145 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
146 lvl1->SetRnrSelf(kFALSE);
148 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); ++j)
150 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
151 lvl2->SetRnrSelf(kTRUE);
152 lvl2->SetMainTransparency(30);
156 // The resulting geometry is NOT added into the global scene!
158 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rphi_geo.root");
159 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
160 gsre2 = TEveGeoShape::ImportShapeExtract(gse);
163 // Fix visibility, color and transparency
165 gsre2->SetRnrSelf(kFALSE);
166 TEveElement::List_i i = gsre2->BeginChildren();
170 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
171 lvl1->SetRnrSelf(kFALSE);
172 TEveElement::List_i j = lvl1->BeginChildren();
174 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
175 lvl2->SetRnrSelf(kFALSE);
176 TEveElement::List_i k = lvl2->BeginChildren();
178 TEveGeoShape* its1 = (TEveGeoShape*) *k;
179 its1->SetRnrSelf(kTRUE);
180 its1->SetMainColor(kYellow-4);
181 its1->SetMainTransparency(50);
185 TEveGeoShape* its2 = (TEveGeoShape*) *k;
186 its2->SetRnrSelf(kTRUE);
187 its2->SetMainColor(kYellow-7);
188 its2->SetMainTransparency(50);
191 TEveGeoShape* its3 = (TEveGeoShape*) *k;
192 its3->SetRnrSelf(kTRUE);
193 its3->SetMainColor(kYellow-9);
194 its3->SetMainTransparency(50);
200 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
201 lvl1->SetRnrSelf(kFALSE);
203 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
205 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
206 lvl2->SetRnrSelf(kTRUE);
207 lvl2->SetMainColor(kGray);
208 lvl2->SetMainTransparency(80);
217 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
218 lvl1->SetRnrSelf(kFALSE);
220 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
222 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
223 lvl2->SetRnrSelf(kTRUE);
224 lvl2->SetMainTransparency(30);
232 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
233 lvl1->SetRnrSelf(kFALSE);
235 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
237 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
238 lvl2->SetRnrSelf(kTRUE);
239 lvl2->SetMainTransparency(30);
244 // The resulting geometry is NOT added into the global scene!
246 TFile f("$ALICE_ROOT/EVE/alice-data/gentle_rhoz_geo.root");
247 TEveGeoShapeExtract* gse = (TEveGeoShapeExtract*) f.Get("Gentle");
248 gsre3 = TEveGeoShape::ImportShapeExtract(gse);
251 // Fix visibility, color and transparency
253 gsre3->SetRnrSelf(kFALSE);
254 TEveElement::List_i i = gsre3->BeginChildren();
258 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
259 lvl1->SetRnrSelf(kFALSE);
260 TEveElement::List_i j = lvl1->BeginChildren();
262 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
263 lvl2->SetRnrSelf(kFALSE);
264 TEveElement::List_i k = lvl2->BeginChildren();
266 TEveGeoShape* its1 = (TEveGeoShape*) *k;
267 its1->SetRnrSelf(kTRUE);
268 its1->SetMainColor(kYellow-4);
271 TEveGeoShape* its2 = (TEveGeoShape*) *k;
272 its2->SetRnrSelf(kTRUE);
273 its2->SetMainColor(kYellow-7);
276 TEveGeoShape* its3 = (TEveGeoShape*) *k;
277 its3->SetRnrSelf(kTRUE);
278 its3->SetMainColor(kYellow-9);
284 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
285 lvl1->SetRnrSelf(kFALSE);
287 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
289 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
290 lvl2->SetRnrSelf(kTRUE);
291 lvl2->SetMainColor(kGray);
292 lvl2->SetMainTransparency(80);
302 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
303 lvl1->SetRnrSelf(kFALSE);
305 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
307 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
308 lvl2->SetRnrSelf(kTRUE);
309 lvl2->SetMainTransparency(30);
316 TEveGeoShape* lvl1 = (TEveGeoShape*) *i;
317 lvl1->SetRnrSelf(kFALSE);
319 for (TEveElement::List_i j = lvl1->BeginChildren(); j != lvl1->EndChildren(); j++)
321 TEveGeoShape* lvl2 = (TEveGeoShape*) *j;
322 lvl2->SetRnrSelf(kTRUE);
323 lvl2->SetMainTransparency(30);
328 TEveElement* top = gEve->GetCurrentEvent();
330 AliEveMultiView *mv = AliEveMultiView::Instance();
332 mv->InitGeomGentle(gsre1, gsre2, gsre3, 0);
334 gEve->FullRedraw3D(kTRUE, kTRUE);