source: branches/Mars_McMismatchStudy/mbase/MGMap.h@ 18237

Last change on this file since 18237 was 7808, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 2.4 KB
Line 
1#ifndef MARS_MGMap
2#define MARS_MGMap
3
4#ifndef ROOT_GuiTypes
5#include <GuiTypes.h> // Drawable_t
6#endif
7#ifndef ROOT_TExMap
8#include <TExMap.h>
9#endif
10
11class TString;
12class TGToolTip;
13
14#include <iostream>
15
16class MGMap : public TExMap
17{
18private:
19 // TGToolTip *fToolTip; //! The tooltip currently displayed
20
21 enum {
22 kIsOwner = BIT(14),
23 // kNoToolTips = BIT(15), // suppress tooltips
24 };
25
26 // void ShowToolTip(Int_t px, Int_t py, const char *txt);
27
28public:
29 MGMap(Int_t mapSize = 100);
30 ~MGMap();
31
32 void SetOwner(Bool_t o=kTRUE) { o ? SetBit(kIsOwner) : ResetBit(kIsOwner); }
33 void Add(TObject *k, TString *v=0);
34 void Delete(Option_t *opt="");
35 void Clear(Option_t *o="") { TExMap::Delete(o); }
36
37 // void SetNoToolTips(Bool_t b=kTRUE) { b ? SetBit(kNoToolTips) : ResetBit(kNoToolTips); } // *TOGGLE* *GETTER=HasNoToolTips
38 // Bool_t HasNoToolTips() const { return TestBit(kNoToolTips); }
39
40 void Paint(Option_t *o="");
41 void Paint(UChar_t *buf, int w, int h, Float_t scale);
42 //void Paint(Drawable_t id, Float_t scale);
43
44 void DrawLine(TObject *o, UChar_t *buf, int w, int h, Double_t scale);
45 void DrawMarker(TObject *o, UChar_t *buf, int w, int h, Double_t scale);
46
47 //void EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected);
48 TObject *PickObject(Int_t px, Int_t py, TString &str) const;
49 char *GetObjectInfo(Int_t px, Int_t py) const;
50 Int_t DistancetoPrimitive(Int_t px, Int_t py);
51
52 static UChar_t Color(int col);
53 static void DrawCircle(UChar_t *buf, int w, int h, Float_t x, Float_t y, Float_t r, UChar_t col);
54 static void DrawHexagon(UChar_t *buf, int w, int h, Float_t x, Float_t y, Float_t r, UChar_t col, Int_t style=1);
55 static void DrawLine(UChar_t *buf, int w, int h, Float_t x1, Float_t y1, Float_t x2, Float_t y2, UChar_t col, Int_t style=1);
56 static void DrawBox(UChar_t *buf, int w, int h, Float_t x1, Float_t y1, Float_t x2, Float_t y2, UChar_t col, Int_t style=1);
57 static void DrawDot(UChar_t *buf, int w, int h, Float_t cx, Float_t cy, UChar_t col);
58 static void DrawMultiply(UChar_t *buf, int w, int h, Float_t cx, Float_t cy, Float_t size, UChar_t col);
59 static void DrawCross(UChar_t *buf, int w, int h, Float_t cx, Float_t cy, Float_t size, UChar_t col);
60
61 ClassDef(MGMap, 1) // Special TExMap supporting enhanced drawing and bitmap drawing
62};
63
64#endif
Note: See TracBrowser for help on using the repository browser.