source: trunk/MagicSoft/Mars/mgui/MHexagon.h@ 9029

Last change on this file since 9029 was 8178, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 2.2 KB
Line 
1#ifndef MARS_MHexagon
2#define MARS_MHexagon
3
4//////////////////////////////////////////////////////////////
5//
6// MHexagon
7//
8// A Hexagon for the MAGIC event display
9//
10//////////////////////////////////////////////////////////////
11
12#ifndef MARS_MAGIC
13#include "MAGIC.h"
14#endif
15
16#ifndef ROOT_TObject
17#include <TObject.h>
18#endif
19
20#ifndef ROOT_TAttLine
21#include <TAttLine.h>
22#endif
23
24#ifndef ROOT_TAttFill
25#include <TAttFill.h>
26#endif
27
28class MGeomPix;
29class TOrdCollection;
30
31class MHexagon : public TObject, public TAttLine, public TAttFill
32{
33private:
34 static const Double_t fgCos60;
35 static const Double_t fgSin60;
36
37 static const Double_t fgDx[6]; // X coordinate of the six edges
38 static const Double_t fgDy[6]; // Y coordinate of the six edges
39
40protected:
41
42 Float_t fX; // X coordinate of center
43 Float_t fY; // Y coordinate of center
44 Float_t fD; // diameter D or better distance between opposite sides
45
46public:
47
48 MHexagon();
49 MHexagon(Float_t x, Float_t y, Float_t d);
50 MHexagon(const MGeomPix &pix);
51 MHexagon(const MHexagon &hexagon);
52
53 virtual void Copy(TObject &hexagon)
54#if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01)
55const
56#endif
57 ;
58
59 Int_t DistancetoPrimitive(Int_t px, Int_t py, Float_t conv);
60 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
61 {
62 return DistancetoPrimitive(px, py, 1);
63 }
64 virtual Float_t DistanceToPrimitive(Float_t px, Float_t py) const;
65 virtual void DrawHexagon(Float_t x, Float_t y, Float_t d);
66
67 //virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
68
69 virtual void ls(const Option_t *Option="") const;
70 virtual void Paint(Option_t *Option="");
71 virtual void PaintHexagon(Float_t x, Float_t y, Float_t d);
72 virtual void Print(Option_t *Option="") const; // *MENU*
73 virtual void SavePrimitive(ostream &out, Option_t *);
74 virtual void SavePrimitive(ofstream &out, Option_t *);
75
76 Float_t GetX() const { return fX; }
77 Float_t GetY() const { return fY; }
78 Float_t GetD() const { return fD; }
79
80 void GetIntersectionBorder(TOrdCollection &col, const MHexagon &hex) const;
81 Double_t CalcOverlapArea(const MHexagon &cam) const;
82
83 ClassDef(MHexagon, 1) // A hexagon for MAGIC
84};
85
86#endif
87
Note: See TracBrowser for help on using the repository browser.