10 const char* esd_geom_file_name =
11 "http://root.cern.ch/files/alice_ESDgeometry.root";
13 void projection_prescale()
15 TFile::SetCacheFileDir(
".");
16 TEveManager::Create();
18 auto pev = gEve->SpawnNewViewer(
"Projections");
21 auto s = gEve->SpawnNewScene(
"Projected Geom");
24 auto pgv = pev->GetGLViewer();
25 pgv->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
26 TGLOrthoCamera& cam = (TGLOrthoCamera&) pgv->CurrentCamera();
27 cam.SetZoomMinMax(0.2, 20);
30 auto mng =
new TEveProjectionManager();
32 mng->SetProjection(TEveProjection::kPT_RPhi);
33 auto p = mng->GetProjection();
34 p->AddPreScaleEntry(0, 0, 4);
35 p->AddPreScaleEntry(0, 45, 1);
36 p->AddPreScaleEntry(0, 310, 0.5);
37 p->SetUsePreScale(kTRUE);
40 mng->SetProjection(TEveProjection::kPT_RhoZ);
41 auto p = mng->GetProjection();
43 p->AddPreScaleEntry(0, 0, 4);
44 p->AddPreScaleEntry(1, 0, 4);
46 p->AddPreScaleEntry(0, 45, 1);
47 p->AddPreScaleEntry(1, 110, 1);
49 p->AddPreScaleEntry(0, 310, 0.5);
50 p->AddPreScaleEntry(1, 250, 0.5);
51 p->SetUsePreScale(kTRUE);
53 mng->SetProjection(TEveProjection::kPT_RPhi);
56 auto axes =
new TEveProjectionAxes(mng);
58 gEve->AddToListTree(axes, kTRUE);
59 gEve->AddToListTree(mng, kTRUE);
62 auto geom = TFile::Open(esd_geom_file_name,
"CACHEREAD");
66 auto gse = (TEveGeoShapeExtract*) geom->Get(
"Gentle");
67 auto gsre = TEveGeoShape::ImportShapeExtract(gse, 0);
70 gEve->AddGlobalElement(gsre);
71 mng->ImportElements(gsre);
73 auto line =
new TEveLine;
74 line->SetMainColor(kGreen);
75 for (Int_t i=0; i<160; ++i)
76 line->SetNextPoint(120*sin(0.2*i), 120*cos(0.2*i), 80-i);
77 gEve->AddElement(line);
78 mng->ImportElements(line);
79 line->SetRnrSelf(kFALSE);
86 auto sev = gEve->SpawnNewViewer(
"Scaled 3D");
87 auto smng =
new TEveProjectionManager(TEveProjection::kPT_3D);
88 auto sp = smng->GetProjection();
89 sp->SetUsePreScale(kTRUE);
90 sp->AddPreScaleEntry(2, 0, 1);
91 sp->AddPreScaleEntry(2, 100, 0.2);
93 auto ss = gEve->SpawnNewScene(
"Scaled Geom");
97 smng->ImportElements(gsre);
101 gEve->GetBrowser()->GetTabRight()->SetTab(1);
103 gEve->Redraw3D(kTRUE);