]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONPainterRegistry.h
Load pythia libraries.
[u/mrichter/AliRoot.git] / MUON / AliMUONPainterRegistry.h
1 #ifndef ALIMUONPAINTERREGISTRY_H
2 #define ALIMUONPAINTERREGISTRY_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 AliMUONPainterRegistry
11 /// \brief Registry for a bunch of AliMUONVPainter related stuff
12 /// 
13 // Author Laurent Aphecetche, Subatech
14
15 #ifndef ROOT_TObject
16 #  include "TObject.h"
17 #endif
18 #ifndef ROOT_TQObject
19 #  include <TQObject.h>
20 #endif
21
22 class TGPopupMenu;
23 class TObjArray;
24 class AliMUONVTrackerData;
25 class AliMUONVTrackerDataMaker;
26 class AliMUONPainterMatrix;
27 class TGMenuBar;
28
29 class AliMUONPainterRegistry : public TObject, public TQObject
30 {
31 public:
32   virtual ~AliMUONPainterRegistry();
33
34   AliMUONVTrackerDataMaker* DataMaker(Int_t i) const;
35
36   AliMUONVTrackerData* DataSource(Int_t i) const;
37   
38   AliMUONVTrackerData* DataSource(const char* name) const;
39   
40   void DataSourceWasRegistered(AliMUONVTrackerData* data); // *SIGNAL*
41   
42   void DataSourceWasUnregistered(AliMUONVTrackerData* data); // *SIGNAL*
43
44   void DataMakerWasRegistered(AliMUONVTrackerDataMaker* reader); // *SIGNAL*
45   
46   void DataMakerWasUnregistered(AliMUONVTrackerDataMaker* reader); // *SIGNAL*
47   
48   Int_t FindIndexOf(AliMUONPainterMatrix* group) const;
49   
50   void HistoryMenuActivated(Int_t i);
51   
52   static AliMUONPainterRegistry* Instance();
53   
54   Int_t NumberOfDataMakers() const;
55
56   Int_t NumberOfDataSources() const { return NumberOfDataMakers(); }
57
58   Int_t NumberOfPainterMatrices() const;
59
60   AliMUONPainterMatrix* PainterMatrix(Int_t i) const;
61   
62   AliMUONPainterMatrix* PainterMatrix(const char* groupName) const;
63   
64   void AddToHistory(AliMUONPainterMatrix* group);
65     
66   void PainterMatrixWasRegistered(AliMUONPainterMatrix* group); // *SIGNAL*
67   
68   void PainterMatrixWasUnregistered(AliMUONPainterMatrix* group); // *SIGNAL*
69   
70   void PainterMatrixWantToShow(AliMUONPainterMatrix* group); // *SIGNAL*
71   
72   void Print(Option_t* opt) const;
73   
74   Int_t Register(AliMUONPainterMatrix* group);
75   
76   void Register(AliMUONVTrackerDataMaker* reader);
77
78   /// Set the menu bar where to put the history menu
79   void SetMenuBar(TGMenuBar* bar) { fMenuBar = bar; }
80   
81   Bool_t Unregister(AliMUONPainterMatrix* group);
82   
83   Bool_t Unregister(AliMUONVTrackerDataMaker* reader);
84
85   void DeleteZombies();
86   
87 private:
88   /// Not implemented
89   AliMUONPainterRegistry();
90   /// Not implemented
91   AliMUONPainterRegistry(const AliMUONPainterRegistry&);
92   /// Not implemented
93   AliMUONPainterRegistry& operator=(const AliMUONPainterRegistry&);
94   
95 private:
96   static AliMUONPainterRegistry* fgInstance; ///< unique instance
97   TObjArray* fPainterMatrices; ///< painter matrices
98   TObjArray* fDataMakers; ///< data makers
99   TGPopupMenu* fHistoryMenu; ///< history menu
100   TGMenuBar* fMenuBar; ///< Menu bar where to put the history menu
101   Int_t fHistoryCounter; ///< index to get back history menu items
102   TObjArray* fZombies; ///< data readers to be deleted
103   
104   ClassDef(AliMUONPainterRegistry,3) // Registry for AliMUONVPainter related stuff
105 };
106
107 #endif