]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONPainterMatrix.h
First big commit of the mchview program and its accompanying library,
[u/mrichter/AliRoot.git] / MUON / AliMUONPainterMatrix.h
1 #ifndef ALIMUONPAINTERMATRIX_H
2 #define ALIMUONPAINTERMATRIX_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 AliMUONPainterMatrix
11 /// \brief A matrix of AliMUONVPainter
12 /// 
13 // Author Laurent Aphecetche, Subatech
14
15 #ifndef ROOT_TObject
16 #  include "TObject.h"
17 #endif
18 #ifndef ROOT_TString
19 #  include "TString.h"
20 #endif
21 #ifndef ALIMUONATTPAINTER_H
22 #  include "AliMUONAttPainter.h"
23 #endif
24
25 class AliMUONVPainter;
26 class AliMUONVTrackerData;
27 class TObjArray;
28
29 class AliMUONPainterMatrix : public TObject
30 {
31 public:
32   AliMUONPainterMatrix(const char* basename="", Int_t nx=1, Int_t ny=1);
33   virtual ~AliMUONPainterMatrix();
34   
35   /// Adopt a painter in this matrix
36   void Adopt(AliMUONVPainter* painter);
37   
38   using TObject::Clone;
39   
40   AliMUONPainterMatrix* Clone(const AliMUONAttPainter& attributes) const;
41
42   void Connect(const char* sourceMethod, const char* destClassName, 
43                void* destObject, const char* destMethod);
44     
45 //  void ChangeAttributes(const AliMUONAttPainter& attributes);
46   
47   /// Get our attributes
48   const AliMUONAttPainter& Attributes() const { return fAttributes; }
49   
50   /// Compute the data range for this matrix
51   void ComputeDataRange();
52   
53   /// Get the data range for this matrix
54   void GetDataRange(Double_t& dataMin, Double_t& dataMax) const;
55   
56   /// Get our name
57   virtual const char* GetName() const { return Name().Data(); }
58
59   static TString NameIt(const TString& basename, const AliMUONAttPainter& att);
60
61   /// Matrix name
62   virtual TString Name() const { return fName; }
63   
64   /// Base name (short name)
65   virtual TString Basename() const { return fBasename; }
66   
67   void GetTypes(TObjArray& types) const;
68
69   /// Number of painters to arrange in x-direction
70   Int_t Nx() const { return fNx; }
71   
72   /// Number of painters to arrange in y-direction
73   Int_t Ny() const { return fNy; }
74   
75   /// Get a painter
76   AliMUONVPainter* Painter(Int_t index) const;
77
78   /// Printout
79   void Print(Option_t* opt="") const;
80   
81   AliMUONVTrackerData* Data() const;
82   
83   TString DataPattern() const;
84   
85   Int_t DataIndex() const;
86   
87   void SetData(const char* pattern, AliMUONVTrackerData* d, Int_t indexInData);
88     
89   /// Force a given data range for all painter groups belonging to this matrix
90   void SetDataRange(Double_t min, Double_t max);
91   
92   void SetOutlined(const char* pattern, Bool_t value);
93
94   void SetResponder(const char* pattern);
95   
96   /// Number of painters (should be <= Nx*Ny)
97   Int_t Size() const;
98
99   /// Normalize attributes
100   AliMUONAttPainter Validate(const AliMUONAttPainter& att) const;
101   
102 private:
103   /// Not implemented
104   AliMUONPainterMatrix(const AliMUONPainterMatrix& rhs);
105   /// Not implemented
106   AliMUONPainterMatrix& operator=(const AliMUONPainterMatrix& rhs);
107
108   void UpdateAttributes();
109   
110 private:
111   TString fBasename; ///< base name of that matrix
112   TString fName; ///< complete name
113   Int_t fNx; ///< number of rows
114   Int_t fNy; ///< number of columns
115   TObjArray* fPainters; ///< painters in that matrix
116   AliMUONAttPainter fAttributes; ///< attributes of our painter(s)
117   
118   ClassDef(AliMUONPainterMatrix,1) // Matrix of AliMUONVPainter
119 };
120
121 #endif