source: trunk/MagicSoft/Mars/mbase/MGMap.h@ 4909

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