Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 4520)
+++ trunk/MagicSoft/Mars/Changelog	(revision 4521)
@@ -21,4 +21,12 @@
 
 
+ 2004/08/05: Thomas Bretz
+
+   * mastro/MAstroCatalog.[h,cc]:
+     - changed return type of AddObject to Bool_t
+     - changed Reading member function to use AddObject
+
+
+
  2004/08/05: Robert Wagner
 
@@ -26,4 +34,5 @@
      - Added MAstroCatalog::AddObject, functionality to insert single
        objects manually; needed for mtemp/mmpi/MSourceDirections
+
 
 
Index: trunk/MagicSoft/Mars/Makefile.conf.general
===================================================================
--- trunk/MagicSoft/Mars/Makefile.conf.general	(revision 4520)
+++ trunk/MagicSoft/Mars/Makefile.conf.general	(revision 4521)
@@ -18,5 +18,5 @@
 #   export MARSLIBS="-lX11 -lXpm -L/usr/X11R6/lib"
 #
-DEFINES	 = -DMARSVER=\"\<cvs\>\" -D__MARS__ -DROOTVER=\"$(ROOTVER)\" $(ARCHDEF) $(MARSDEFINES)
+DEFINES	 = -DMARSVER=\"0.8.5\" -D__MARS__ -DROOTVER=\"$(ROOTVER)\" $(ARCHDEF) $(MARSDEFINES)
 
 CXXFLAGS = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG) $(DEFINES)
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 4520)
+++ trunk/MagicSoft/Mars/NEWS	(revision 4521)
@@ -6,5 +6,5 @@
 
 
- *** Version <cvs>
+ *** Version 0.8.5 (2004/08/06)
  
    - new Signal Extractors: MExtractFixedWindowSpline 
@@ -33,4 +33,6 @@
 
    - Added mean values to MPedPhotCam
+
+   - Added Makefile for Darwin (this OS is NOT officially supported!)
 
 
Index: trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc	(revision 4520)
+++ trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc	(revision 4521)
@@ -287,6 +287,4 @@
 Int_t MAstroCatalog::ReadXephem(TString catalog)
 {
-    SetBit(kHasChanged);
-
     gLog << inf << "Reading Xephem catalog: " << catalog << endl;
 
@@ -354,16 +352,6 @@
         dec0 *= TMath::Pi()/180;
 
-        MVector3 *star=new MVector3;
-        star->SetRaDec(ra0, dec0, mag);
-        star->SetName(name);
-
-        if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
-        {
-            delete star;
-            continue;
-        }
-
-        fList.Add(star);
-        add++;
+        if (AddObject(ra0, dec0, mag, name))
+            add++;
     }
     gLog << inf << "Read " << add << " out of " << cnt << " (Total max mag=" << maxmag << ")" << endl;
@@ -380,6 +368,4 @@
 Int_t MAstroCatalog::ReadNGC2000(TString catalog)
 {
-    SetBit(kHasChanged);
-
     gLog << inf << "Reading NGC2000 catalog: " << catalog << endl;
 
@@ -429,15 +415,6 @@
         const Double_t dec = MAstro::Dms2Rad(decd, decm, 0, decs);
 
-        MVector3 *star=new MVector3;
-        star->SetRaDec(ra, dec, mag);
-        star->SetName(row(0, 8));
-        if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
-        {
-            delete star;
-            continue;
-        }
-
-        fList.Add(star);
-        add++;
+        if (AddObject(ra, dec, mag, row(0,8)))
+            add++;
     }
 
@@ -455,6 +432,4 @@
 Int_t MAstroCatalog::ReadBSC(TString catalog)
 {
-    SetBit(kHasChanged);
-
     gLog << inf << "Reading Bright Star Catalog (BSC5) catalog: " << catalog << endl;
 
@@ -506,15 +481,6 @@
         const Double_t dec = MAstro::Dms2Rad(decd, decm, decs, decsgn);
 
-        MVector3 *star=new MVector3;
-        star->SetRaDec(ra, dec, mag);
-        star->SetName(row(4,9));
-        if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
-        {
-            delete star;
-            continue;
-        }
-
-        fList.Add(star);
-        add++;
+        if (AddObject(ra, dec, mag, row(4,9)))
+            add++;
     }
 
@@ -538,6 +504,4 @@
 Int_t MAstroCatalog::ReadHeasarcPPM(TString catalog, TString outname)
 {
-    SetBit(kHasChanged);
-
     gLog << inf << "Reading Heasarc PPM catalog: " << catalog << endl;
 
@@ -620,18 +584,11 @@
         const Double_t de0 = MAstro::Dms2Rad(d, m, s, sgn);
 
-        MVector3 *star=new MVector3;
-        star->SetRaDec(ra0, de0, mag);
-        star->SetName(name);
-        if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
-        {
-            delete star;
-            continue;
-        }
-
-        fList.Add(star);
+        if (!AddObject(ra0, de0, mag, name))
+            continue;
+
         add++;
 
         if (fout)
-            star->WriteBinary(*fout);
+            ((MVector3*)fList.Last())->WriteBinary(*fout);
     }
 
@@ -698,20 +655,21 @@
 // --------------------------------------------------------------------------
 //
-// Add an object to the star catalog manually.
-//
-Int_t MAstroCatalog::AddObject(Float_t ra, Float_t dec, Float_t mag, TString name)
-{
-    SetBit(kHasChanged);
-
-    MVector3 *star = new MVector3();
+// Add an object to the star catalog manually. Return true if the object
+// was added and false otherwise (criteria is the FOV)
+//
+Bool_t MAstroCatalog::AddObject(Float_t ra, Float_t dec, Float_t mag, TString name)
+{
+    MVector3 *star = new MVector3;
     star->SetRaDec(ra, dec, mag);
     star->SetName(name);
 
-    if (star->Angle(fRaDec)*TMath::RadToDeg()<=fRadiusFOV) {
-      fList.Add(star);
-    } else {
-      delete(star);
-    }
-    
+    if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
+    {
+        delete star;
+        return 0;
+    }
+
+    SetBit(kHasChanged);
+    fList.AddLast(star);
     return 1;
 }
Index: trunk/MagicSoft/Mars/mastro/MAstroCatalog.h
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCatalog.h	(revision 4520)
+++ trunk/MagicSoft/Mars/mastro/MAstroCatalog.h	(revision 4521)
@@ -175,5 +175,5 @@
     Int_t ReadHeasarcPPM(TString catalog = "heasarc_ppm.tdat", TString fout="");
     Int_t ReadCompressed(TString catalog);
-    Int_t AddObject(Float_t ra, Float_t dec, Float_t mag, TString name="");
+    Bool_t AddObject(Float_t ra, Float_t dec, Float_t mag, TString name="");
 
     void Print(Option_t *o="") const { fList.Print(); } // Print all stars
