]>
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$ |
13985652 | 5 | // $MpId: AliMpGraphContext.h,v 1.11 2006/05/24 13:58:13 ivana Exp $ |
dee1d5f1 | 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 | /// | |
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 | |
2a7ea2e6 | 19 | #include "AliMpContainers.h" |
5006ec94 | 20 | |
2a7ea2e6 | 21 | #include <TVector2.h> |
5006ec94 | 22 | #ifdef WITH_ROOT |
23 | #include "AliMpExMap.h" | |
24 | #endif | |
25 | ||
2a7ea2e6 | 26 | #ifdef WITH_STL |
27 | #include <vector> | |
28 | #endif | |
5f91c9e8 | 29 | |
5f91c9e8 | 30 | class MPainter; |
31 | ||
2998a151 | 32 | class AliMpGraphContext : public TObject |
33 | { | |
5006ec94 | 34 | public: |
35 | #ifdef WITH_STL | |
36 | typedef std::vector<AliMpGraphContext*> GraphContextVector; | |
37 | #endif | |
38 | #ifdef WITH_ROOT | |
39 | typedef TObjArray GraphContextVector; | |
40 | #endif | |
41 | ||
5f91c9e8 | 42 | public: |
43 | void Push() const; | |
44 | void Pop(); | |
45 | static AliMpGraphContext *Instance(); | |
46 | ||
47 | // set methods | |
48 | ||
49 | void SetPadPosition(const TVector2 &position){fPadPosition=position;} | |
50 | void SetPadDimensions(const TVector2 &dimensions){fPadDimensions=dimensions;} | |
51 | void SetRealPosition(const TVector2 &position){fRealPosition=position;} | |
52 | void SetRealDimensions(const TVector2 &dimensions){fRealDimensions=dimensions;} | |
53 | void SetColor(Int_t color){fColor=color;} | |
54 | ||
55 | // get methods | |
56 | TVector2 GetPadPosition() const {return fPadPosition;} | |
57 | TVector2 GetPadDimensions() const {return fPadDimensions;} | |
58 | TVector2 GetRealPosition() const{return fRealPosition;} | |
59 | TVector2 GetRealDimensions() const{return fRealDimensions;} | |
60 | Int_t GetColor() const {return fColor;} | |
61 | ||
62 | //methods | |
63 | TVector2 RealToPad(const TVector2 &position) const; | |
64 | void RealToPad(const TVector2 &position | |
65 | ,const TVector2 &dimensions, | |
66 | TVector2 &padPosition, | |
67 | TVector2 &padDimensions) const; | |
68 | void SetPadPosForReal(const TVector2 &position,const TVector2 &dimensions); | |
69 | ||
fb1bf5c0 | 70 | protected: |
71 | AliMpGraphContext(const AliMpGraphContext& right); | |
72 | AliMpGraphContext& operator = (const AliMpGraphContext& right); | |
73 | ||
5f91c9e8 | 74 | private: |
75 | //private constructor (not instanciable from outside) | |
76 | AliMpGraphContext(); | |
77 | ||
829425a5 | 78 | ///< static data members |
79 | static AliMpGraphContext *fgInstance; ///< the global instance | |
80 | static GraphContextVector fgStack; ///< the object stack | |
f79c58a5 | 81 | #ifdef WITH_ROOT |
829425a5 | 82 | static Int_t fgStackSize; ///< the object stack size |
f79c58a5 | 83 | #endif |
5f91c9e8 | 84 | |
85 | //data members | |
829425a5 | 86 | Int_t fColor; ///< color to use |
87 | TVector2 fPadPosition; ///< Position of the pad area where to draw | |
88 | TVector2 fPadDimensions; ///< Dimensions of the pad area where to draw | |
5f91c9e8 | 89 | |
829425a5 | 90 | TVector2 fRealPosition; ///< Position of the real area to draw |
91 | TVector2 fRealDimensions; ///< Dimensions of the real area to draw | |
5f91c9e8 | 92 | |
93 | ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world | |
94 | }; | |
95 | ||
2998a151 | 96 | #endif //ALI_MP_GRAPH_CONTEXT_H |
5f91c9e8 | 97 | |
98 |