]> git.uio.no Git - u/mrichter/AliRoot.git/blob - DISPLAY/AliDisplay2.h
Splitting of the ITS libraries (M.Masera & E.Crescio)
[u/mrichter/AliRoot.git] / DISPLAY / AliDisplay2.h
1 /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 /////////////////////////////////////////////////////////////////////////
5 // ALICE EVENT DISPLAY CLASS                                           //
6 // Author: Mayeul   ROUSSELET                                          //
7 // e-mail: Mayeul.Rousselet@cern.ch                                    //
8 // Last update:26/08/2003                                              //
9 /////////////////////////////////////////////////////////////////////////
10
11 #ifndef AliDISPLAY2_H
12 #define AliDISPLAY2_H
13
14 #include <TObject.h>
15 #include <RQ_OBJECT.h>
16 #include <TGStatusBar.h>
17
18 #include "AliDisplayFrame.h"
19 #include "AliSliderFrame.h"
20
21 class TObjArray;
22 class TGWindow;
23 class TEnv;
24
25 class AliModuleInfo;
26 class AliShutterFrame;
27 class AliInfoFrame;
28 class AliDetectorFrame;
29 class AliMenu;
30
31 enum AliDisplay2Id {
32         kIdsVIEW,               //id of the view shutter
33         kIdbSIDEVIEW,   //id of sideview button
34         kIdbTOPVIEW,
35         kIdbFRONTVIEW,
36         kIdbALLVIEW,
37
38         kIdsEVENT,
39         kIdbPrevEVENT,
40         kIdbNextEVENT,
41
42         kIdbZoomIN,
43         kIdbZoomOUT,
44         kIdbZoomZONE,
45
46         kIdiNBPARTICULES,
47         kIdiNBEVENTS,
48
49         kIdsRAPIDITY,
50         kIdsMOMENTUM,
51         kIdsOPTIONS,
52
53         kIdsMomentumMIN,
54         kIdsMomentumMAX,
55         kIdsRapidityMIN,
56         kIdsRapidityMAX,
57
58         kIdbSelectALL,
59         kIdbSelectINVERT,
60
61         kIdsDETECTORS,
62         kIdbCheckTPC,
63         kIdbCheckMUON,
64         kIdbCheckTOF,
65         kIdbCheckTRD,
66         kIdbCheckPHOS,
67         kIdbCheckVZERO,
68         kIdbCheckEMCAL,
69         kIdbCheckSTART,
70         kIdbCheckPMD,
71         kIdbCheckFMD,
72         kIdbCheckZDC,
73         kIdbCheckRICH,
74         kIdbCheckITS,
75         
76         kIdbCheckHITS,
77         kIdbCheckCLUSTERS,
78         kIdbCheckHLT,
79         kIdbCheckTRACKS,
80
81         kIdmOPEN,
82         kIdmSAVEAS,
83         kIdmCLOSE,
84         kIdmPRINT,
85         kIdmPRINTSETUP,
86         kIdmEXIT,
87         kIdmSETTINGS,
88         kIdmSAVESETTINGS,
89         kIdmHELP,
90         kIdmABOUT,
91         kIdmVIEWX3D,
92         kIdmVIEWGL,
93
94         kIdtZoomSTEP,
95         kIdtSliderSTEP,
96         kIdtSliderUPDATE,
97         
98         kmCUTS,         //tag for the update fucntion
99         kmMODULES,
100         kmPOINTS
101 };
102
103 //Constants to set the display mode
104 const Int_t kHits = BIT(0);
105 const Int_t kClusters = BIT(1);
106 const Int_t kHLT = BIT(2);
107 const Int_t kTracks = BIT(3);
108
109
110 class AliDisplay2 : public TObject{
111   //This classe is the main component of the new display. 
112   //It aggregates all the subframes and manage the relationnships 
113   //between the widgets and the internal representation
114
115 public:
116
117  AliDisplay2(const TGWindow *p, UInt_t w, UInt_t h); //Constructor, load all the widgets
118  virtual ~AliDisplay2(void);
119
120  //Slots
121  void                           CloseWindow();//
122  void                           DoView(Int_t pos){fDisplayFrame->DoView(pos);};//change the current view
123                 
124  void                           DoSaveSettings();//Save settings to the ressource file
125  void                           LoadSettings();//load the settings from the ressource file
126
127  //Getter
128  Int_t                          GetCurrentView(void) const {return fCurrentView;};//return current view
129  TGMainFrame*                   GetMainFrame() const {return fMainFrame;};//
130  Float_t                        GetZoomStep() const {return fZoomStep;};//
131  Float_t                        GetZoomFactor() const {return fZoomFactor;};//
132  Float_t                        GetRapidityMin() const {return fSliderFrame->GetRapidityMin();};//
133  Float_t                        GetRapidityMax() const {return fSliderFrame->GetRapidityMax();};//
134  Float_t                        GetMomentumMin() const {return fSliderFrame->GetMomentumMin();};//
135  Float_t                        GetMomentumMax() const {return fSliderFrame->GetMomentumMax();};//
136  Int_t                          GetNbParticles() const {return fNbParticles;};//
137  Int_t                          GetEventNumber() const {return fEventNumber;};//
138  Int_t                          GetNbHits() const {return fNbHits;};//
139  Int_t                          GetNbClusters() const {return fDisplayFrame->GetNbClusters();};//
140  Float_t                        GetSliderStep() const {return fSliderStep;};//
141  Bool_t                         GetZoomMode() const {return fZoomMode;};//
142  Int_t                          GetMode() const {return fMode;};//
143  TObjArray*                     GetModules() const {return fModules;};//
144  Bool_t*                        GetEnabledModules() const {return fEnabledModules;};//
145  Int_t                          GetNbModules() const {return fNbModules;};//
146  char*                          GetIconsPath() const {return fIconsPath;};//
147  AliModuleInfo*                    GetModuleInfo() const {return fModuleInfo;};//
148  Bool_t                         GetSliderUpdate() const {return fSliderUpdate;};//
149  char*                          GetRawDataPath() const {return fRawDataPath;};
150
151  //Setter       
152  void                           SetSliderUpdate(Bool_t b){fSliderUpdate = b;};//
153  void                           SetMode(Int_t m){fMode=m;};//
154  void                           Enable(Int_t m);//Enable the given mode 
155  Bool_t                         IsEnabled(Int_t m) const;//Return if the given mode is enabled
156  void                           Disable(Int_t m);//Disable the given mode
157  void                           SetZoomMode(Bool_t b=kTRUE){fZoomMode = b;};//
158  void                           SetCurrentView(Int_t id){fCurrentView = id;};//
159  void                           SetZoomStep(Float_t zs){fZoomStep=zs;};//
160  void                           SetZoomFactor(Float_t zf){fZoomFactor=zf;};//
161  void                           SetNbHits(Int_t hi){fNbHits = hi;};//
162  void                           SetNbParticles(Int_t nbp){fNbParticles = nbp;};//
163  void                           SetSliderStep(Float_t st){fSliderStep = st;};//
164  void                           SetEditable(Bool_t b){fDisplayFrame->SetEditable(b);};//
165  void                           SetStatusBar(const char *s,Int_t p){fStatusBar->SetText(s,p);};//Change text in the p part of the status bar
166  void                           SetRawDataPath(char *path){fRawDataPath=new char[strlen(path)];strcpy(fRawDataPath,path);};
167         
168  void                           SavePadGIF(const char* file){fDisplayFrame->SavePadGIF(file);};//save current pad to gif file
169  void                           Draw(Option_t *options=0);//draw 
170  void                           DrawDetector(const char *name){fDisplayFrame->DrawDetector(name);};//draw detector specific view (not implemented)
171  void                           DrawX3d();//Draw current pad in x3d view
172  void                           DrawGL();//Draw current pad in OpenGL view
173  void                           ShowNextEvent(Int_t delta);//Load and display the current+delta event, if it exists
174  void                           LoadClusters(Int_t nevent);//Load the clusters of the event 
175  void                           LoadHits();//Load the hits
176  void                           LoadHLTClusters(Int_t nevent);//Load the hlt clusters
177  void                           LoadEnabledModules(){fDisplayFrame->LoadEnabledModules();};//Load enabled modules
178  void                           LoadEnabledHits(){fDisplayFrame->LoadHits();};//Load enabled hits
179  void                           ApplyCuts(){fDisplayFrame->ApplyCuts();}//Apply cuts from the slider frame
180  void                           EnableDetector(const char *name){fDisplayFrame->EnableDetector(name);};//Enable detector "name"
181  void                           DisableDetector(const char *name){fDisplayFrame->DisableDetector(name);};//Disable detector "name"
182  void                           Update(Int_t tag=-1);//Update the view, if loading only the modified data from the previous changes, the integer tag indicates the kind of modification
183  void                           HandleMouseWheel(Event_t *event);//Handle mouve event, not working yet
184  void                           HandleResize(Event_t *event);//Handle resize event
185  void                           FindModules();//Find the modules used for the simulation
186
187  //I/O
188  void                           LoadFromRC();
189  void                           SaveToRC() const;
190
191 private:
192
193  Float_t                        fZoomStep;//Step of the zoom, ie the factor by which the zoom factor will be multiplied(divided) when pressing the zoom in (out) button
194  Float_t                        fZoomFactor;//Zoom factor, ie 1=no zoom, >1 zoom in & <1 zoom out
195  Bool_t                         fZoomMode;//kTrue if zoom on zone is enabled
196  Int_t                          fCurrentView;//Current view, see the enum for value
197  Int_t                          fNbParticles;//Current number of displayed particles
198  Int_t                          fEventNumber;//Number of event
199  Int_t                          fNbHits;//Number of displayed hits
200  Float_t                        fSliderStep;//Step of the slider
201  Int_t                          fMode;//Display mode : each bit is associated to a mode : Hits=BIT(0), clusters=BIT(1)...
202  Int_t                          fNbModules;//Total number of modules
203  TObjArray                      *fModules;//Array of modules
204  Bool_t                         *fEnabledModules;//Array of bool for coding the enabled modules
205  char                           *fIconsPath;//Icon Path (by default $ALICE_ROOT/DISPLAY/icons/)
206  char                           *fRawDataPath;//Raw data path
207  Bool_t                         fHitsLoaded,fClustersLoaded,fHLTLoaded,fTracksLoaded;//Implement if the type of datas was loaded, to avoid uneeded load
208  Bool_t                         fSliderUpdate;//True if display frame update on slider move, for fast machine only (desactivated by default)
209  AliModuleInfo                     *fModuleInfo;//Pointer to the class which map module name and internal module ID, necessary because of the dynamic load of the available modules
210         
211  TEnv                           *fAliDisplay2rc;//ressources file (.alidisplay.rc)
212         
213  TGMainFrame                    *fMainFrame;//Main frame
214  TGCompositeFrame               *fLeftFrame;//frame used for the layout
215  TGCompositeFrame               *fRightFrame;//frame used for the layout
216  TGCompositeFrame               *fSubFrame;//frame used for the layout  
217
218  //Slider Frame
219  TGLayoutHints                  *fSliderFrameLayout; // Slider Frame Layout
220  AliSliderFrame                 *fSliderFrame;//Frame which contains the rapidity and momentum sliders
221
222  //Shutter Frame
223  TGLayoutHints                  *fShutterFrameLayout; // Shutter Frame Layout
224  AliShutterFrame                *fShutterFrame;// Shutter Frame
225
226  //Display Frame
227  TGLayoutHints                  *fDisplayFrameLayout; // Display Frame Layout
228  AliDisplayFrame                        *fDisplayFrame;// Display Frame
229
230  //Info Frame
231  TGLayoutHints                  *fInfoFrameLayout; // Info Frame Layout
232  AliInfoFrame                   *fInfoFrame; // Info Frame
233
234  //Detector Option Frame
235  TGLayoutHints                  *fDetectorFrameLayout;// Detector Frame Layout
236  AliDetectorFrame               *fDetectorFrame; // Detector Frame
237
238  //MenuBar
239  AliMenu                                *fMenu; // Menu
240
241  //Status bar
242  TGStatusBar                    *fStatusBar; // Status Bar
243
244  RQ_OBJECT("AliDisplay2")
245
246  ClassDef(AliDisplay2,0);
247 };
248
249 R__EXTERN  AliDisplay2* gAliDisplay2;
250
251 #endif
252