--- /dev/null
+// Author: Mihai Niculescu 2012
+
+/**************************************************************************
+ * Copyright(c) 1998-2012, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
+ * full copyright notice. *
+ **************************************************************************/
+
+#include <TInterpreter.h>
+#include <TSystem.h>
+#include <TString.h>
+#include <TROOT.h>
+
+#include <AliLog.h>
+
+#include <AliEveApplication.h>
+#include <AliEveManager.h>
+
+
+ClassImp(AliEveApplication)
+
+AliEveApplication::AliEveApplication(const char* appClassName, int* argc, char** argv, void* options, int numOptions, Bool_t noLogo)
+ : TRint(appClassName, argc, argv, options, numOptions, noLogo)
+{
+ Init();
+}
+
+AliEveApplication::~AliEveApplication()
+{}
+
+void AliEveApplication::Init()
+{
+
+ static const TEveException kEH("alieve::main");
+
+ TString evedir(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
+
+ TString macPath(gROOT->GetMacroPath());
+ macPath += Form(":%s/macros", evedir.Data());
+ gInterpreter->AddIncludePath(evedir);
+
+ macPath += Form(":%s/alice-macros", evedir.Data());
+ gInterpreter->AddIncludePath(Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
+ gInterpreter->AddIncludePath(Form("%s/PWG0", gSystem->Getenv("ALICE_ROOT")));
+ gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
+ gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
+
+ gROOT->SetMacroPath(macPath);
+
+ // make sure logger is instantiated
+ AliLog::GetRootLogger();
+
+
+}
--- /dev/null
+// Author: Mihai Niculescu 2012
+
+/**************************************************************************
+ * Copyright(c) 1998-2012, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
+ * full copyright notice. *
+ **************************************************************************/
+
+#ifndef AliEveApplication_H
+#define AliEveApplication_H
+
+#include <TRint.h>
+
+class AliEveApplication : public TRint
+{
+public:
+ AliEveApplication(const char* appClassName, Int_t* argc, char** argv, void* options = 0, Int_t numOptions = 0, Bool_t noLogo = kFALSE);
+ virtual ~AliEveApplication();
+
+ void Init(); // Initialize AliEve & Rint Environment
+
+private:
+ AliEveApplication(const AliEveApplication&); // not implemented
+ AliEveApplication& operator=(const AliEveApplication&); // not implemented
+
+public:
+
+ ClassDef(AliEveApplication, 0); // AliEve application
+};
+#endif
--- /dev/null
+#include <TInterpreter.h>
+#include <TGeoManager.h>
+#include <TEveBrowser.h>
+#include <TEveGedEditor.h>
+#include <TEveManager.h>
+#include <TEveViewer.h>
+#include <TEveSelection.h>
+#include <TSystem.h>
+#include <TString.h>
+#include <TROOT.h>
+
+#include <AliLog.h>
+#include <AliEveConfigManager.h>
+#include <AliEveMultiView.h>
+
+#include "AliEveManager.h"
+
+//______________________________________________________________________________
+// AliEveManager
+//
+// Central aplication manager for AliEve.
+// Manages environment, gEve, elements, GUI, GL scenes and GL viewers.
+//
+// ALICE_ROOT must be defined prior creating this object
+ClassImp(AliEveManager);
+
+AliEveManager::AliEveManager(UInt_t w, UInt_t h, Bool_t map_window, Option_t* opt)
+ : TEveManager(w, h, map_window, opt)
+{
+
+ Init();
+
+}
+
+AliEveManager* AliEveManager::Create(Bool_t map_window, Option_t* opt)
+{
+ Int_t w = 1024;
+ Int_t h = 768;
+
+ if(gEve == 0){
+ gEve = new AliEveManager(w, h, map_window, opt);
+ }
+
+ return (AliEveManager*)gEve;
+}
+
+AliEveManager::~AliEveManager()
+{
+ AliEveMultiView* mv = AliEveMultiView::Instance();
+
+ delete mv;
+ mv = 0;
+}
+
+void AliEveManager::Init()
+{
+ GetDefaultViewer()->SetElementName("3D View");
+ GetSelection()->SetPickToSelect(TEveSelection::kPS_PableCompound);
+ GetHighlight()->SetPickToSelect(TEveSelection::kPS_PableCompound);
+
+ RegisterGeometryAlias("Default", Form("%s/EVE/alice-data/default_geo.root", gSystem->Getenv("ALICE_ROOT")) );
+
+ AliEveConfigManager::InitializeMaster(); // initializes menus
+}
+
+void AliEveManager::CloseEveWindow()
+{
+ // Close button haas been clicked on EVE main window (browser).
+ // Cleanup and terminate application.
+
+ TEveBrowser *eb = dynamic_cast<TEveBrowser*>( GetMainWindow() );
+ eb->DontCallClose();
+
+ TEveGedEditor::DestroyEditors();
+
+}
+
+void AliEveManager::Terminate()
+{
+
+}
--- /dev/null
+// Author: Mihai Niculescu 2012
+
+/**************************************************************************
+ * Copyright(c) 1998-2012, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
+ * full copyright notice. *
+ **************************************************************************/
+
+#ifndef AliEveManager_H
+#define AliEveManager_H
+
+#include <TEveManager.h>
+
+class AliEveManager : public TEveManager
+{
+public:
+ AliEveManager(UInt_t w, UInt_t h, Bool_t map_window=kTRUE, Option_t* opt="FI");
+ ~AliEveManager();
+
+ static AliEveManager* Create(Bool_t map_window=kTRUE, Option_t* opt="FIV");
+
+ void CloseEveWindow();
+ void Terminate();
+protected:
+ void Init();
+
+public:
+
+ ClassDef(AliEveManager, 0); // Eve application manager
+};
+#endif