]>
Commit | Line | Data |
---|---|---|
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$ |
dee1d5f1 | 5 | // $MpId: AliMpGraphContext.h,v 1.7 2005/08/26 15:43:36 ivana Exp $ |
6 | ||
7 | /// \ingroup graphics | |
8 | /// \class AliMpGraphContext | |
9 | /// \brief Class describing the correspondance between a given area | |
10 | /// in pad, and a zone of real (cm) position | |
11 | /// | |
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 | |
17 | #include <TObject.h> | |
18 | #include <TVector2.h> | |
19 | ||
20 | #include "AliMpGraphicsTypes.h" | |
21 | ||
22 | class MPainter; | |
23 | ||
2998a151 | 24 | class AliMpGraphContext : public TObject |
25 | { | |
5f91c9e8 | 26 | public: |
27 | void Push() const; | |
28 | void Pop(); | |
29 | static AliMpGraphContext *Instance(); | |
30 | ||
31 | // set methods | |
32 | ||
33 | void SetPadPosition(const TVector2 &position){fPadPosition=position;} | |
34 | void SetPadDimensions(const TVector2 &dimensions){fPadDimensions=dimensions;} | |
35 | void SetRealPosition(const TVector2 &position){fRealPosition=position;} | |
36 | void SetRealDimensions(const TVector2 &dimensions){fRealDimensions=dimensions;} | |
37 | void SetColor(Int_t color){fColor=color;} | |
38 | ||
39 | // get methods | |
40 | TVector2 GetPadPosition() const {return fPadPosition;} | |
41 | TVector2 GetPadDimensions() const {return fPadDimensions;} | |
42 | TVector2 GetRealPosition() const{return fRealPosition;} | |
43 | TVector2 GetRealDimensions() const{return fRealDimensions;} | |
44 | Int_t GetColor() const {return fColor;} | |
45 | ||
46 | //methods | |
47 | TVector2 RealToPad(const TVector2 &position) const; | |
48 | void RealToPad(const TVector2 &position | |
49 | ,const TVector2 &dimensions, | |
50 | TVector2 &padPosition, | |
51 | TVector2 &padDimensions) const; | |
52 | void SetPadPosForReal(const TVector2 &position,const TVector2 &dimensions); | |
53 | ||
fb1bf5c0 | 54 | protected: |
55 | AliMpGraphContext(const AliMpGraphContext& right); | |
56 | AliMpGraphContext& operator = (const AliMpGraphContext& right); | |
57 | ||
5f91c9e8 | 58 | private: |
59 | //private constructor (not instanciable from outside) | |
60 | AliMpGraphContext(); | |
61 | ||
62 | // static data members | |
63 | static AliMpGraphContext *fgInstance; // the global instance | |
f79c58a5 | 64 | static GraphContextVector fgStack; // the object stack |
65 | #ifdef WITH_ROOT | |
66 | static Int_t fgStackSize; // the object stack size | |
67 | #endif | |
5f91c9e8 | 68 | |
69 | //data members | |
70 | Int_t fColor; // color to use | |
71 | TVector2 fPadPosition; // Position of the pad area where to draw | |
72 | TVector2 fPadDimensions; // Dimensions of the pad area where to draw | |
73 | ||
74 | TVector2 fRealPosition; // Position of the real area to draw | |
75 | TVector2 fRealDimensions; // Dimensions of the real area to draw | |
76 | ||
77 | ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world | |
78 | }; | |
79 | ||
2998a151 | 80 | #endif //ALI_MP_GRAPH_CONTEXT_H |
5f91c9e8 | 81 | |
82 |