source: trunk/MagicSoft/Mars/mtemp/mpisa/triggerdisplay/MagicTriggerDisplay.h@ 5477

Last change on this file since 5477 was 4918, checked in by galante, 20 years ago
*** empty log message ***
File size: 2.5 KB
Line 
1#ifndef MARS_MagicTriggerDisplay
2#define MARS_MagicTriggerDisplay
3
4#ifndef MARS_MAGIC
5#include "MAGIC.h"
6#endif
7#ifndef ROOT_TClonesArray
8#include <TClonesArray.h>
9#endif
10#ifndef ROOT_RQ_OBJECT
11#include <RQ_OBJECT.h>
12#endif
13
14class TText;
15class TMarker;
16class TVirtualPad;
17
18class MGeomCam;
19class MHexagon;
20
21class TGMainFrame;
22class TRootEmbeddedCanvas;
23class TGWindow;
24class TGTextEntry;
25class MagicTriggerButton;
26class MMcTriggerLvl2;
27
28class MagicTriggerDisplay : public TObject
29{
30private:
31 static const Int_t kMinCell = 1;
32 static const Int_t kMaxCell = 19;
33 static const Int_t kMinLUT = 1;
34 static const Int_t kMaxLUT = 3;
35
36 Int_t cn;
37 Int_t ln;
38
39 TGMainFrame *fMain;
40 TRootEmbeddedCanvas *fEcanvas;
41 TGTextEntry *fCellEntry;
42 TGTextEntry *fLUTEntry;
43 MagicTriggerButton *cellBackward;
44 MMcTriggerLvl2 *fTrig;
45 const Int_t *fPixelsInLUT;
46 const Int_t *fPixelsInCell;
47
48 MGeomCam *fGeomCam; // pointer to camera geometry
49
50 UInt_t fNumPixels; // number of pixels in the present geometry
51 Float_t fRange; // the range in millimeters of the present geometry
52
53 TClonesArray *fPixels; // array of all hexagons
54 TClonesArray *fText; // array of all texts
55 TClonesArray *fFlags; // array of all texts
56
57 TText *fDone; // TText showing the 'Game over'
58 TText *fUsrTxt[6]; // TText showing the numbers of pixels and bombs
59
60 UInt_t fW; // Width of canvas
61 UInt_t fH; // Height of canvas
62 TVirtualPad *fDrawingPad; // pad in which we are drawing
63 Bool_t fIsAllocated;
64
65 Int_t fNumUsers;
66 Int_t fNumUser;
67 Int_t fUsrPts[6];
68
69 enum
70 {
71 kEmpty = 50,
72 kIsVisible = BIT(16),
73 kHasBomb = BIT(17),
74 kHasFlag = BIT(18),
75 kUserBits = 0x7fc000 // 14-23 are allowed
76 };
77
78 MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
79
80 TText *GetText(Int_t i) { return (TText*)fText->At(i); }
81 TMarker *GetFlag(Int_t i) { return (TMarker*)fFlags->At(i); }
82
83 void Free();
84 void SetNewCamera(MGeomCam *);
85 void DrawHexagons();
86 void Paint(Option_t *option="");
87 void Draw(Option_t *opt = "");
88public:
89 MagicTriggerDisplay(const TGWindow *p, UInt_t w = 500, UInt_t h = 500);
90
91 void Update(const Int_t butt = 0, const Int_t entry = 0);
92
93 ClassDef(MagicTriggerDisplay, 0) // Magic Camera Games: Reversi
94};
95
96#endif
Note: See TracBrowser for help on using the repository browser.