]>
Commit | Line | Data |
---|---|---|
5f91c9e8 | 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 <TClass.h> | |
15 | #include <TVector2.h> | |
16 | #include <TVirtualX.h> | |
17 | #include <TPad.h> | |
18 | #include <TList.h> | |
19 | ||
20 | class AliMpVPainter : public TObject | |
21 | { | |
22 | public: | |
23 | AliMpVPainter(); | |
24 | virtual ~AliMpVPainter(); | |
25 | void DumpObject() const; // *MENU* | |
26 | virtual void Paint(Option_t *option)=0; | |
27 | virtual TObject* Clone(const char* newname="") const; | |
28 | virtual TObject* DrawClone(Option_t* option) const; // *MENU* | |
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 | protected: | |
50 | void AddPainter(AliMpVPainter *painter); | |
51 | AliMpVPainter *DrawObject(TObject *object,Option_t *option=""); | |
52 | private: | |
53 | Int_t fColor; // color | |
54 | TVector2 fPadPosition; // position inside the graphics pad | |
55 | TVector2 fPadDimensions; // dimensions inside the graphics pad | |
56 | TList *fTrashList; // list of painter object created | |
57 | ClassDef(AliMpVPainter,1) // abstract object painter | |
58 | }; | |
59 | ||
60 | #endif //ALI_MP_V_PAINTER_H |