4 // Class AliMpGraphContext
5 // -----------------------
6 // Class describing the correspondance between a given area
7 // in pad, and a zone of real (cm) position
9 // Author: David GUEZ, IPN Orsay
11 #ifndef ALI_MP_GRAPH_CONTEXT_H
12 #define ALI_MP_GRAPH_CONTEXT_H
17 #include "AliMpGraphicsTypes.h"
21 class AliMpGraphContext : public TObject
26 static AliMpGraphContext *Instance();
30 void SetPadPosition(const TVector2 &position){fPadPosition=position;}
31 void SetPadDimensions(const TVector2 &dimensions){fPadDimensions=dimensions;}
32 void SetRealPosition(const TVector2 &position){fRealPosition=position;}
33 void SetRealDimensions(const TVector2 &dimensions){fRealDimensions=dimensions;}
34 void SetColor(Int_t color){fColor=color;}
37 TVector2 GetPadPosition() const {return fPadPosition;}
38 TVector2 GetPadDimensions() const {return fPadDimensions;}
39 TVector2 GetRealPosition() const{return fRealPosition;}
40 TVector2 GetRealDimensions() const{return fRealDimensions;}
41 Int_t GetColor() const {return fColor;}
44 TVector2 RealToPad(const TVector2 &position) const;
45 void RealToPad(const TVector2 &position
46 ,const TVector2 &dimensions,
47 TVector2 &padPosition,
48 TVector2 &padDimensions) const;
49 void SetPadPosForReal(const TVector2 &position,const TVector2 &dimensions);
52 AliMpGraphContext(const AliMpGraphContext& right);
53 AliMpGraphContext& operator = (const AliMpGraphContext& right);
56 //private constructor (not instanciable from outside)
59 // static data members
60 static AliMpGraphContext *fgInstance; // the global instance
61 static GraphContextVector fgStack; // the object stack
63 static Int_t fgStackSize; // the object stack size
67 Int_t fColor; // color to use
68 TVector2 fPadPosition; // Position of the pad area where to draw
69 TVector2 fPadDimensions; // Dimensions of the pad area where to draw
71 TVector2 fRealPosition; // Position of the real area to draw
72 TVector2 fRealDimensions; // Dimensions of the real area to draw
74 ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world
77 #endif //ALI_MP_GRAPH_CONTEXT_H