Changeset 3525 for trunk/MagicSoft/Mars/mastro
- Timestamp:
- 03/16/04 18:00:25 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mastro
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mastro/MAstroCamera.cc
r3519 r3525 275 275 m->SetMarkerColor(kMagenta); 276 276 m->SetMarkerStyle(kDot); 277 fMapG.Add((Long_t)m, 0);277 AddMap(m); 278 278 } 279 279 if (h) … … 308 308 gPad->Update(); 309 309 return; 310 310 311 case kKey_Minus: 311 312 fTime->SetMjd(fTime->GetMjd()-0.25/24); … … 316 317 } 317 318 318 MAstroCatalog::EventInfo(event, mp1, mp2); 319 //MAstroCatalog::ExecuteEvent(event, mp1, mp2); 320 } 319 MAstroCatalog::ExecuteEvent(event, mp1, mp2); 320 } -
trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
r3519 r3525 445 445 line->SetLineColor(kWhite+type*2); 446 446 line->SetBit(kCannotPick); 447 fMapG.Add((Long_t)line, 0);447 AddMap(line); 448 448 449 449 const TVector2 deg = v*TMath::RadToDeg(); … … 456 456 tip->SetBit(kCannotPick); 457 457 tip->SetMarkerColor(kWhite+type*2); 458 fMapG.Add((Long_t)tip, (Long_t)new TString(txt));458 AddMap(tip, new TString(txt)); 459 459 460 460 return kTRUE; … … 585 585 tip->SetBit(kCanDelete); 586 586 tip->SetBit(kCannotPick); 587 fMapG.Add((Long_t)tip, (Long_t)new TString(str));587 AddMap(tip, new TString(str)); 588 588 } 589 589 … … 674 674 } 675 675 676 void MAstroCatalog::DrawMap() 677 { 678 Long_t key, val; 679 TExMapIter map(&fMapG); 680 while (map.Next(key, val)) 681 ((TObject*)key)->Draw(); 682 } 683 676 684 void MAstroCatalog::Draw(Option_t *o) 677 685 { … … 679 687 AppendPad(o); 680 688 689 // If contents have not previously changed make sure that 690 // all primitives are recreated. 681 691 if (!TestBit(kHasChanged)) 682 692 DrawPrimitives(o); … … 705 715 void MAstroCatalog::EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected) 706 716 { 717 TCanvas *c = (TCanvas*)gTQSender; 718 719 gPad = c ? c->GetSelectedPad() : NULL; 720 if (!gPad) 721 return; 722 707 723 // Try to find a corresponding object with kCannotPick set and 708 724 // an available TString (for a tool tip) 725 TString *str=0; 709 726 if (!selected || selected==this) 710 727 { … … 721 738 722 739 selected = o; 740 str = (TString*)val; 723 741 break; 724 742 } … … 728 746 return; 729 747 730 TCanvas *c = (TCanvas*)gTQSender;731 732 TVirtualPad* save=gPad;733 734 gPad = c ? c->GetSelectedPad() : NULL;735 if (!gPad)736 return;737 738 748 switch (event) 739 749 { 740 750 case kMouseMotion: 741 { 742 TString *s = (TString*)fMapG.GetValue((Long_t)selected); 743 if (!fToolTip->IsMapped() && s) 744 ShowToolTip(px, py, *s); 745 } 751 if (!fToolTip->IsMapped() && str) 752 ShowToolTip(px, py, *str); 746 753 break; 747 754 … … 751 758 break; 752 759 753 case kKeyPress: // Unresolved keyboard event 754 /* 755 switch (px) 756 { 757 case kKey_Plus: 758 case kKey_Minus:*/ 759 ExecuteEvent(kKeyPress, px, py);/* 760 break; 761 } 762 break;*/ 763 } 764 765 gPad=save; 760 case kKeyPress: 761 ExecuteEvent(kKeyPress, px, py); 762 break; 763 } 766 764 } 767 765 … … 815 813 if (event==kKeyPress) 816 814 ExecuteEventKbd(mp1, mp2); 817 818 815 } 819 816 -
trunk/MagicSoft/Mars/mastro/MAstroCatalog.h
r3519 r3525 32 32 33 33 TString fName; 34 34 35 35 36 public: … … 120 121 void ExecuteEvent(Int_t event, Int_t mp1, Int_t mp2); 121 122 123 void DrawMap(); 124 void AddMap(void *k, void *v=0) { fMapG.Add(fMapG.GetSize(), (Long_t)k, (Long_t)v); } 122 125 void DeleteMap() 123 126 { … … 142 145 } 143 146 fMapG.Delete(); 144 }145 void DrawMap()146 {147 Long_t key, val;148 TExMapIter map(&fMapG);149 while (map.Next(key, val))150 ((TObject*)key)->Draw();151 147 } 152 148 … … 193 189 void Draw(Option_t *o=""); 194 190 195 v oid EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected=0);191 virtual void EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected=0); 196 192 197 193 ClassDef(MAstroCatalog, 1)
Note:
See TracChangeset
for help on using the changeset viewer.