Logo ROOT   6.10/09
Reference Guide
compound.C File Reference

Detailed Description

Demonstrates usage of EVE compound objects - class TEveCompound.

eve_compound.png
TEveLine* random_line(TRandom& rnd, Int_t n, Float_t delta)
{
TEveLine* line = new TEveLine;
Float_t x = 0, y = 0, z = 0;
for (Int_t i=0; i<n; ++i)
{
line->SetNextPoint(x, y, z);
x += rnd.Uniform(0, delta);
y += rnd.Uniform(0, delta);
z += rnd.Uniform(0, delta);
}
return line;
}
void compound()
{
TEveLine* ml = new TEveLine;
ml->SetMainColor(kRed);
ml->SetLineStyle(2);
ml->SetLineWidth(3);
gEve->InsertVizDBEntry("BigLine", ml);
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();
}
// projections
scene->AddElement(mng);
scene->AddElement(axes);
mng->ImportElements(cmp);
}
Author
Matevz Tadel

Definition in file compound.C.