Changeset 4081 for trunk/MagicSoft/Mars/mastro
- Timestamp:
- 05/15/04 20:05:18 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mastro
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
r4058 r4081 128 128 129 129 #include "MTime.h" 130 //#include "MString.h"130 #include "MString.h" 131 131 #include "MAstro.h" 132 132 #include "MAstroSky2Local.h" … … 179 179 fList.SetOwner(); 180 180 fMapG.SetOwner(); 181 fToolTip = new TGToolTip(0, "", 0);181 fToolTip = gROOT->IsBatch() || !gClient ? 0 : new TGToolTip(0, "", 0); 182 182 } 183 183 … … 203 203 delete fObservatory; 204 204 205 fToolTip->Hide(); 206 delete fToolTip; 205 if (fToolTip) 206 { 207 fToolTip->Hide(); 208 delete fToolTip; 209 } 207 210 } 208 211 … … 726 729 // simultaneously. 727 730 // 728 void MAstroCatalog::PaintImg(unsigned char *buf, int w, int h) 729 { 730 const char * o = "local mirrorx yellow *"; 731 void MAstroCatalog::PaintImg(unsigned char *buf, int w, int h, Option_t *o) 732 { 733 if (!o) 734 o = "local mirrorx yellow * ="; 731 735 732 736 if (TestBit(kHasChanged)) … … 757 761 const Double_t mag = -2.5*log10(v.Mag()); 758 762 759 //MString str; 760 //str.Print("%s: Ra=%.2fh Dec=%.1fd Mag=%.1f", v.GetName(), ra, dec, mag); 761 TString str(Form("%s: Ra=%.2fh Dec=%.1fd Mag=%.1f", v.GetName(), ra, dec, mag)); 763 MString str; 764 str.Print("%s: Ra=%.2fh Dec=%.1fd Mag=%.1f", v.GetName(), ra, dec, mag); 762 765 if (txt) 763 766 { … … 898 901 899 902 const TVector2 deg = va*TMath::RadToDeg(); 900 /* 903 901 904 MString txt; 902 905 if (type==1) … … 904 907 else 905 908 txt.Print("Zd=%.1fd Az=%.1fd", fmod(deg.Y()+270,180)-90, fmod(deg.X()+720, 360)); 906 */907 TString txt;908 if (type==1)909 txt = Form("Ra=%.2fh Dec=%.1fd", fmod(deg.X()/15+48, 24), fmod(90-deg.Y()+270,180)-90);910 else911 txt = Form("Zd=%.1fd Az=%.1fd", fmod(deg.Y()+270,180)-90, fmod(deg.X()+720, 360));912 909 913 910 TMarker *tip=new TMarker(v0.X(), v0.Y(), kDot); … … 1317 1314 { 1318 1315 case kMouseMotion: 1319 if ( !fToolTip->IsMapped() && !str.IsNull())1316 if (fToolTip && !fToolTip->IsMapped() && !str.IsNull()) 1320 1317 ShowToolTip(px, py, str); 1321 1318 break; 1322 1319 1323 1320 case kMouseLeave: 1324 if (fToolTip ->IsMapped())1321 if (fToolTip && fToolTip->IsMapped()) 1325 1322 fToolTip->Hide(); 1326 1323 break; -
trunk/MagicSoft/Mars/mastro/MAstroCatalog.h
r4058 r4081 181 181 182 182 //void PaintImg(Int_t id=0, Option_t *o=""); 183 void PaintImg(unsigned char *buf, int w=768, int h=576 );183 void PaintImg(unsigned char *buf, int w=768, int h=576, Option_t *o=0); 184 184 void Draw(Option_t *o=""); 185 185 void SetDrawOption(Option_t *option="")
Note:
See TracChangeset
for help on using the changeset viewer.