First big commit of the mchview program and its accompanying library,
[u/mrichter/AliRoot.git] / MUON / AliMUONPainterRegistry.h
CommitLineData
0145e89a 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_RQ_OBJECT
19# include <RQ_OBJECT.h>
20#endif
21
22class TGPopupMenu;
23class TObjArray;
24class AliMUONVTrackerData;
25class AliMUONVTrackerDataMaker;
26class AliMUONPainterMatrix;
27class TGMenuBar;
28
29class AliMUONPainterRegistry : public TObject
30{
31 RQ_OBJECT("AliMUONPainterRegistry")
32
33public:
34 virtual ~AliMUONPainterRegistry();
35
36 AliMUONVTrackerDataMaker* DataReader(Int_t i) const;
37
38 AliMUONVTrackerData* DataSource(Int_t i) const;
39
40 void DataSourceWasRegistered(AliMUONVTrackerData* data); // *SIGNAL*
41
42 void DataSourceWasUnregistered(AliMUONVTrackerData* data); // *SIGNAL*
43
44 void DataReaderWasRegistered(AliMUONVTrackerDataMaker* reader); // *SIGNAL*
45
46 void DataReaderWasUnregistered(AliMUONVTrackerDataMaker* reader); // *SIGNAL*
47
48 AliMUONVTrackerData* FindDataSource(const char* name) const;
49
50 Int_t FindIndexOf(AliMUONPainterMatrix* group) const;
51
52 Int_t FindIndexOf(AliMUONVTrackerData* data) const;
53
54 AliMUONPainterMatrix* FindPainterMatrix(const char* groupName) const;
55
56 void HistoryMenuActivated(Int_t i);
57
58 static AliMUONPainterRegistry* Instance();
59
60 Int_t NumberOfDataReaders() const;
61
62 Int_t NumberOfDataSources() const;
63
64 Int_t NumberOfPainterMatrices() const;
65
66 AliMUONPainterMatrix* PainterMatrix(Int_t i) const;
67
68 void AddToHistory(AliMUONPainterMatrix* group);
69
70 void PainterMatrixWasRegistered(AliMUONPainterMatrix* group); // *SIGNAL*
71
72 void PainterMatrixWasUnregistered(AliMUONPainterMatrix* group); // *SIGNAL*
73
74 void PainterMatrixWantToShow(AliMUONPainterMatrix* group); // *SIGNAL*
75
76 void Print(Option_t* opt) const;
77
78 Int_t Register(AliMUONPainterMatrix* group);
79
80 void Register(AliMUONVTrackerData* data);
81
82 void Register(AliMUONVTrackerDataMaker* reader);
83
84 /// Set the menu bar where to put the history menu
85 void SetMenuBar(TGMenuBar* bar) { fMenuBar = bar; }
86
87 Bool_t Unregister(AliMUONPainterMatrix* group);
88
89 Bool_t Unregister(AliMUONVTrackerData* data);
90
91 Bool_t Unregister(AliMUONVTrackerDataMaker* reader);
92
93private:
94 /// Not implemented
95 AliMUONPainterRegistry();
96 /// Not implemented
97 AliMUONPainterRegistry(const AliMUONPainterRegistry&);
98 /// Not implemented
99 AliMUONPainterRegistry& operator=(const AliMUONPainterRegistry&);
100
101private:
102 static AliMUONPainterRegistry* fgInstance; ///< unique instance
103 TObjArray* fDataSources; ///< data sources
104 TObjArray* fPainterMatrices; ///< painter matrices
105 TObjArray* fDataReaders; ///< data readers
106 TGPopupMenu* fHistoryMenu; ///< history menu
107 TGMenuBar* fMenuBar; ///< Menu bar where to put the history menu
108 Int_t fHistoryCounter; ///< index to get back history menu items
109
110 ClassDef(AliMUONPainterRegistry,1) // Registry for AliMUONVPainter related stuff
111};
112
113#endif