ROOT logo
#ifndef ALIMUONPAINTERGROUP_H
#define ALIMUONPAINTERGROUP_H

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice                               */

// $Id$

/// \ingroup graphics
/// \class AliMUONPainterGroup
/// \brief A group of AliMUONVPainter
/// 
// Author Laurent Aphecetche, Subatech

#ifndef ROOT_TObject
#  include "TObject.h"
#endif
#ifndef ROOT_TString
#  include "TString.h"
#endif

class AliMUONVPainter;
class AliMUONVTrackerData;

class AliMUONPainterGroup : public TObject
{
public:
  AliMUONPainterGroup();
  AliMUONPainterGroup(const char* type, Int_t depth);
  virtual ~AliMUONPainterGroup();
  
  Bool_t Add(AliMUONVPainter* painter);
  
  void ComputeDataRange(Double_t& dataMin, Double_t& dataMax);
  
  /// Return the data we are plotting
  AliMUONVTrackerData* Data() const { return fData; }
  
  /// Return the index within the data
  Int_t DataIndex() const { return fDataIndex; }
  
  /// Max data we are plotting
  Double_t DataMax() const { return fDataMax; }
  
  /// Min data we are plotting
  Double_t DataMin() const { return fDataMin; }
  
  /// Depth
  Int_t Depth() const { return fDepth; }
  
  void Draw(Option_t* opt="");
  
  AliMUONVPainter* First() const;
  
  /// We are sortable (by type)
  Bool_t IsSortable() const { return kTRUE; }
  
  Int_t Compare(const TObject* obj) const;
  
  /// Whether we should outline ourselves
  Bool_t IsOutlined() const { return fIsOutlined; }
  
  /// Whether we are the plotting group
  Bool_t IsPlotter() const { return fData != 0 && fDataIndex >= 0; }

  /// Whether we are the responder group
  Bool_t IsResponder() const { return fIsResponder; }
  
  /// Whether we are visible
  Bool_t IsVisible() const { return fIsVisible; }
  
  Bool_t Matches(const char* pattern) const;
  
  void Print(Option_t* opt="") const;
  
  void SetData(AliMUONVTrackerData* data, Int_t dataIndex);
  
  /// Set the data range
  void SetDataRange(Double_t min, Double_t max)
  { fDataMin = min; fDataMax = max; }
  
  Int_t GetLineColor() const;
  
  Int_t GetLineWidth() const;
  
  void SetLine(Int_t lineColor, Int_t lineWidth);
  
  /// Set the outlined flag
  void SetOutlined(Bool_t flag=kTRUE) { fIsOutlined = flag; }
  
  /// Set the responder flag
  void SetResponder(Bool_t flag=kTRUE) { fIsResponder = flag; }
  
  /// Set the visible flag
  void SetVisible(Bool_t flag=kTRUE) { fIsVisible = flag; }
  
  /// Our type
  const char* Type() const { return fType.Data(); }
  
private:
  /// Not implemented
  AliMUONPainterGroup(const AliMUONPainterGroup& rhs);
  /// Not implemented
  AliMUONPainterGroup& operator=(const AliMUONPainterGroup& rhs);
  
private:
  TString fType; ///< type of this group (e.g. PADS, MANU, PCB, etc...)
  Bool_t fIsResponder; ///< whether we are responding to mouse events
  Bool_t fIsVisible; ///< whether we are visible
  AliMUONVTrackerData* fData; ///< the data we plot (can be 0x0)
  Int_t fDataIndex; ///< the index of the data to plot (can be -1 if data=0x0)
  Double_t fDataMin; ///< min data
  Double_t fDataMax; ///< max data
  TObjArray* fPainters; ///< painters of this group
  Int_t fDepth; ///< depth in the hierarchy of painters
  Bool_t fIsOutlined; ///< whether we should be outlined
  
  ClassDef(AliMUONPainterGroup,1) // Group of AliMUONVPainter
};

