swh:1:snp:af87cd67498ef4fe47c76ed3e7caffe5b61facaf
Raw File
Tip revision: 82fc2dc7e13477e717020c761e227ed4e3f7012e authored by Axel Naumann on 07 June 2022, 15:59:39 UTC
"Update ROOT version files to v6.26/04."
Tip revision: 82fc2dc
geom_alias.C
/// \file
/// \ingroup tutorial_eve
/// Demonstrates usage of geometry aliases - merge ALICE ITS with ATLAS MUON.
///
/// \image html eve_geom_alias.png
/// \macro_code
///
/// \author Matevz Tadel

void geom_alias()
{
   TEveManager::Create();

   gEve->RegisterGeometryAlias("ALICE", "http://root.cern.ch/files/alice.root");
   gEve->RegisterGeometryAlias("ATLAS", "http://root.cern.ch/files/atlas.root");


   gGeoManager = gEve->GetGeometryByAlias("ALICE");

   auto node1 = gGeoManager->GetTopVolume()->FindNode("ITSV_1");
   auto its   = new TEveGeoTopNode(gGeoManager, node1);
   gEve->AddGlobalElement(its);

   gGeoManager = gEve->GetGeometryByAlias("ATLAS");

   auto node2 = gGeoManager->GetTopVolume()->FindNode("OUTE_1");
   auto atlas = new TEveGeoTopNode(gGeoManager, node2);
   gEve->AddGlobalElement(atlas);

   gEve->FullRedraw3D(kTRUE);

   // EClipType not exported to CINT (see TGLUtil.h):
   // 0 - no clip, 1 - clip plane, 2 - clip box
   auto v = gEve->GetDefaultGLViewer();
   v->GetClipSet()->SetClipType(TGLClip::EType(2));
   v->RefreshPadEditor(v);

   v->CurrentCamera().RotateRad(-0.5, -2.4);
   v->DoDraw();
}
back to top