]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONPainterGroup.h
Updates
[u/mrichter/AliRoot.git] / MUON / AliMUONPainterGroup.h
1 #ifndef ALIMUONPAINTERGROUP_H
2 #define ALIMUONPAINTERGROUP_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 AliMUONPainterGroup
11 /// \brief A group 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
22 class AliMUONVPainter;
23 class AliMUONVTrackerData;
24
25 class AliMUONPainterGroup : public TObject
26 {
27 public:
28   AliMUONPainterGroup();
29   AliMUONPainterGroup(const char* type, Int_t depth);
30   virtual ~AliMUONPainterGroup();
31   
32   Bool_t Add(AliMUONVPainter* painter);
33   
34   void ComputeDataRange(Double_t& dataMin, Double_t& dataMax);
35   
36   /// Return the data we are plotting
37   AliMUONVTrackerData* Data() const { return fData; }
38   
39   /// Return the index within the data
40   Int_t DataIndex() const { return fDataIndex; }
41   
42   /// Max data we are plotting
43   Double_t DataMax() const { return fDataMax; }
44   
45   /// Min data we are plotting
46   Double_t DataMin() const { return fDataMin; }
47   
48   /// Depth
49   Int_t Depth() const { return fDepth; }
50   
51   void Draw(Option_t* opt="");
52   
53   AliMUONVPainter* First() const;
54   
55   /// We are sortable (by type)
56   Bool_t IsSortable() const { return kTRUE; }
57   
58   Int_t Compare(const TObject* obj) const;
59   
60   /// Whether we should outline ourselves
61   Bool_t IsOutlined() const { return fIsOutlined; }
62   
63   /// Whether we are the plotting group
64   Bool_t IsPlotter() const { return fData != 0 && fDataIndex >= 0; }
65
66   /// Whether we are the responder group
67   Bool_t IsResponder() const { return fIsResponder; }
68   
69   /// Whether we are visible
70   Bool_t IsVisible() const { return fIsVisible; }
71   
72   Bool_t Matches(const char* pattern) const;
73   
74   void Print(Option_t* opt="") const;
75   
76   void SetData(AliMUONVTrackerData* data, Int_t dataIndex);
77   
78   /// Set the data range
79   void SetDataRange(Double_t min, Double_t max)
80   { fDataMin = min; fDataMax = max; }
81   
82   Int_t GetLineColor() const;
83   
84   Int_t GetLineWidth() const;
85   
86   void SetLine(Int_t lineColor, Int_t lineWidth);
87   
88   /// Set the outlined flag
89   void SetOutlined(Bool_t flag=kTRUE) { fIsOutlined = flag; }
90   
91   /// Set the responder flag
92   void SetResponder(Bool_t flag=kTRUE) { fIsResponder = flag; }
93   
94   /// Set the visible flag
95   void SetVisible(Bool_t flag=kTRUE) { fIsVisible = flag; }
96   
97   /// Our type
98   const char* Type() const { return fType.Data(); }
99   
100 private:
101   /// Not implemented
102   AliMUONPainterGroup(const AliMUONPainterGroup& rhs);
103   /// Not implemented
104   AliMUONPainterGroup& operator=(const AliMUONPainterGroup& rhs);
105   
106 private:
107   TString fType; ///< type of this group (e.g. PADS, MANU, PCB, etc...)
108   Bool_t fIsResponder; ///< whether we are responding to mouse events
109   Bool_t fIsVisible; ///< whether we are visible
110   AliMUONVTrackerData* fData; ///< the data we plot (can be 0x0)
111   Int_t fDataIndex; ///< the index of the data to plot (can be -1 if data=0x0)
112   Double_t fDataMin; ///< min data
113   Double_t fDataMax; ///< max data
114   TObjArray* fPainters; ///< painters of this group
115   Int_t fDepth; ///< depth in the hierarchy of painters
116   Bool_t fIsOutlined; ///< whether we should be outlined
117   
118   ClassDef(AliMUONPainterGroup,1) // Group of AliMUONVPainter
119 };
120
121 #endif