]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONPainterPlotSelector.h
First big commit of the mchview program and its accompanying library,
[u/mrichter/AliRoot.git] / MUON / AliMUONPainterPlotSelector.h
1 #ifndef ALIMUONPAINTERPLOTSELECTOR_H
2 #define ALIMUONPAINTERPLOTSELECTOR_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice                               */
6
7 // $Id$
8
9 /// \ingroup graphics
10 /// \class AliMUONPainterPlotSelector
11 /// \brief Widget to pick what to plot for the painters
12 /// 
13 // Author Laurent Aphecetche, Subatech
14
15 #ifndef ROOT_TGFrame
16 #  include "TGFrame.h"
17 #endif
18 #ifndef ROOT_RQ_OBJECT
19 # include <RQ_OBJECT.h>
20 #endif
21 #ifndef ROOT_TString
22 #  include "TString.h"
23 #endif
24
25 class AliMUONPainterMatrix;
26 class AliMUONVTrackerData;
27 class TGButtonGroup;
28 class TMap;
29
30 class AliMUONPainterPlotSelector : public TGCompositeFrame
31 {
32   RQ_OBJECT("AliMUONPainterPlotSelector")
33   
34 public:
35   AliMUONPainterPlotSelector(const TGWindow* window, UInt_t w=1, UInt_t h=1);
36   virtual ~AliMUONPainterPlotSelector();
37   
38   void DataSourceWasRegistered(AliMUONVTrackerData* data);  
39   
40   void DataSourceWasUnregistered(AliMUONVTrackerData* data);
41
42   void DataSourceWasChanged(const char* type, 
43                             AliMUONVTrackerData* data,
44                             Int_t dataIndex); // *SIGNAL*
45   
46   void DimensionButtonWasClicked(Int_t id);
47   
48   void SourceButtonWasClicked(Int_t id);
49   
50   void TypeButtonWasClicked(Int_t id);
51     
52   void Update(const AliMUONPainterMatrix& painterMatrix);
53
54   void NumberOfEventsChanged();
55
56 private:
57   /// Not implemented
58   AliMUONPainterPlotSelector(const AliMUONPainterPlotSelector& rhs);
59   /// Not implemented
60   AliMUONPainterPlotSelector& operator=(const AliMUONPainterPlotSelector& rhs);
61   
62   void BackupDimensionButtons();
63   
64   void CreateDimensionButtons(const char* dataSourceName);
65
66   void CreateTypeButtons(const TObjArray& types);
67   
68   void DataSourceWasChanged();
69
70   void ResetDimensionButtonMap();
71
72   void RestoreDimensionButtons(const char* dataSourceName,
73                                Bool_t updateCurrentDimension);
74   
75   void SetCurrentData(AliMUONVTrackerData* data);
76   
77   void SetCurrentDimension(Int_t i);
78   
79   void SetCurrentType(const char* type);
80   
81   void UpdateDimensionButton();
82   
83   void UpdateSourceButton();
84   
85   void UpdateTypeButton();
86   
87 private:
88   
89   TGButtonGroup* fTypes; ///< types buttons
90   TGButtonGroup* fDataSourceNames; ///< data source names buttons
91   TGButtonGroup* fDataSourceDimensions; ///< data source dimensions buttons  
92   TMap* fDimensionButtonMap; ///< cache for button group  
93   TString fCurrentType; ///< current type
94   AliMUONVTrackerData* fCurrentData; ///< current data
95   Int_t fCurrentDimension; ///< current data index
96   static const char* fgkDefaultSourceName; ///< default source name
97   
98   ClassDef(AliMUONPainterPlotSelector,1) // Widget to select what to plot for painters
99 };
100
101 #endif