Changeset 7264 for trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
- Timestamp:
- 08/05/05 18:13:49 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
r7181 r7264 17 17 ! 18 18 ! Author(s): Thomas Bretz, 03/2004 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! Author(s): Robert Wagner, 08/2004 <mailto:rwagner@mppmu.mpg.de>20 19 ! 21 ! Copyright: MAGIC Software Development, 2002-200 420 ! Copyright: MAGIC Software Development, 2002-2005 22 21 ! 23 22 ! … … 121 120 // http://heasarc.gsfc.nasa.gov/W3Browse/star-catalog/ 122 121 // 122 // Class Version 2: 123 // + MAttLine fAttLineSky; // Line Style and color for sky coordinates 124 // + MAttLine fAttLineLocal; // Line Style and color for local coordinates 125 // + added new base class TAttMarker 126 // 123 127 ////////////////////////////////////////////////////////////////////////////// 124 128 #include "MAstroCatalog.h" … … 154 158 #endif 155 159 160 ClassImp(MAttLine); 156 161 ClassImp(MAstroCatalog); 157 162 … … 170 175 171 176 fToolTip = gROOT->IsBatch() || !gClient ? 0 : new TGToolTip(0, "", 0); 177 178 fAttLineSky.SetLineStyle(kDashDotted); 179 fAttLineLocal.SetLineStyle(kDashDotted); 180 181 fAttLineSky.SetLineColor(kRed); 182 fAttLineLocal.SetLineColor(kBlue); 183 184 SetMarkerColor(kBlack); 185 SetMarkerStyle(kCircle); 172 186 } 173 187 … … 221 235 // -------------------------------------------------------------------------- 222 236 // 223 // return int correspoding to TSubString224 //225 Int_t MAstroCatalog::atoi(const TSubString &sub)226 {227 return atoi(TString(sub));228 }229 230 // --------------------------------------------------------------------------231 //232 // return float correspoding to TSubString233 //234 Float_t MAstroCatalog::atof(const TSubString &sub)235 {236 return atof(TString(sub));237 }238 239 // --------------------------------------------------------------------------240 //241 237 // return int correspoding to TString 242 238 // 243 239 Int_t MAstroCatalog::atoi(const TString &s) 244 240 { 245 return std::atoi(s);241 return const_cast<TString&>(s).Atoi(); 246 242 } 247 243 … … 252 248 Float_t MAstroCatalog::atof(const TString &s) 253 249 { 254 return std::atof(s);250 return const_cast<TString&>(s).Atof(); 255 251 } 256 252 … … 678 674 { 679 675 if (gPad) 680 SetRangePad(o);676 SetRangePad(o); 681 677 682 678 if (TestBit(kHasChanged)) … … 748 744 749 745 // draw star on the camera display 750 TMarker *tip=new TMarker(x, y, col<0 ? kDot : kFullDotMedium);; 751 tip->SetMarkerColor(col); 746 TMarker *tip=new TMarker(x, y, kDot); 747 TAttMarker::Copy(*tip); 748 752 749 fMapG.Add(tip, new TString(str)); 753 750 754 if (!resize) 755 return; 756 757 tip->SetMarkerSize((10 - (mag>1 ? mag : 1))/15); 758 tip->SetMarkerStyle(kCircle); 751 if (resize) 752 tip->SetMarkerSize((10 - (mag>1 ? mag : 1))/15); 759 753 } 760 754 … … 870 864 871 865 TLine *line = new TLine(v0.X(), v0.Y(), v1.X(), v1.Y()); 872 line->SetLineStyle(kDashDotted); //kDashed, kDotted, kDashDotted 873 line->SetLineColor(kWhite+type*2); 866 if (type==1) 867 dynamic_cast<TAttLine&>(fAttLineSky).Copy(dynamic_cast<TAttLine&>(*line)); 868 else 869 dynamic_cast<TAttLine&>(fAttLineLocal).Copy(dynamic_cast<TAttLine&>(*line)); 874 870 fMapG.Add(line); 875 871 … … 1152 1148 const Bool_t yellow = o.Contains("yellow", TString::kIgnoreCase) && !white; 1153 1149 1150 if (white) 1151 SetMarkerColor(kWhite); 1152 1154 1153 // X is vice versa, because ra is defined anti-clockwise 1155 1154 mirx || mirror ? ResetBit(kMirrorX) : SetBit(kMirrorX); … … 1208 1207 // -------------------------------------------------------------------------- 1209 1208 // 1210 // First delete all gui elements. 1211 // Set the correct range of the pad. 1212 // Create all gui primitives 1213 // If "this" is not in the current pad add it to the current pad. 1214 // Reset vit kHasChanged 1215 // 1209 // Bends some pointers into the right direction... 1210 // Calls TAttLine::SetLineAttributes and connects some signals 1211 // to the gui to recreate the gui elements if something has changed. 1212 // 1213 void MAstroCatalog::SetLineAttributes(MAttLine &att) 1214 { 1215 if (!gPad) 1216 return; 1217 1218 gPad->SetSelected(&att); 1219 gROOT->SetSelectedPrimitive(&att); 1220 1221 att.SetLineAttributes(); 1222 1223 TQObject::Connect("TGColorSelect", "ColorSelected(Pixel_t)", "MAstroCatalog", this, "ForceUpdate()"); 1224 TQObject::Connect("TGListBox", "Selected(Int_t)", "MAstroCatalog", this, "ForceUpdate()"); 1225 } 1226 1227 // -------------------------------------------------------------------------- 1228 // 1229 // Calls TAttMarker::SetMarkerAttributes and connects some signals 1230 // to the gui to recreate the gui elements if something has changed. 1231 // 1232 void MAstroCatalog::SetMarkerAttributes() 1233 { 1234 if (!gPad) 1235 return; 1236 1237 TAttMarker::SetMarkerAttributes(); 1238 1239 // Make sure that if something is changed the gui elements 1240 // are recreated 1241 TQObject::Connect("TGedMarkerSelect", "MarkerSelected(Style_t)", "MAstroCatalog", this, "ForceUpdate()"); 1242 TQObject::Connect("TGColorSelect", "ColorSelected(Pixel_t)", "MAstroCatalog", this, "ForceUpdate()"); 1243 TQObject::Connect("TGListBox", "Selected(Int_t)", "MAstroCatalog", this, "ForceUpdate()"); 1244 } 1245 1216 1246 void MAstroCatalog::DrawPrimitives(Option_t *o) 1217 1247 {
Note:
See TracChangeset
for help on using the changeset viewer.