]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpVPainter.h
Updates to AddTask macro from Chris
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpVPainter.h
CommitLineData
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
0145e89a 7/// \ingroup mpgraphics
dee1d5f1 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
19class TList;
5f91c9e8 20
21class AliMpVPainter : public TObject
22{
23 public:
24 AliMpVPainter();
25 virtual ~AliMpVPainter();
fb1bf5c0 26
5f91c9e8 27 void DumpObject() const; // *MENU*
f5671fc3 28 /// Paint the associated object
5f91c9e8 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*
fb1bf5c0 32
f5671fc3 33 //
5f91c9e8 34 // get methods
f5671fc3 35 //
36 /// Return the position inside the graphics pad
5f91c9e8 37 TVector2 GetPadPosition() const {return fPadPosition;}
f5671fc3 38 /// Return the dimensions inside the graphics pad
5f91c9e8 39 TVector2 GetPadDimensions() const {return fPadDimensions;}
f5671fc3 40 /// Return the color
5f91c9e8 41 Int_t GetColor() const {return fColor;}
42
f5671fc3 43 //
5f91c9e8 44 // set methods
f5671fc3 45 //
46 /// Set the position inside the graphics pad
5f91c9e8 47 void SetPadPosition(const TVector2 &padPosition){fPadPosition=padPosition;}
f5671fc3 48 /// Set the dimensions inside the graphics pad
5f91c9e8 49 void SetPadDimension(const TVector2 &padDimensions){fPadDimensions=padDimensions;}
f5671fc3 50 /// Set the color
5f91c9e8 51 void SetColor(Int_t color){fColor=color;}
52
f5671fc3 53 //
5f91c9e8 54 // methods
f5671fc3 55 //
5f91c9e8 56 Bool_t IsInside(const TVector2 &point,const TVector2& pos,const TVector2& dim);
f5671fc3 57 /// Return the owned object's position
5f91c9e8 58 virtual TVector2 GetPosition() const=0;
f5671fc3 59 /// Return the owned object's dimensions
5f91c9e8 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);
65
66 static AliMpVPainter *CreatePainter(TObject *object);
fb1bf5c0 67
5f91c9e8 68 protected:
f5671fc3 69 /// Not implemented
5f91c9e8 70 void AddPainter(AliMpVPainter *painter);
f5671fc3 71 /// Not implemented
5f91c9e8 72 AliMpVPainter *DrawObject(TObject *object,Option_t *option="");
fb1bf5c0 73
5f91c9e8 74 private:
f5671fc3 75 /// Not implemented
13e7956b 76 AliMpVPainter(const AliMpVPainter& right);
f5671fc3 77 /// Not implemented
13e7956b 78 AliMpVPainter& operator = (const AliMpVPainter& right);
79
829425a5 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
84
5f91c9e8 85 ClassDef(AliMpVPainter,1) // abstract object painter
86};
87
88#endif //ALI_MP_V_PAINTER_H