TEveCompound* assert_vertex_parent(const TString& name, Color_t col) { // !!! TEveCompound should have viz-db support ... add in root, then fix here, // that is, remove the color var and pass viz-db tag. TEveCompound* parent = dynamic_cast<TEveCompound*> (IlcEveEventManager::GetCurrent()->FindChild(name)); if (parent == 0) { parent = new TEveCompound(name); parent->OpenCompound(); parent->SetMainColor(col); IlcEveEventManager::GetMaster()->AddElement(parent); } return parent; }
void compound() { TEveManager::Create(); TEveLine* ml = new TEveLine; ml->SetMainColor(kRed); ml->SetLineStyle(2); ml->SetLineWidth(3); gEve->InsertVizDBEntry("BigLine", ml); TEveCompound* cmp = new TEveCompound; cmp->SetMainColor(kGreen); gEve->AddElement(cmp); TRandom rnd(0); cmp->OpenCompound(); cmp->AddElement(random_line(rnd, 20, 10)); cmp->AddElement(random_line(rnd, 20, 10)); TEveLine* line = random_line(rnd, 20, 12); line->ApplyVizTag("BigLine"); cmp->AddElement(line); cmp->CloseCompound(); // Projected view TEveViewer *viewer = gEve->SpawnNewViewer("Projected"); TEveScene *scene = gEve->SpawnNewScene("Projected Event"); viewer->AddScene(scene); { TGLViewer* v = viewer->GetGLViewer(); v->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); } // projections TEveProjectionManager* mng = new TEveProjectionManager(TEveProjection::kPT_RPhi); scene->AddElement(mng); TEveProjectionAxes* axes = new TEveProjectionAxes(mng); scene->AddElement(axes); gEve->AddToListTree(axes, kTRUE); gEve->AddToListTree(mng, kTRUE); mng->ImportElements(cmp); gEve->Redraw3D(kTRUE); }