ENDIF replaced by endif (compilation problems)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpGraphContext.h
CommitLineData
5f91c9e8 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
2998a151 11#ifndef ALI_MP_GRAPH_CONTEXT_H
12#define ALI_MP_GRAPH_CONTEXT_H
5f91c9e8 13
14#include <TObject.h>
15#include <TVector2.h>
16
17#include "AliMpGraphicsTypes.h"
18
19class MPainter;
20
2998a151 21class AliMpGraphContext : public TObject
22{
5f91c9e8 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
f79c58a5 57 static GraphContextVector fgStack; // the object stack
58#ifdef WITH_ROOT
59 static Int_t fgStackSize; // the object stack size
60#endif
5f91c9e8 61
62 //data members
63 Int_t fColor; // color to use
64 TVector2 fPadPosition; // Position of the pad area where to draw
65 TVector2 fPadDimensions; // Dimensions of the pad area where to draw
66
67 TVector2 fRealPosition; // Position of the real area to draw
68 TVector2 fRealDimensions; // Dimensions of the real area to draw
69
70 ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world
71};
72
2998a151 73#endif //ALI_MP_GRAPH_CONTEXT_H
5f91c9e8 74
75