Satoshi request: fTrig and fTime
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveManager.cxx
1 #include <TInterpreter.h>
2 #include <TGeoManager.h>
3 #include <TEveBrowser.h>
4 #include <TEveGedEditor.h>
5 #include <TEveManager.h>
6 #include <TEveViewer.h>
7 #include <TEveSelection.h>
8 #include <TSystem.h>
9 #include <TString.h>
10 #include <TROOT.h>
11
12 #include <AliLog.h>
13 #include <AliEveConfigManager.h>
14 #include <AliEveMultiView.h>
15
16 #include "AliEveManager.h"
17
18 //______________________________________________________________________________
19 // AliEveManager
20 //
21 // Central aplication manager for AliEve.
22 // Manages environment, gEve, elements, GUI, GL scenes and GL viewers.
23 //
24 // ALICE_ROOT must be defined prior creating this object
25 ClassImp(AliEveManager);
26
27 AliEveManager::AliEveManager(UInt_t w, UInt_t h, Bool_t map_window, Option_t* opt)
28         : TEveManager(w, h, map_window, opt)
29 {
30
31         Init();
32         
33 }
34
35 AliEveManager* AliEveManager::Create(Bool_t map_window, Option_t* opt)
36 {
37         Int_t w = 1024;
38         Int_t h =  768;
39   
40   if(gEve == 0){
41       gEve = new AliEveManager(w, h, map_window, opt);
42   }
43         
44         return (AliEveManager*)gEve;
45 }
46
47 AliEveManager::~AliEveManager()
48
49       AliEveMultiView* mv = AliEveMultiView::Instance();
50       
51       delete mv;
52       mv = 0;
53 }
54
55 void AliEveManager::Init()
56 {
57         GetDefaultViewer()->SetElementName("3D View");
58   GetSelection()->SetPickToSelect(TEveSelection::kPS_PableCompound);
59   GetHighlight()->SetPickToSelect(TEveSelection::kPS_PableCompound);
60
61         RegisterGeometryAlias("Default", Form("%s/EVE/alice-data/default_geo.root",  gSystem->Getenv("ALICE_ROOT")) );
62
63         AliEveConfigManager::InitializeMaster(); // initializes menus
64 }
65
66 void AliEveManager::CloseEveWindow()
67 {
68                 // Close button haas been clicked on EVE main window (browser).
69    // Cleanup and terminate application.
70
71    TEveBrowser *eb = dynamic_cast<TEveBrowser*>( GetMainWindow() );
72          eb->DontCallClose();
73                 
74         TEveGedEditor::DestroyEditors();
75
76 }
77
78 void AliEveManager::Terminate()
79 {
80
81 }