1 | #ifndef MARS_MagicShow
|
---|
2 | #define MARS_MagicShow
|
---|
3 |
|
---|
4 | #ifndef MARS_MAGIC
|
---|
5 | #include "MAGIC.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TText
|
---|
9 | #include <TText.h>
|
---|
10 | #endif
|
---|
11 | #ifndef ROOT_TTimer
|
---|
12 | #include <TTimer.h>
|
---|
13 | #endif
|
---|
14 | #ifndef ROOT_TClonesArray
|
---|
15 | #include <TClonesArray.h>
|
---|
16 | #endif
|
---|
17 |
|
---|
18 | class TMarker;
|
---|
19 | class TVirtualPad;
|
---|
20 |
|
---|
21 | class MGeomCam;
|
---|
22 | class MHexagon;
|
---|
23 |
|
---|
24 | class MagicShow : public TObject
|
---|
25 | {
|
---|
26 | private:
|
---|
27 | enum
|
---|
28 | {
|
---|
29 | kBackground = 50,
|
---|
30 | kUserBits = 0x7fc000 // 14-23 are allowed
|
---|
31 |
|
---|
32 | };
|
---|
33 |
|
---|
34 | TTimer fTimer; // timer rising the 500ms interrputs
|
---|
35 |
|
---|
36 | MGeomCam *fGeomCam; // pointer to camera geometry
|
---|
37 |
|
---|
38 | UShort_t fNumPixels; // number of pixels in the present geometry
|
---|
39 | Short_t fNumPixel; // number of pixel actually shown
|
---|
40 | Float_t fRange; // the range in millimeters of the present geometry
|
---|
41 |
|
---|
42 | Bool_t fAuto; // automatic stepping on/off
|
---|
43 |
|
---|
44 | TText fShow; // TText showing the numbers of pixels and bombs
|
---|
45 | TText *fText[6]; // ttext showing the pixel numbers of the neighbors
|
---|
46 |
|
---|
47 | UInt_t fW; // Width of canvas
|
---|
48 | UInt_t fH; // Height of canvas
|
---|
49 |
|
---|
50 | TClonesArray *fPixels; // array of all hexagons
|
---|
51 | TVirtualPad *fDrawingPad; // pad in which we are drawing
|
---|
52 |
|
---|
53 | MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
|
---|
54 |
|
---|
55 | void Update();
|
---|
56 | void Free();
|
---|
57 | void DrawHexagons();
|
---|
58 | void SetNewCamera(MGeomCam *);
|
---|
59 | void ChangePixel(Int_t add);
|
---|
60 |
|
---|
61 | Bool_t HandleTimer(TTimer *timer);
|
---|
62 | void Draw(Option_t *option="");
|
---|
63 | void Paint(Option_t *option="");
|
---|
64 | void ExecuteEvent(Int_t event, Int_t px, Int_t py);
|
---|
65 | Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
|
---|
66 |
|
---|
67 | public:
|
---|
68 | MagicShow();
|
---|
69 | ~MagicShow();
|
---|
70 |
|
---|
71 | void ChangeCamera(); //*MENU*
|
---|
72 |
|
---|
73 | ClassDef(MagicShow, 0) // Tool to visualize next neighbours
|
---|
74 | };
|
---|
75 |
|
---|
76 | #endif
|
---|