]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpVPainter.h
adaption to new logging class, added functionality to AliHLTSystem to build a task...
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpVPainter.h
1 // $Id$
2 // Category: graphics
3 //
4 // Class AliMpVPainter
5 // --------------
6 // Class for drawing objects into canvas
7 //
8 // Authors: David Guez, IPN Orsay
9
10 #ifndef ALI_MP_V_PAINTER_H
11 #define ALI_MP_V_PAINTER_H
12
13 #include <TObject.h>
14 #include <TVector2.h>
15
16 class TList;
17
18 class AliMpVPainter : public TObject
19 {
20  public:
21   AliMpVPainter();
22   virtual ~AliMpVPainter();
23
24   void DumpObject() const; // *MENU*
25   virtual void Paint(Option_t *option)=0;
26   virtual TObject* Clone(const char* newname="") const;
27   virtual TObject* DrawClone(Option_t* option) const; // *MENU*
28
29   // get methods
30   TVector2 GetPadPosition() const {return fPadPosition;}
31   TVector2 GetPadDimensions() const {return fPadDimensions;}
32   Int_t GetColor() const {return fColor;}
33
34   // set methods
35   void SetPadPosition(const TVector2 &padPosition){fPadPosition=padPosition;}
36   void SetPadDimension(const TVector2 &padDimensions){fPadDimensions=padDimensions;}
37   void SetColor(Int_t color){fColor=color;}
38
39   // methods
40   Bool_t IsInside(const TVector2 &point,const TVector2& pos,const TVector2& dim);
41   virtual TVector2 GetPosition() const=0;
42   virtual TVector2 GetDimensions() const=0;
43   void InitGraphContext();
44   void PaintWholeBox(Bool_t fill=kTRUE);
45   virtual Int_t DistancetoPrimitive(Int_t x, Int_t y);
46   TVector2 RealToPad(const TVector2& realPos);
47
48   static AliMpVPainter *CreatePainter(TObject *object);
49
50  protected:
51   AliMpVPainter(const AliMpVPainter& right);
52   AliMpVPainter&  operator = (const AliMpVPainter& right);
53   
54   void AddPainter(AliMpVPainter *painter);
55   AliMpVPainter *DrawObject(TObject *object,Option_t *option="");
56
57  private:
58   Int_t fColor;               //  color
59   TVector2 fPadPosition;      // position inside the graphics pad
60   TVector2 fPadDimensions;    // dimensions inside the graphics pad
61   TList *fTrashList;           // list of painter object created
62   ClassDef(AliMpVPainter,1) // abstract object painter
63 };
64
65 #endif //ALI_MP_V_PAINTER_H