]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpGraphContext.h
Previous commit had the bad side-effect of changing the behaviour of Raw QA to comput...
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpGraphContext.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: AliMpGraphContext.h,v 1.11 2006/05/24 13:58:13 ivana Exp $
dee1d5f1 6
0145e89a 7/// \ingroup mpgraphics
dee1d5f1 8/// \class AliMpGraphContext
9/// \brief Class describing the correspondance between a given area
10/// in pad, and a zone of real (cm) position
11///
13985652 12/// \author David GUEZ, IPN Orsay
5f91c9e8 13
2998a151 14#ifndef ALI_MP_GRAPH_CONTEXT_H
15#define ALI_MP_GRAPH_CONTEXT_H
5f91c9e8 16
2a7ea2e6 17#include <TObject.h>
5006ec94 18
5006ec94 19#include "AliMpExMap.h"
5006ec94 20
2294822d 21#include <TVector2.h>
5f91c9e8 22
5f91c9e8 23class MPainter;
24
2998a151 25class AliMpGraphContext : public TObject
26{
5f91c9e8 27 public:
28 void Push() const;
29 void Pop();
30 static AliMpGraphContext *Instance();
31
f5671fc3 32 //
5f91c9e8 33 // set methods
f5671fc3 34 //
35 /// Set position of the pad area where to draw
5f91c9e8 36 void SetPadPosition(const TVector2 &position){fPadPosition=position;}
f5671fc3 37 /// Set dimensions of the pad area where to draw
5f91c9e8 38 void SetPadDimensions(const TVector2 &dimensions){fPadDimensions=dimensions;}
f5671fc3 39 /// Set position of the real area where to draw
5f91c9e8 40 void SetRealPosition(const TVector2 &position){fRealPosition=position;}
f5671fc3 41 /// Set dimensions of the real area where to draw
5f91c9e8 42 void SetRealDimensions(const TVector2 &dimensions){fRealDimensions=dimensions;}
f5671fc3 43 /// Set color to use
5f91c9e8 44 void SetColor(Int_t color){fColor=color;}
45
f5671fc3 46 //
5f91c9e8 47 // get methods
f5671fc3 48 //
49
50 /// Return position of the pad area where to draw
5f91c9e8 51 TVector2 GetPadPosition() const {return fPadPosition;}
f5671fc3 52 /// Return dimensions of the pad area where to draw
5f91c9e8 53 TVector2 GetPadDimensions() const {return fPadDimensions;}
f5671fc3 54 /// Return position of the real area where to draw
5f91c9e8 55 TVector2 GetRealPosition() const{return fRealPosition;}
f5671fc3 56 /// Return dimensions of the real area where to draw
5f91c9e8 57 TVector2 GetRealDimensions() const{return fRealDimensions;}
f5671fc3 58 /// Return color to use
5f91c9e8 59 Int_t GetColor() const {return fColor;}
60
61 //methods
62 TVector2 RealToPad(const TVector2 &position) const;
63 void RealToPad(const TVector2 &position
64 ,const TVector2 &dimensions,
65 TVector2 &padPosition,
66 TVector2 &padDimensions) const;
67 void SetPadPosForReal(const TVector2 &position,const TVector2 &dimensions);
68
fb1bf5c0 69 protected:
70 AliMpGraphContext(const AliMpGraphContext& right);
71 AliMpGraphContext& operator = (const AliMpGraphContext& right);
72
5f91c9e8 73 private:
74 //private constructor (not instanciable from outside)
75 AliMpGraphContext();
76
829425a5 77 ///< static data members
2294822d 78 static AliMpGraphContext* fgInstance; ///< the global instance
79 static TObjArray fgStack; ///< the object stack
80 static Int_t fgStackSize;///< the object stack size
5f91c9e8 81
82 //data members
829425a5 83 Int_t fColor; ///< color to use
84 TVector2 fPadPosition; ///< Position of the pad area where to draw
85 TVector2 fPadDimensions; ///< Dimensions of the pad area where to draw
5f91c9e8 86
829425a5 87 TVector2 fRealPosition; ///< Position of the real area to draw
88 TVector2 fRealDimensions; ///< Dimensions of the real area to draw
5f91c9e8 89
90 ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world
91};
92
2998a151 93#endif //ALI_MP_GRAPH_CONTEXT_H
5f91c9e8 94
95