AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpGraphContext.h
Go to the documentation of this file.
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice */
3 
4 // $Id$
5 // $MpId: AliMpGraphContext.h,v 1.11 2006/05/24 13:58:13 ivana Exp $
6 
13 
14 #ifndef ALI_MP_GRAPH_CONTEXT_H
15 #define ALI_MP_GRAPH_CONTEXT_H
16 
17 #include <TObject.h>
18 
19 #include "AliMpExMap.h"
20 
21 #include <TVector2.h>
22 
23 class MPainter;
24 
25 class AliMpGraphContext : public TObject
26 {
27  public:
28  void Push() const;
29  void Pop();
30  static AliMpGraphContext *Instance();
31 
32  //
33  // set methods
34  //
36  void SetPadPosition(const TVector2 &position){fPadPosition=position;}
38  void SetPadDimensions(const TVector2 &dimensions){fPadDimensions=dimensions;}
40  void SetRealPosition(const TVector2 &position){fRealPosition=position;}
42  void SetRealDimensions(const TVector2 &dimensions){fRealDimensions=dimensions;}
44  void SetColor(Int_t color){fColor=color;}
45 
46  //
47  // get methods
48  //
49 
51  TVector2 GetPadPosition() const {return fPadPosition;}
53  TVector2 GetPadDimensions() const {return fPadDimensions;}
55  TVector2 GetRealPosition() const{return fRealPosition;}
57  TVector2 GetRealDimensions() const{return fRealDimensions;}
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 
69  protected:
72 
73  private:
74  //private constructor (not instanciable from outside)
76 
79  static TObjArray fgStack;
80  static Int_t fgStackSize;
81 
82  //data members
83  Int_t fColor;
84  TVector2 fPadPosition;
85  TVector2 fPadDimensions;
86 
87  TVector2 fRealPosition;
88  TVector2 fRealDimensions;
89 
90  ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world
91 };
92 
93 #endif //ALI_MP_GRAPH_CONTEXT_H
94 
95 
void SetRealPosition(const TVector2 &position)
Set position of the real area where to draw.
#define TObjArray
static TObjArray fgStack
the object stack
TVector2 GetPadDimensions() const
Return dimensions of the pad area where to draw.
static Int_t fgStackSize
the object stack size
static AliMpGraphContext * Instance()
Int_t GetColor() const
Return color to use.
void SetPadPosForReal(const TVector2 &position, const TVector2 &dimensions)
AliMpGraphContext & operator=(const AliMpGraphContext &right)
void SetColor(Int_t color)
Set color to use.
void SetPadPosition(const TVector2 &position)
Set position of the pad area where to draw.
Int_t fColor
color to use
void SetRealDimensions(const TVector2 &dimensions)
Set dimensions of the real area where to draw.
TVector2 GetRealPosition() const
Return position of the real area where to draw.
TVector2 fRealDimensions
Dimensions of the real area to draw.
void SetPadDimensions(const TVector2 &dimensions)
Set dimensions of the pad area where to draw.
TVector2 GetPadPosition() const
Return position of the pad area where to draw.
TVector2 fPadDimensions
Dimensions of the pad area where to draw.
TVector2 fPadPosition
Position of the pad area where to draw.
TVector2 GetRealDimensions() const
Return dimensions of the real area where to draw.
TVector2 RealToPad(const TVector2 &position) const
TVector2 fRealPosition
Position of the real area to draw.
static AliMpGraphContext * fgInstance
the global instance
AliMpGraphContext()
static data members
Class describing the correspondance between a given area in pad, and a zone of real (cm) position...