]>
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 | ||
11 | #ifndef ALI_MP_GRAPH_CONTEXT | |
12 | #define ALI_MP_GRAPH_CONTEXT | |
13 | ||
14 | #include <TObject.h> | |
15 | #include <TVector2.h> | |
16 | ||
17 | #include "AliMpGraphicsTypes.h" | |
18 | ||
19 | class MPainter; | |
20 | ||
21 | class AliMpGraphContext : public TObject{ | |
22 | public: | |
23 | void Push() const; | |
24 | void Pop(); | |
25 | static AliMpGraphContext *Instance(); | |
26 | ||
27 | // set methods | |
28 | ||
29 | void SetPadPosition(const TVector2 &position){fPadPosition=position;} | |
30 | void SetPadDimensions(const TVector2 &dimensions){fPadDimensions=dimensions;} | |
31 | void SetRealPosition(const TVector2 &position){fRealPosition=position;} | |
32 | void SetRealDimensions(const TVector2 &dimensions){fRealDimensions=dimensions;} | |
33 | void SetColor(Int_t color){fColor=color;} | |
34 | ||
35 | // get methods | |
36 | TVector2 GetPadPosition() const {return fPadPosition;} | |
37 | TVector2 GetPadDimensions() const {return fPadDimensions;} | |
38 | TVector2 GetRealPosition() const{return fRealPosition;} | |
39 | TVector2 GetRealDimensions() const{return fRealDimensions;} | |
40 | Int_t GetColor() const {return fColor;} | |
41 | ||
42 | //methods | |
43 | TVector2 RealToPad(const TVector2 &position) const; | |
44 | void RealToPad(const TVector2 &position | |
45 | ,const TVector2 &dimensions, | |
46 | TVector2 &padPosition, | |
47 | TVector2 &padDimensions) const; | |
48 | void SetPadPosForReal(const TVector2 &position,const TVector2 &dimensions); | |
49 | ||
50 | private: | |
51 | //private constructor (not instanciable from outside) | |
52 | AliMpGraphContext(); | |
53 | ||
54 | // static data members | |
55 | static AliMpGraphContext *fgInstance; // the global instance | |
56 | static GraphContextVector fgStack; // the object statck | |
57 | ||
58 | //data members | |
59 | Int_t fColor; // color to use | |
60 | TVector2 fPadPosition; // Position of the pad area where to draw | |
61 | TVector2 fPadDimensions; // Dimensions of the pad area where to draw | |
62 | ||
63 | TVector2 fRealPosition; // Position of the real area to draw | |
64 | TVector2 fRealDimensions; // Dimensions of the real area to draw | |
65 | ||
66 | ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world | |
67 | }; | |
68 | ||
69 | #endif //ALI_MP_GRAPH_CONTEXT | |
70 | ||
71 |