[Kstars-devel] Saturn Moons Patch

Vipul Kumar Singh vipulkrsingh at gmail.com
Sat Mar 21 14:24:18 CET 2009


This is the patch for satuen moons it puts 8 moons on the saturn's orbit..

Index: kstars/CMakeLists.txt
===================================================================
--- kstars/CMakeLists.txt	(revision 939391)
+++ kstars/CMakeLists.txt	(working copy)
@@ -188,6 +188,7 @@
    skycomponents/asteroidscomponent.cpp
    skycomponents/cometscomponent.cpp
    skycomponents/jupitermoonscomponent.cpp
+   skycomponents/saturnmoonscomponent.cpp
    skycomponents/solarsystemcomposite.cpp
    skycomponents/satellitecomposite.cpp
    skycomponents/satellitecomponent.cpp
@@ -251,6 +252,7 @@
 set(kstars_skyobjects_SRCS
   skyobjects/deepskyobject.cpp
   skyobjects/jupitermoons.cpp
+  skyobjects/saturnmoons.cpp
   skyobjects/ksasteroid.cpp
   skyobjects/kscomet.cpp
   skyobjects/ksmoon.cpp
Index: kstars/skycomponents/solarsystemcomposite.cpp
===================================================================
--- kstars/skycomponents/solarsystemcomposite.cpp	(revision 939391)
+++ kstars/skycomponents/solarsystemcomposite.cpp	(working copy)
@@ -34,8 +34,8 @@
 #include "skyobjects/ksmoon.h"
 #include "skyobjects/kspluto.h"
 #include "jupitermoonscomponent.h"
+#include "saturnmoonscomponent.h"

-
 SolarSystemComposite::SolarSystemComposite(SkyComponent *parent,
KStarsData *data )
         : SkyComposite(parent)
 {
@@ -53,7 +53,10 @@
     addComponent( jup );
     m_JupiterMoons = new JupiterMoonsComponent( this, jup,
&Options::showJupiter);
     addComponent( m_JupiterMoons );
-    addComponent( new SolarSystemSingleComponent( this, new KSPlanet(
data, KSPlanetBase::SATURN ), Options::showSaturn, 4 ) );
+    SolarSystemSingleComponent *sat = new SolarSystemSingleComponent(
this, new KSPlanet( data, KSPlanetBase::SATURN ), Options::showSaturn,
4 );
+    addComponent( sat );
+    m_SaturnMoons = new SaturnMoonsComponent( this, sat, &Options::showSaturn);
+    addComponent( m_SaturnMoons );
     addComponent( new SolarSystemSingleComponent( this, new KSPlanet(
data, KSPlanetBase::URANUS ), Options::showUranus, 4 ) );
     addComponent( new SolarSystemSingleComponent( this, new KSPlanet(
data, KSPlanetBase::NEPTUNE ), Options::showNeptune, 4 ) );
     addComponent( new SolarSystemSingleComponent( this, new
KSPluto(data), Options::showPluto, 4 ) );
@@ -93,6 +96,7 @@
     m_Sun->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
     m_Moon->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
     m_JupiterMoons->update( data, num );
+    m_SaturnMoons->update( data, num );

     foreach ( SkyComponent *comp, components() ) {
         comp->update( data, num );
@@ -117,6 +121,7 @@
     m_Moon->findPosition( num, data->geo()->lat(), data->lst() );
     m_Moon->findPhase( m_Sun );
     m_JupiterMoons->updateMoons( data, num );
+    m_SaturnMoons->updateMoons( data, num );
 }

 void SolarSystemComposite::draw( QPainter& psky )
Index: kstars/skycomponents/skymapcomposite.h
===================================================================
--- kstars/skycomponents/skymapcomposite.h	(revision 939391)
+++ kstars/skycomponents/skymapcomposite.h	(working copy)
@@ -84,7 +84,7 @@
     	*Planet positions change over time, so they need to be recomputed
     	*periodically, but not on every call to update().  This function
     	*will recompute the positions of all solar system bodies except the
-    	*Earth's Moon and Jupiter's Moons (because these objects' positions
+    	*Earth's Moon, Jupiter's Moons AND Saturn Moons (because these
objects' positions
     	*change on a much more rapid timescale).
     	*@p data Pointer to the KStarsData object
     	*@p num Pointer to the KSNumbers object
Index: kstars/skycomponents/solarsystemcomposite.h
===================================================================
--- kstars/skycomponents/solarsystemcomposite.h	(revision 939391)
+++ kstars/skycomponents/solarsystemcomposite.h	(working copy)
@@ -24,6 +24,7 @@
 class KSSun;
 class KSMoon;
 class JupiterMoonsComponent;
+class SaturnMoonsComponent;
 class AsteroidsComponent;
 class CometsComponent;
 class SkyLabeler;
@@ -70,6 +71,7 @@
     KSSun *m_Sun;
     KSMoon *m_Moon;
     JupiterMoonsComponent *m_JupiterMoons;
+    SaturnMoonsComponent *m_SaturnMoons;
     AsteroidsComponent *m_AsteroidsComponent;
     CometsComponent *m_CometsComponent;
     SkyLabeler* m_skyLabeler;
Index: kstars/skycomponents/skymapcomposite.cpp
===================================================================
--- kstars/skycomponents/skymapcomposite.cpp	(revision 939391)
+++ kstars/skycomponents/skymapcomposite.cpp	(working copy)
@@ -39,6 +39,7 @@
 #include "ecliptic.h"
 #include "horizoncomponent.h"
 #include "jupitermoonscomponent.h"
+#include "saturnmoonscomponent.h"
 #include "milkyway.h"
 #include "magellanicclouds.h"
 #include "solarsystemcomposite.h"
Index: kstars/skycomponents/skylabeler.h
===================================================================
--- kstars/skycomponents/skylabeler.h	(revision 939391)
+++ kstars/skycomponents/skylabeler.h	(working copy)
@@ -121,6 +121,7 @@
         COMET_LABEL,
         PLANET_LABEL,
         JUPITER_MOON_LABEL,
+	SATURN_MOON_LABEL,
         DEEP_SKY_LABEL,
         CONSTEL_NAME_LABEL,
         NUM_LABEL_TYPES
Index: kstars/skycomponents/skylabeler.cpp
===================================================================
--- kstars/skycomponents/skylabeler.cpp	(revision 939391)
+++ kstars/skycomponents/skylabeler.cpp	(working copy)
@@ -428,6 +428,12 @@
     psky.setPen( QColor( data->colorScheme()->colorNamed( "PNameColor" ) ) );
     drawQueuedLabelsType( psky, PLANET_LABEL );

+    if ( labelList[ SATURN_MOON_LABEL ].size() > 0 ) {
+        shrinkFont( psky, 2 );
+        drawQueuedLabelsType( psky, SATURN_MOON_LABEL );
+        resetFont( psky );
+    }
+
     if ( labelList[ JUPITER_MOON_LABEL ].size() > 0 ) {
         shrinkFont( psky, 2 );
         drawQueuedLabelsType( psky, JUPITER_MOON_LABEL );
@@ -480,6 +486,7 @@
     labelName[        COMET_LABEL ] = "Comet";
     labelName[       PLANET_LABEL ] = "Planet";
     labelName[ JUPITER_MOON_LABEL ] = "Jupiter Moon";
+    labelName[  SATURN_MOON_LABEL ] = "Saturn Moon";
     labelName[     DEEP_SKY_LABEL ] = "Deep Sky Object";
     labelName[ CONSTEL_NAME_LABEL ] = "Constellation Name";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 6200 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kstars-devel/attachments/20090321/f4475aa3/attachment.dll 


More information about the Kstars-devel mailing list