1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpVPainter.h,v 1.8 2006/05/24 13:58:13 ivana Exp $
7 /// \ingroup mpgraphics
8 /// \class AliMpVPainter
9 /// \brief Abstract base class for drawing objects into canvas
11 /// \author David Guez, IPN Orsay
13 #ifndef ALI_MP_V_PAINTER_H
14 #define ALI_MP_V_PAINTER_H
21 class AliMpVPainter : public TObject
25 virtual ~AliMpVPainter();
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*
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;}
41 Int_t GetColor() const {return fColor;}
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;}
51 void SetColor(Int_t color){fColor=color;}
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);
66 static AliMpVPainter *CreatePainter(TObject *object);
70 void AddPainter(AliMpVPainter *painter);
72 AliMpVPainter *DrawObject(TObject *object,Option_t *option="");
76 AliMpVPainter(const AliMpVPainter& right);
78 AliMpVPainter& operator = (const AliMpVPainter& right);
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
85 ClassDef(AliMpVPainter,1) // abstract object painter
88 #endif //ALI_MP_V_PAINTER_H