[Kstars-devel] [kstars] kstars: Adding new Pluto photograph just taken recently by NASA New Horizons spacecraft!

Jasem Mutlaq mutlaqja at ikarustech.com
Tue Jul 14 22:05:19 UTC 2015


Git commit 860975b79c3dc0410f9d7d03258e5c49fb77afef by Jasem Mutlaq.
Committed on 14/07/2015 at 21:54.
Pushed by mutlaqja into branch 'master'.

Adding new Pluto photograph just taken recently by NASA New Horizons spacecraft!

Also making a couple of modifications to the asteroid class to enable this, but we would probably need a better solution so that we can include images for other asteroids as well. Will work on that. The Pluto image is scaled now exponentially to allow the user to see
the full image at a reasonable resolution on full zoom.

CCMAIL:kstars-devel at kde.org

M  +-    --    kstars/data/textures/pluto.png
M  +13   -7    kstars/skycomponents/asteroidscomponent.cpp
M  +3    -0    kstars/skyqpainter.cpp

http://commits.kde.org/kstars/860975b79c3dc0410f9d7d03258e5c49fb77afef

diff --git a/kstars/data/textures/pluto.png b/kstars/data/textures/pluto.png
index 6b6d0c9..c6c10a8 100644
Binary files a/kstars/data/textures/pluto.png and b/kstars/data/textures/pluto.png differ
diff --git a/kstars/skycomponents/asteroidscomponent.cpp b/kstars/skycomponents/asteroidscomponent.cpp
index a1bfd14..22d6838 100644
--- a/kstars/skycomponents/asteroidscomponent.cpp
+++ b/kstars/skycomponents/asteroidscomponent.cpp
@@ -155,16 +155,17 @@ void AsteroidsComponent::loadData() {
 
         JD = static_cast<double>(mJD) + 2400000.5;
 
+        KSAsteroid *new_asteroid = NULL;
         // JM: Hack since asteroid file (Generated by JPL) is missing important Pluto data
         // I emailed JPL and this hack will be removed once they update the data!
         if (name == "Pluto")
-            diameter = 2368;
+        {
+           diameter = 2368;
+           new_asteroid = new KSAsteroid( catN, name, "pluto", JD, a, e, dms(dble_i), dms(dble_w), dms(dble_N), dms(dble_M), H, G );
+         }
+         else
+           new_asteroid = new KSAsteroid( catN, name, QString(), JD, a, e, dms(dble_i), dms(dble_w), dms(dble_N), dms(dble_M), H, G );
 
-        KSAsteroid *new_asteroid = new KSAsteroid( catN, name, QString(), JD,
-                                          a, e,
-                                          dms(dble_i), dms(dble_w),
-                                          dms(dble_N), dms(dble_M),
-                                          H, G );
         new_asteroid->setPerihelion(q);
         new_asteroid->setOrbitID(orbit_id);
         new_asteroid->setNEO(neo);
@@ -210,7 +211,12 @@ void AsteroidsComponent::draw( SkyPainter *skyp )
         if ( ast->mag() > Options::magLimitAsteroid() || std::isnan(ast->mag()) != 0)
             continue;
 
-        bool drawn = skyp->drawPointSource(ast,ast->mag());
+        bool drawn = false;
+
+        if (ast->image().isNull() == false)
+            drawn = skyp->drawPlanet(ast);
+        else
+            drawn = skyp->drawPointSource(ast,ast->mag());
 
         if ( drawn && !( hideLabels || ast->mag() >= labelMagLimit ) )
             SkyLabeler::AddLabel( ast, SkyLabeler::ASTEROID_LABEL );
diff --git a/kstars/skyqpainter.cpp b/kstars/skyqpainter.cpp
index 0969a75..b020cd1 100644
--- a/kstars/skyqpainter.cpp
+++ b/kstars/skyqpainter.cpp
@@ -354,6 +354,9 @@ bool SkyQPainter::drawPlanet(KSPlanetBase* planet)
             //Because Saturn has rings, we inflate its image size by a factor 2.5
             if( planet->name() == "Saturn" )
                 size = int(2.5*size);
+            // Scale size exponentially so it is visible at large zooms
+            else if (planet->name() == "Pluto")
+                size = int(size*exp(1.5*size));
 
             save();
             translate(pos);


More information about the Kstars-devel mailing list