]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpVPainter.h
New macro to keep track of timing performances of the segmentation methods (Laurent)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpVPainter.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$
5 // $MpId: AliMpVPainter.h,v 1.8 2006/05/24 13:58:13 ivana Exp $
6
7 /// \ingroup mpgraphics
8 /// \class AliMpVPainter
9 /// \brief Abstract base class for drawing objects into canvas
10 ///
11 /// \author David Guez, IPN Orsay
12
13 #ifndef ALI_MP_V_PAINTER_H
14 #define ALI_MP_V_PAINTER_H
15
16 #include <TObject.h>
17 #include <TVector2.h>
18
19 class TList;
20
21 class AliMpVPainter : public TObject
22 {
23  public:
24   AliMpVPainter();
25   virtual ~AliMpVPainter();
26
27   void DumpObject() const; // *MENU*
28           /// Paint the associated object
29   virtual void Paint(Option_t *option)=0;
30   virtual TObject* Clone(const char* newname="") const;
31   virtual TObject* DrawClone(Option_t* option) const; // *MENU*
32
33   //
34   // get methods
35   //
36            /// Return the position inside the graphics pad
37   TVector2 GetPadPosition() const {return fPadPosition;}
38            /// Return the dimensions inside the graphics pad
39   TVector2 GetPadDimensions() const {return fPadDimensions;}
40            /// Return the color
41   Int_t GetColor() const {return fColor;}
42
43   //
44   // set methods
45   //
46            /// Set the position inside the graphics pad
47   void SetPadPosition(const TVector2 &padPosition){fPadPosition=padPosition;}
48            /// Set the dimensions inside the graphics pad
49   void SetPadDimension(const TVector2 &padDimensions){fPadDimensions=padDimensions;}
50            /// Set the color
51   void SetColor(Int_t color){fColor=color;}
52
53   //
54   // methods
55   //
56   Bool_t IsInside(const TVector2 &point,const TVector2& pos,const TVector2& dim);
57           /// Return the owned object's position
58   virtual TVector2 GetPosition() const=0;
59           /// Return the owned object's dimensions
60   virtual TVector2 GetDimensions() const=0;
61   void InitGraphContext();
62   void PaintWholeBox(Bool_t fill=kTRUE);
63   virtual Int_t DistancetoPrimitive(Int_t x, Int_t y);
64   TVector2 RealToPad(const TVector2& realPos);
65
66   static AliMpVPainter *CreatePainter(TObject *object);
67
68  protected:
69   /// Not implemented
70   void AddPainter(AliMpVPainter *painter);
71   /// Not implemented
72   AliMpVPainter *DrawObject(TObject *object,Option_t *option="");
73
74  private:
75   /// Not implemented
76   AliMpVPainter(const AliMpVPainter& right);
77   /// Not implemented
78   AliMpVPainter&  operator = (const AliMpVPainter& right);
79
80   Int_t fColor;            ///< color
81   TVector2 fPadPosition;   ///< position inside the graphics pad
82   TVector2 fPadDimensions; ///< dimensions inside the graphics pad
83   TList *fTrashList;       ///< list of painter object created
84
85   ClassDef(AliMpVPainter,1) // abstract object painter
86 };
87
88 #endif //ALI_MP_V_PAINTER_H