]>
Commit | Line | Data |
---|---|---|
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 | ||
19 | class MPainter; | |
20 | ||
2998a151 | 21 | class 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 | ||
fb1bf5c0 | 51 | protected: |
52 | AliMpGraphContext(const AliMpGraphContext& right); | |
53 | AliMpGraphContext& operator = (const AliMpGraphContext& right); | |
54 | ||
5f91c9e8 | 55 | private: |
56 | //private constructor (not instanciable from outside) | |
57 | AliMpGraphContext(); | |
58 | ||
59 | // static data members | |
60 | static AliMpGraphContext *fgInstance; // the global instance | |
f79c58a5 | 61 | static GraphContextVector fgStack; // the object stack |
62 | #ifdef WITH_ROOT | |
63 | static Int_t fgStackSize; // the object stack size | |
64 | #endif | |
5f91c9e8 | 65 | |
66 | //data members | |
67 | Int_t fColor; // color to use | |
68 | TVector2 fPadPosition; // Position of the pad area where to draw | |
69 | TVector2 fPadDimensions; // Dimensions of the pad area where to draw | |
70 | ||
71 | TVector2 fRealPosition; // Position of the real area to draw | |
72 | TVector2 fRealDimensions; // Dimensions of the real area to draw | |
73 | ||
74 | ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world | |
75 | }; | |
76 | ||
2998a151 | 77 | #endif //ALI_MP_GRAPH_CONTEXT_H |
5f91c9e8 | 78 | |
79 |