source: trunk/Mars/mgui/MHexagon.h@ 19917

Last change on this file since 19917 was 14447, checked in by tbretz, 12 years ago
Added some missing std::
File size: 2.1 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 TOrdCollection;
29
30class MHexagon : public TObject, public TAttLine, public TAttFill
31{
32private:
33 static const Double_t fgCos60;
34 static const Double_t fgSin60;
35
36public:
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
46 Float_t fPhi; // Rotation angle
47
48public:
49
50 MHexagon();
51 MHexagon(Float_t x, Float_t y, Float_t d, Float_t phi=0);
52 MHexagon(const MHexagon &hexagon);
53
54 virtual void Copy(TObject &hexagon)
55#if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01)
56const
57#endif
58 ;
59
60 Int_t DistancetoPrimitive(Int_t px, Int_t py, Float_t conv);
61 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
62 {
63 return DistancetoPrimitive(px, py, 1);
64 }
65
66 virtual void DrawHexagon(Float_t x, Float_t y, Float_t d, Float_t phi=0);
67
68 //virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
69
70 virtual void ls(const Option_t *Option="") const;
71 virtual void Paint(Option_t *Option="");
72 virtual void PaintHexagon(Float_t x, Float_t y, Float_t d, Float_t phi=0);
73 virtual void Print(Option_t *Option="") const; // *MENU*
74 virtual void SavePrimitive(std::ostream &out, Option_t *);
75 virtual void SavePrimitive(std::ofstream &out, Option_t *);
76
77 Float_t GetX() const { return fX; }
78 Float_t GetY() const { return fY; }
79 Float_t GetD() const { return fD; }
80 Float_t GetPhi() const { return fPhi; }
81
82 ClassDef(MHexagon, 2) // A hexagon for MAGIC
83};
84
85#endif
86
Note: See TracBrowser for help on using the repository browser.