/// \file /// \ingroup tutorial_eve_7 /// Demonstrates usage of REveBoxSet class. /// /// \image html eve_boxset.png /// \macro_code /// /// \author Matevz Tadel #include "TRandom.h" #include #include #include #include using namespace ROOT::Experimental; void boxset_hex(Float_t x = 0, Float_t y = 0, Float_t z = 0, Int_t num = 100) { auto eveMng = REveManager::Create(); eveMng->AllowMultipleRemoteConnections(false, false); // AMT temporary solution: add geo-shape to set scene bounding box // digits at the moment have no bounding box calculation and lights are consequently // in inital empty position at extend size of 1 auto b1 = new REveGeoShape("Bounding Box Barrel"); b1->SetShape(new TGeoTube(30, 32, 10)); b1->SetMainColor(kCyan); b1->SetNSegments(80); b1->SetMainTransparency(95); ROOT::Experimental::gEve->GetGlobalScene()->AddElement(b1); REveViewer *v = ROOT::Experimental::gEve->GetDefaultViewer(); v->SetAxesType(REveViewer::kAxesOrigin); //----------------------------- TRandom r(0); auto q = new REveBoxSet("BoxSet"); q->Reset(REveBoxSet::kBT_InstancedScaledRotated, kTRUE, 64); q->AddHex(REveVector(0,0,0), 4, TMath::Pi() * 0.5, 10); // q->AddHex(REveVector(0, 0, 0), 4, 0, 10); q->DigitColor(255, 0, 0); q->RefitPlex(); q->SetPickable(true); q->SetAlwaysSecSelect(true); REveTrans &t = q->RefMainTrans(); t.SetPos(x, y, z); eveMng->GetEventScene()->AddElement(q); eveMng->Show(); }