[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Tue Feb 22 07:29:36 CET 2005


CVS commit by harris: 

Make asteroids visible again.  The function KSPlanetBase::findMagnitude() was 
called on asteroids, but reset their mags to 30!  This function should only 
be called on the major planets, so I added a function 
KSPlanetBase::isMajorPlanet(), which just checks the name against the 8 
planet names.

Glad I caught this one in time...

CCMAIL: kstars-devel at kde.org


  M +11 -1     ksplanetbase.cpp   1.23
  M +6 -2      ksplanetbase.h   1.25


--- kdeedu/kstars/kstars/ksplanetbase.cpp  #1.22:1.23
@@ -83,7 +83,17 @@ void KSPlanetBase::findPosition( const K
         }
 
+        if ( isMajorPlanet() )
         findMagnitude(num);
 }
 
+bool KSPlanetBase::isMajorPlanet() const {
+        if ( name() == "Mercury" || name() == "Venus" || name() == "Mars" ||
+                                name() == "Jupiter" || name() == "Saturn" || name() == "Uranus" ||
+                                name() == "Neptune" || name() == "Pluto" )
+                return true;
+        
+        return false;
+}
+
 void KSPlanetBase::localizeCoords( const KSNumbers *num, const dms *lat, const dms *LST ) {
         //convert geocentric coordinates to local apparent coordinates (topocentric coordinates)

--- kdeedu/kstars/kstars/ksplanetbase.h  #1.24:1.25
@@ -237,4 +237,8 @@ public:
         void setPhysicalSize( double size ) { PhysicalSize = size; }
 
+/**@return true if the KSPlanet is one of the eight major planets
+ */
+        bool isMajorPlanet() const;
+
 /**@return whether the planet has a trail
         */




More information about the Kstars-devel mailing list