From e8c8a67dfeea91a2ff291c2cf9c23298f6e632e5 Mon Sep 17 00:00:00 2001 From: Markus Frank <markus.frank@cern.ch> Date: Thu, 30 Jan 2014 13:50:30 +0000 Subject: [PATCH] Fix bug, which appears with earlier versions than root 5.34.10 --- DDG4/CMakeLists.txt | 1 + DDG4/examples/TEve.C | 57 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 DDG4/examples/TEve.C diff --git a/DDG4/CMakeLists.txt b/DDG4/CMakeLists.txt index 3e1bdc74a..df2085011 100644 --- a/DDG4/CMakeLists.txt +++ b/DDG4/CMakeLists.txt @@ -37,6 +37,7 @@ endif() if(NOT DD4HEP_USE_XERCESC) list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/src/Geant4XML.cpp) endif() +SET( CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Wno-long-long") #--------------------------- Main geant4 interface library (no plugins!)----------- add_library(DD4hepG4 SHARED ${sources}) diff --git a/DDG4/examples/TEve.C b/DDG4/examples/TEve.C new file mode 100644 index 000000000..db5615079 --- /dev/null +++ b/DDG4/examples/TEve.C @@ -0,0 +1,57 @@ +// $Id: Geant4Data.h 513 2013-04-05 14:31:53Z gaede $ +//==================================================================== +// AIDA Detector description implementation +//-------------------------------------------------------------------- +// +// Define the ROOT dictionaries for all data classes to be saved +// which are created by the DDG4 examples. +// +// Author : M.Frank +// +//==================================================================== +#include "DD4hep/LCDD.h" +#include "TGeoManager.h" +#include "TEveGeoNode.h" +#include "TGLViewer.h" +#include "TGLUtil.h" +#include "TGLClip.h" +#include "TMap.h" +#include "TEveElement.h" +#include "TSysEvtHandler.h" +#include "TTimer.h" +#include "TVirtualPad.h" + +#define private public +#include "TEveManager.h" + +using namespace DD4hep::Geometry; + +void TEve() { + LCDD& lcdd = LCDD::getInstance(); + const char* fname = "file:../DD4hep.trunk/DDExamples/CLICSiD/compact/compact.xml"; + lcdd.apply("DD4hepCompactLoader",1,(char**)&fname); + + TEveManager::Create(); + //TFile::SetCacheFileDir("."); + //gGeoManager = gEve->GetGeometry("LHCb.gdml"); + //gGeoManager = gEve->GetGeometry("lhcbfull_v1.root"); + + gEve->fGeometries->Add(new TObjString(fname),&lcdd.manager()); + //gGeoManager->DefaultColors(); + + TEveGeoTopNode* tn = new TEveGeoTopNode(gGeoManager, gGeoManager->GetTopNode()); + tn->SetVisLevel(4); + gEve->AddGlobalElement(tn); + + gEve->FullRedraw3D(kTRUE); + + // EClipType not exported to CINT (see TGLUtil.h): + // 0 - no clip, 1 - clip plane, 2 - clip box + TGLViewer *v = gEve->GetDefaultGLViewer(); + v->GetClipSet()->SetClipType(TGLClip::kClipPlane); + v->ColorSet().Background().SetColor(kMagenta+4); + v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, 0); + v->RefreshPadEditor(v); + v->CurrentCamera().RotateRad(-1.2, 0.5); + v->DoDraw(); +} -- GitLab