1 | #ifndef MARS_MagicCivilization
|
---|
2 | #define MARS_MagicCivilization
|
---|
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 MagicCivilization : public TObject
|
---|
25 | {
|
---|
26 | private:
|
---|
27 | enum
|
---|
28 | {
|
---|
29 | kBackground = 50,
|
---|
30 | kHasFlag = BIT(17),
|
---|
31 | kHasCreation = BIT(18),
|
---|
32 | kUserBits = 0x7fc000 // 14-23 are allowed
|
---|
33 | };
|
---|
34 |
|
---|
35 | TTimer fTimer; // timer rising the 500ms interrputs
|
---|
36 |
|
---|
37 | MGeomCam *fGeomCam; // pointer to camera geometry
|
---|
38 |
|
---|
39 | UShort_t fNumPixels; // number of pixels in the present geometry
|
---|
40 | Short_t fNumInit; // number of bombs in the field
|
---|
41 | Float_t fRange; // the range in millimeters of the present geometry
|
---|
42 |
|
---|
43 | Bool_t fAuto;
|
---|
44 |
|
---|
45 | Char_t fLimit;
|
---|
46 |
|
---|
47 | UShort_t fNumCivilizations;
|
---|
48 | UInt_t fStep;
|
---|
49 |
|
---|
50 | TText fCivilization; // TText showing the numbers of pixels and bombs
|
---|
51 |
|
---|
52 | UInt_t fW; // Width of canvas
|
---|
53 | UInt_t fH; // Height of canvas
|
---|
54 |
|
---|
55 | TClonesArray *fPixels; // array of all hexagons
|
---|
56 | TVirtualPad *fDrawingPad; // pad in which we are drawing
|
---|
57 |
|
---|
58 | MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
|
---|
59 |
|
---|
60 | void Update();
|
---|
61 | void Free();
|
---|
62 | void DrawHexagons();
|
---|
63 | void SetNewCamera(MGeomCam *);
|
---|
64 |
|
---|
65 | Bool_t HandleTimer(TTimer *timer);
|
---|
66 | void Draw(Option_t *option="");
|
---|
67 | void Paint(Option_t *option="");
|
---|
68 | void ExecuteEvent(Int_t event, Int_t px, Int_t py);
|
---|
69 | Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
|
---|
70 |
|
---|
71 | public:
|
---|
72 | MagicCivilization(Byte_t lim=2, UShort_t init=200);
|
---|
73 | ~MagicCivilization();
|
---|
74 |
|
---|
75 | void ChangeCamera(); //*MENU*
|
---|
76 | void Reset(); //*MENU*
|
---|
77 |
|
---|
78 | ClassDef(MagicCivilization, 0) // Tool to visualize next neighbours
|
---|
79 | };
|
---|
80 |
|
---|
81 | #endif
|
---|