]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpGraphContext.h
Coding conventions corrections only
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpGraphContext.h
1 // $Id$
2 // Category: graphics
3 //
4 // Class AliMpGraphContext
5 // -----------------------
6 // Class describing the correspondance between a given area
7 // in pad, and a zone of real (cm) position
8 //
9 // Author: David GUEZ, IPN Orsay
10
11 #ifndef ALI_MP_GRAPH_CONTEXT_H
12 #define ALI_MP_GRAPH_CONTEXT_H
13
14 #include <TObject.h>
15 #include <TVector2.h>
16
17 #include "AliMpGraphicsTypes.h"
18
19 class MPainter;
20
21 class AliMpGraphContext : public TObject
22 {
23  public:
24   void Push() const;
25   void Pop();
26   static AliMpGraphContext *Instance();
27
28   // set methods
29
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;}
35
36   // get methods
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;}
42
43   //methods
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);
50
51  private:
52   //private constructor (not instanciable from outside)
53   AliMpGraphContext();
54
55   // static data members
56   static AliMpGraphContext *fgInstance;   // the global instance
57   static GraphContextVector fgStack;  // the object statck
58
59   //data members
60   Int_t    fColor;          // color to use
61   TVector2 fPadPosition;    // Position of the pad area where to draw
62   TVector2 fPadDimensions;   // Dimensions of the pad area where to draw
63
64   TVector2 fRealPosition;   // Position of the real area to draw
65   TVector2 fRealDimensions;  // Dimensions of the real area to draw
66
67   ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world
68 };
69
70 #endif //ALI_MP_GRAPH_CONTEXT_H
71
72