]>
Commit | Line | Data |
---|---|---|
dee1d5f1 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
5f91c9e8 | 4 | // $Id$ |
13985652 | 5 | // $MpId: AliMpVPainter.h,v 1.8 2006/05/24 13:58:13 ivana Exp $ |
dee1d5f1 | 6 | |
7 | /// \ingroup graphics | |
8 | /// \class AliMpVPainter | |
9 | /// \brief Abstract base class for drawing objects into canvas | |
10 | /// | |
13985652 | 11 | /// \author David Guez, IPN Orsay |
5f91c9e8 | 12 | |
13 | #ifndef ALI_MP_V_PAINTER_H | |
14 | #define ALI_MP_V_PAINTER_H | |
15 | ||
16 | #include <TObject.h> | |
5f91c9e8 | 17 | #include <TVector2.h> |
2998a151 | 18 | |
19 | class TList; | |
5f91c9e8 | 20 | |
21 | class AliMpVPainter : public TObject | |
22 | { | |
23 | public: | |
24 | AliMpVPainter(); | |
25 | virtual ~AliMpVPainter(); | |
fb1bf5c0 | 26 | |
5f91c9e8 | 27 | void DumpObject() const; // *MENU* |
28 | virtual void Paint(Option_t *option)=0; | |
29 | virtual TObject* Clone(const char* newname="") const; | |
30 | virtual TObject* DrawClone(Option_t* option) const; // *MENU* | |
fb1bf5c0 | 31 | |
5f91c9e8 | 32 | // get methods |
33 | TVector2 GetPadPosition() const {return fPadPosition;} | |
34 | TVector2 GetPadDimensions() const {return fPadDimensions;} | |
35 | Int_t GetColor() const {return fColor;} | |
36 | ||
37 | // set methods | |
38 | void SetPadPosition(const TVector2 &padPosition){fPadPosition=padPosition;} | |
39 | void SetPadDimension(const TVector2 &padDimensions){fPadDimensions=padDimensions;} | |
40 | void SetColor(Int_t color){fColor=color;} | |
41 | ||
42 | // methods | |
43 | Bool_t IsInside(const TVector2 &point,const TVector2& pos,const TVector2& dim); | |
44 | virtual TVector2 GetPosition() const=0; | |
45 | virtual TVector2 GetDimensions() const=0; | |
46 | void InitGraphContext(); | |
47 | void PaintWholeBox(Bool_t fill=kTRUE); | |
48 | virtual Int_t DistancetoPrimitive(Int_t x, Int_t y); | |
49 | TVector2 RealToPad(const TVector2& realPos); | |
50 | ||
51 | static AliMpVPainter *CreatePainter(TObject *object); | |
fb1bf5c0 | 52 | |
5f91c9e8 | 53 | protected: |
54 | void AddPainter(AliMpVPainter *painter); | |
55 | AliMpVPainter *DrawObject(TObject *object,Option_t *option=""); | |
fb1bf5c0 | 56 | |
5f91c9e8 | 57 | private: |
13e7956b | 58 | AliMpVPainter(const AliMpVPainter& right); |
59 | AliMpVPainter& operator = (const AliMpVPainter& right); | |
60 | ||
829425a5 | 61 | Int_t fColor; ///< color |
62 | TVector2 fPadPosition; ///< position inside the graphics pad | |
63 | TVector2 fPadDimensions; ///< dimensions inside the graphics pad | |
64 | TList *fTrashList; ///< list of painter object created | |
65 | ||
5f91c9e8 | 66 | ClassDef(AliMpVPainter,1) // abstract object painter |
67 | }; | |
68 | ||
69 | #endif //ALI_MP_V_PAINTER_H |