#endif
 AliMUONPainterGroup.h:1
 AliMUONPainterGroup.h:2
 AliMUONPainterGroup.h:3
 AliMUONPainterGroup.h:4
 AliMUONPainterGroup.h:5
 AliMUONPainterGroup.h:6
 AliMUONPainterGroup.h:7
 AliMUONPainterGroup.h:8
 AliMUONPainterGroup.h:9
 AliMUONPainterGroup.h:10
 AliMUONPainterGroup.h:11
 AliMUONPainterGroup.h:12
 AliMUONPainterGroup.h:13
 AliMUONPainterGroup.h:14
 AliMUONPainterGroup.h:15
 AliMUONPainterGroup.h:16
 AliMUONPainterGroup.h:17
 AliMUONPainterGroup.h:18
 AliMUONPainterGroup.h:19
 AliMUONPainterGroup.h:20
 AliMUONPainterGroup.h:21
 AliMUONPainterGroup.h:22
 AliMUONPainterGroup.h:23
 AliMUONPainterGroup.h:24
 AliMUONPainterGroup.h:25
 AliMUONPainterGroup.h:26
 AliMUONPainterGroup.h:27
 AliMUONPainterGroup.h:28
 AliMUONPainterGroup.h:29
 AliMUONPainterGroup.h:30
 AliMUONPainterGroup.h:31
 AliMUONPainterGroup.h:32
 AliMUONPainterGroup.h:33
 AliMUONPainterGroup.h:34
 AliMUONPainterGroup.h:35
 AliMUONPainterGroup.h:36
 AliMUONPainterGroup.h:37
 AliMUONPainterGroup.h:38
 AliMUONPainterGroup.h:39
 AliMUONPainterGroup.h:40
 AliMUONPainterGroup.h:41
 AliMUONPainterGroup.h:42
 AliMUONPainterGroup.h:43
 AliMUONPainterGroup.h:44
 AliMUONPainterGroup.h:45
 AliMUONPainterGroup.h:46
 AliMUONPainterGroup.h:47
 AliMUONPainterGroup.h:48
 AliMUONPainterGroup.h:49
 AliMUONPainterGroup.h:50
 AliMUONPainterGroup.h:51
 AliMUONPainterGroup.h:52
 AliMUONPainterGroup.h:53
 AliMUONPainterGroup.h:54
 AliMUONPainterGroup.h:55
 AliMUONPainterGroup.h:56
 AliMUONPainterGroup.h:57
 AliMUONPainterGroup.h:58
 AliMUONPainterGroup.h:59
 AliMUONPainterGroup.h:60
 AliMUONPainterGroup.h:61
 AliMUONPainterGroup.h:62
 AliMUONPainterGroup.h:63
 AliMUONPainterGroup.h:64
 AliMUONPainterGroup.h:65
 AliMUONPainterGroup.h:66
 AliMUONPainterGroup.h:67
 AliMUONPainterGroup.h:68
 AliMUONPainterGroup.h:69
 AliMUONPainterGroup.h:70
 AliMUONPainterGroup.h:71
 AliMUONPainterGroup.h:72
 AliMUONPainterGroup.h:73
 AliMUONPainterGroup.h:74
 AliMUONPainterGroup.h:75
 AliMUONPainterGroup.h:76
 AliMUONPainterGroup.h:77
 AliMUONPainterGroup.h:78
 AliMUONPainterGroup.h:79
 AliMUONPainterGroup.h:80
 AliMUONPainterGroup.h:81
 AliMUONPainterGroup.h:82
 AliMUONPainterGroup.h:83
 AliMUONPainterGroup.h:84
 AliMUONPainterGroup.h:85
 AliMUONPainterGroup.h:86
 AliMUONPainterGroup.h:87
 AliMUONPainterGroup.h:88
 AliMUONPainterGroup.h:89
 AliMUONPainterGroup.h:90
 AliMUONPainterGroup.h:91
 AliMUONPainterGroup.h:92
 AliMUONPainterGroup.h:93
 AliMUONPainterGroup.h:94
 AliMUONPainterGroup.h:95
 AliMUONPainterGroup.h:96
 AliMUONPainterGroup.h:97
 AliMUONPainterGroup.h:98
 AliMUONPainterGroup.h:99
 AliMUONPainterGroup.h:100
 AliMUONPainterGroup.h:101
 AliMUONPainterGroup.h:102
 AliMUONPainterGroup.h:103
 AliMUONPainterGroup.h:104
 AliMUONPainterGroup.h:105
 AliMUONPainterGroup.h:106
 AliMUONPainterGroup.h:107
 AliMUONPainterGroup.h:108
 AliMUONPainterGroup.h:109
 AliMUONPainterGroup.h:110
 AliMUONPainterGroup.h:111
 AliMUONPainterGroup.h:112
 AliMUONPainterGroup.h:113
 AliMUONPainterGroup.h:114
 AliMUONPainterGroup.h:115
 AliMUONPainterGroup.h:116
 AliMUONPainterGroup.h:117
 AliMUONPainterGroup.h:118
 AliMUONPainterGroup.h:119
 AliMUONPainterGroup.h:120
 AliMUONPainterGroup.h:121