swh:1:snp:af87cd67498ef4fe47c76ed3e7caffe5b61facaf
Tip revision: 678133136fc214f5da9695c362eaf02a4bdff99e authored by Axel Naumann on 10 June 2020, 06:09:26 UTC
"Update ROOT version files to v6.20/06."
"Update ROOT version files to v6.20/06."
Tip revision: 6781331
box.C
/// \file
/// \ingroup tutorial_eve
/// Demonstrates usage of TEveBox class.
///
/// \image html eve_box.png
/// \macro_code
///
/// \author Matevz Tadel
TEveBox* box(Float_t a=10, Float_t d=5, Float_t x=0, Float_t y=0, Float_t z=0)
{
TEveManager::Create();
TRandom& r = * gRandom;
auto b = new TEveBox;
b->SetMainColor(kCyan);
b->SetMainTransparency(0);
#define RND_BOX(x) r.Uniform(-(x), (x))
b->SetVertex(0, x - a + RND_BOX(d), y - a + RND_BOX(d), z - a + RND_BOX(d));
b->SetVertex(1, x - a + RND_BOX(d), y + a + RND_BOX(d), z - a + RND_BOX(d));
b->SetVertex(2, x + a + RND_BOX(d), y + a + RND_BOX(d), z - a + RND_BOX(d));
b->SetVertex(3, x + a + RND_BOX(d), y - a + RND_BOX(d), z - a + RND_BOX(d));
b->SetVertex(4, x - a + RND_BOX(d), y - a + RND_BOX(d), z + a + RND_BOX(d));
b->SetVertex(5, x - a + RND_BOX(d), y + a + RND_BOX(d), z + a + RND_BOX(d));
b->SetVertex(6, x + a + RND_BOX(d), y + a + RND_BOX(d), z + a + RND_BOX(d));
b->SetVertex(7, x + a + RND_BOX(d), y - a + RND_BOX(d), z + a + RND_BOX(d));
#undef RND_BOX
gEve->AddElement(b);
gEve->Redraw3D(kTRUE);
return b;
}