6 // Class for drawing objects into canvas
8 // Authors: David Guez, IPN Orsay
10 #ifndef ALI_MP_V_PAINTER_H
11 #define ALI_MP_V_PAINTER_H
18 class AliMpVPainter : public TObject
22 virtual ~AliMpVPainter();
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*
30 TVector2 GetPadPosition() const {return fPadPosition;}
31 TVector2 GetPadDimensions() const {return fPadDimensions;}
32 Int_t GetColor() const {return fColor;}
35 void SetPadPosition(const TVector2 &padPosition){fPadPosition=padPosition;}
36 void SetPadDimension(const TVector2 &padDimensions){fPadDimensions=padDimensions;}
37 void SetColor(Int_t color){fColor=color;}
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);
48 static AliMpVPainter *CreatePainter(TObject *object);
51 AliMpVPainter(const AliMpVPainter& right);
52 AliMpVPainter& operator = (const AliMpVPainter& right);
54 void AddPainter(AliMpVPainter *painter);
55 AliMpVPainter *DrawObject(TObject *object,Option_t *option="");
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
65 #endif //ALI_MP_V_PAINTER_H