1 #ifndef ALIMUONPAINTERGROUP_H
2 #define ALIMUONPAINTERGROUP_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONPainterGroup
11 /// \brief A group of AliMUONVPainter
13 // Author Laurent Aphecetche, Subatech
22 class AliMUONVPainter;
23 class AliMUONVTrackerData;
25 class AliMUONPainterGroup : public TObject
28 AliMUONPainterGroup();
29 AliMUONPainterGroup(const char* type, Int_t depth);
30 virtual ~AliMUONPainterGroup();
32 Bool_t Add(AliMUONVPainter* painter);
34 void ComputeDataRange(Double_t& dataMin, Double_t& dataMax);
36 /// Return the data we are plotting
37 AliMUONVTrackerData* Data() const { return fData; }
39 /// Return the index within the data
40 Int_t DataIndex() const { return fDataIndex; }
42 /// Max data we are plotting
43 Double_t DataMax() const { return fDataMax; }
45 /// Min data we are plotting
46 Double_t DataMin() const { return fDataMin; }
49 Int_t Depth() const { return fDepth; }
51 void Draw(Option_t* opt="");
53 AliMUONVPainter* First() const;
55 /// We are sortable (by type)
56 Bool_t IsSortable() const { return kTRUE; }
58 Int_t Compare(const TObject* obj) const;
60 /// Whether we should outline ourselves
61 Bool_t IsOutlined() const { return fIsOutlined; }
63 /// Whether we are the plotting group
64 Bool_t IsPlotter() const { return fData != 0 && fDataIndex >= 0; }
66 /// Whether we are the responder group
67 Bool_t IsResponder() const { return fIsResponder; }
69 /// Whether we are visible
70 Bool_t IsVisible() const { return fIsVisible; }
72 Bool_t Matches(const char* pattern) const;
74 void Print(Option_t* opt="") const;
76 void SetData(AliMUONVTrackerData* data, Int_t dataIndex);
78 /// Set the data range
79 void SetDataRange(Double_t min, Double_t max)
80 { fDataMin = min; fDataMax = max; }
82 Int_t GetLineColor() const;
84 Int_t GetLineWidth() const;
86 void SetLine(Int_t lineColor, Int_t lineWidth);
88 /// Set the outlined flag
89 void SetOutlined(Bool_t flag=kTRUE) { fIsOutlined = flag; }
91 /// Set the responder flag
92 void SetResponder(Bool_t flag=kTRUE) { fIsResponder = flag; }
94 /// Set the visible flag
95 void SetVisible(Bool_t flag=kTRUE) { fIsVisible = flag; }
98 const char* Type() const { return fType.Data(); }
102 AliMUONPainterGroup(const AliMUONPainterGroup& rhs);
104 AliMUONPainterGroup& operator=(const AliMUONPainterGroup& rhs);
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
118 ClassDef(AliMUONPainterGroup,1) // Group of AliMUONVPainter