Line data Source code
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 : #include <string>
25 :
26 : class AliMUONVPainter;
27 : class AliMUONVTrackerData;
28 : class TObjArray;
29 : class TCanvas;
30 :
31 : class AliMUONPainterMatrix : public TObject
32 : {
33 : public:
34 : AliMUONPainterMatrix(const char* basename="", Int_t nx=1, Int_t ny=1);
35 : virtual ~AliMUONPainterMatrix();
36 :
37 : /// Adopt a painter in this matrix
38 : void Adopt(AliMUONVPainter* painter);
39 :
40 : using TObject::Clone;
41 :
42 : AliMUONPainterMatrix* Clone(const AliMUONAttPainter& attributes) const;
43 :
44 : void Connect(const char* sourceMethod, const char* destClassName,
45 : void* destObject, const char* destMethod);
46 :
47 : /// Get our attributes
48 0 : 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 matrix name
57 0 : virtual const char* GetName() const { return fName.Data(); }
58 :
59 : /// Base name (short name)
60 0 : const char* Basename() const { return fBasename.Data(); }
61 :
62 0 : const char* Whatname() const { return fWhatname.Data(); }
63 :
64 : void GetTypes(TObjArray& types) const;
65 :
66 : /// Number of painters to arrange in x-direction
67 0 : Int_t Nx() const { return fNx; }
68 :
69 : /// Number of painters to arrange in y-direction
70 0 : Int_t Ny() const { return fNy; }
71 :
72 : /// Get a painter
73 : AliMUONVPainter* Painter(Int_t index) const;
74 :
75 : /// Printout
76 : void Print(Option_t* opt="") const;
77 :
78 : AliMUONVTrackerData* Data() const;
79 :
80 : TString DataPattern() const;
81 :
82 : Int_t DataIndex() const;
83 :
84 : void SetData(const char* pattern, AliMUONVTrackerData* d, Int_t indexInData);
85 :
86 : /// Force a given data range for all painter groups belonging to this matrix
87 : void SetDataRange(Double_t min, Double_t max);
88 :
89 : void SetOutlined(const char* pattern, Bool_t value);
90 :
91 : void SetResponder(const char* pattern);
92 :
93 : /// Number of painters (should be <= Nx*Ny)
94 : Int_t Size() const;
95 :
96 : /// Normalize attributes
97 : AliMUONAttPainter Validate(const AliMUONAttPainter& att) const;
98 :
99 : static std::string NameIt(const char* what, const char* basename, const AliMUONAttPainter& att);
100 :
101 : void Draw(Option_t* opt="");
102 :
103 : TCanvas* CreateCanvas(Int_t x=0, Int_t y=0, Int_t w=-1, Int_t h=-1);
104 :
105 : private:
106 : /// Not implemented
107 : AliMUONPainterMatrix(const AliMUONPainterMatrix& rhs);
108 : /// Not implemented
109 : AliMUONPainterMatrix& operator=(const AliMUONPainterMatrix& rhs);
110 :
111 : void SetName();
112 : void UpdateAttributes();
113 :
114 : private:
115 : TString fBasename; ///< base name of that matrix
116 : TString fWhatname; ///< data name
117 : Int_t fNx; ///< number of rows
118 : Int_t fNy; ///< number of columns
119 : TObjArray* fPainters; ///< painters in that matrix
120 : AliMUONAttPainter fAttributes; ///< attributes of our painter(s)
121 : TString fName; ///< our name
122 :
123 12 : ClassDef(AliMUONPainterMatrix,3) // Matrix of AliMUONVPainter
124 : };
125 :
126 : #endif
|