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