2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
9 #include <AliEveConfigManager.h>
11 #include <TInterpreter.h>
22 #include <TEveManager.h>
23 #include <TEveSelection.h>
24 #include <TEveBrowser.h>
25 #include <TEveViewer.h>
29 // DEV Version includes
30 #include <AliEveApplication.h>
31 #include <AliEveMainWindow.h>
37 int main(int argc, char **argv)
39 if (gSystem->Getenv("ALICE_ROOT") == 0){
40 cout<<"ALICE_ROOT is not defined, aborting."<<endl;
44 TString evedir(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
46 if (gSystem->AccessPathName(evedir) == kTRUE){
47 cout<<"Directory $ALICE_ROOT/EVE does not exist."<<endl;
51 TString macPath(gROOT->GetMacroPath());
52 macPath += Form(":%s/macros", evedir.Data());
53 gInterpreter->AddIncludePath(evedir);
54 macPath += Form(":%s/alice-macros", evedir.Data());
55 gInterpreter->AddIncludePath(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
56 gInterpreter->AddIncludePath(Form("%s/PWG0", gSystem->Getenv("ALICE_ROOT")));
57 gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
58 gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
60 // TabCom fails on double-colon in macro-path.
61 // I fixed this in ROOT sometime ago ... could be removed
62 // when we go to 5.26.
63 // TPMERegexp doubleColon(":{2,}", "og");
64 // doubleColon.Substitute(macPath, ":");
66 gROOT->SetMacroPath(macPath);
68 // make sure logger is instantiated
69 AliLog::GetRootLogger();
70 TRint *app = new TRint("App", &argc, argv);
72 TEveManager::Create();
73 gEve->GetDefaultViewer()->SetElementName("3D View");
74 gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_PableCompound);
75 gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_PableCompound);
76 gEve->RegisterGeometryAlias("Default", Form("%s/alice-data/default_geo.root", evedir.Data()));
79 AliEveConfigManager::InitializeMaster();
81 catch (TEveException exc) {
82 cout<<"\n\nException while initializing config manager"<<endl;
83 AliErrorGeneral("alieve_main",exc.Data());
86 app->Connect("TEveBrowser", "CloseWindow()", "TRint", app, "Terminate()");
89 if (gEve && gEve->GetBrowser()) gEve->GetBrowser()->UnmapWindow();
90 TEveManager::Terminate();
91 if(gEve) {delete gEve; gEve = 0;}