[Kstars-devel] KDE/kdeedu/kstars/kstars
Thomas Kabelmann
tk78 at gmx.de
Tue Sep 6 21:59:57 CEST 2005
SVN commit 457859 by kabelmann:
This update adds the solar system. Currently asteroids, jupiter moons and the moon are included. Planets/Sun have to implemented now, but they are very similar to the moon and only Pluto and Sun have to become own classes beside a planet class. Jupiter needs an own composite to manage jupiter + it's moons.
CCMAIL: kstars-devel at kde.org
M +15 -5 kstarsdata.cpp
M +1 -1 kstarsdata.h
A skycomponents/abstractplanetcomponent.cpp [License: GPL (v2+)]
A skycomponents/abstractplanetcomponent.h [License: GPL (v2+)]
A skycomponents/asteroidscomponent.cpp [License: GPL (v2+)]
A skycomponents/asteroidscomponent.h [License: GPL (v2+)]
A skycomponents/mooncomponent.cpp [License: GPL (v2+)]
A skycomponents/mooncomponent.h [License: GPL (v2+)]
M +1 -1 skycomponents/skycomponent.cpp
M +2 -2 skycomponents/skycomponent.h
M +1 -1 skycomponents/skymapcomposite.h
A skycomponents/solarsystemcomposite.cpp [License: GPL (v2+)]
A skycomponents/solarsystemcomposite.h [License: GPL (v2+)]
M +6 -3 skymapdraw.cpp
--- trunk/KDE/kdeedu/kstars/kstars/kstarsdata.cpp #457858:457859
@@ -708,7 +708,7 @@
}
}
*/
-
+/** moved to asteroidscomponent
bool KStarsData::readAsteroidData( void ) {
QFile file;
@@ -746,6 +746,7 @@
return false;
}
+*/
bool KStarsData::readCometData( void ) {
QFile file;
@@ -2037,6 +2038,7 @@
LastNumUpdate = ut().djd();
}
+ //TODO updatePlanets()
// Update positions of objects, if necessary
if ( fabs( ut().djd() - LastPlanetUpdate.djd() ) > 0.01 ) {
LastPlanetUpdate = ut().djd();
@@ -2044,10 +2046,11 @@
if ( Options::showPlanets() ) PCat->findPosition( &num, geo->lat(), LST );
//Asteroids
+/** moved into asteroidscomponent
if ( Options::showPlanets() && Options::showAsteroids() )
for ( KSAsteroid *ast = asteroidList.first(); ast; ast = asteroidList.next() )
ast->findPosition( &num, geo->lat(), LST, earth() );
-
+*/
//Comets
if ( Options::showPlanets() && Options::showComets() )
for ( KSComet *com = cometList.first(); com; com = cometList.next() )
@@ -2069,11 +2072,13 @@
// Moon moves ~30 arcmin/hr, so update its position every minute.
if ( fabs( ut().djd() - LastMoonUpdate.djd() ) > 0.00069444 ) {
LastMoonUpdate = ut();
+ //TODO updateMoons()
+/**
if ( Options::showMoon() ) {
Moon->findPosition( &num, geo->lat(), LST );
Moon->findPhase( PCat->planetSun() );
}
-
+*/
/** moved in jupitermoonscomponent
//for now, update positions of Jupiter's moons here also
if ( Options::showPlanets() && Options::showJupiter() )
@@ -2081,6 +2086,8 @@
*/
}
+ //TODO update()
+
//Update Alt/Az coordinates. Timescale varies with zoom level
//If Clock is in Manual Mode, always update. (?)
if ( fabs( ut().djd() - LastSkyUpdate.djd() ) > 0.25/Options::zoomFactor() || clock()->isManualMode() ) {
@@ -2091,26 +2098,29 @@
//This updates trails as well
PCat->EquatorialToHorizontal( LST, geo->lat() );
-/** moved in jupitermoonscomponent
+/** moved into jupitermoonscomponent
jmoons->EquatorialToHorizontal( LST, geo->lat() );
*/
+/** moved into mooncomponent
if ( Options::showMoon() ) {
Moon->EquatorialToHorizontal( LST, geo->lat() );
if ( Moon->hasTrail() ) Moon->updateTrail( LST, geo->lat() );
}
+*/
// //Planet Trails
// for( SkyPoint *p = PlanetTrail.first(); p; p = PlanetTrail.next() )
// p->EquatorialToHorizontal( LST, geo->lat() );
//Asteroids
+/** moved into asteroidscomponent
if ( Options::showAsteroids() ) {
for ( KSAsteroid *ast = asteroidList.first(); ast; ast = asteroidList.next() ) {
ast->EquatorialToHorizontal( LST, geo->lat() );
if ( ast->hasTrail() ) ast->updateTrail( LST, geo->lat() );
}
}
-
+*/
//Comets
if ( Options::showComets() ) {
for ( KSComet *com = cometList.first(); com; com = cometList.next() ) {
--- trunk/KDE/kdeedu/kstars/kstars/kstarsdata.h #457858:457859
@@ -235,7 +235,7 @@
*@li 82-93 Mean Anomaly in degrees [double]
*@li 94-98 Magnitude [double]
*/
- bool readAsteroidData( void );
+// bool readAsteroidData( void );
/**Populate the list of Comets from the data file.
*Each line in the data file is parsed as follows:
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skycomponent.cpp #457858:457859
@@ -56,7 +56,7 @@
}
// get size of object
- size = labelSize();
+ size = labelSize(obj);
int offset = int( ( 0.5*size + 4 ) );
psky.drawText( x+offset, y+offset, obj->translatedName() );
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skycomponent.h #457858:457859
@@ -74,7 +74,7 @@
*a component to it's parent, for example a star want to add/remove
*a trail to it's parent.
*/
- void parent() { return Parent; }
+ SkyComposite* parent() { return Parent; }
protected:
@@ -94,7 +94,7 @@
/** Returns the size for drawing the label. It's used by generic
* drawNameLabel() method.
*/
- virtual int labelSize() { return 1; };
+ virtual int labelSize(SkyObject*) { return 1; };
private:
SkyComposite *Parent;
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skymapcomposite.h #457858:457859
@@ -18,7 +18,7 @@
#ifndef SKYMAPCOMPOSITE_H
#define SKYMAPCOMPOSITE_H
-#include "skycomponent.h"
+#include "skycomposite.h"
/**@class SkyMapComposite
*SkyComposite is the root object in the object hierarchy of the sky map.
--- trunk/KDE/kdeedu/kstars/kstars/skymapdraw.cpp #457858:457859
@@ -1600,7 +1600,7 @@
if ( Options::showSun() && data->PCat->findByName("Sun")->hasTrail() ) drawPlanetTrail( psky, data->PCat->findByName("Sun"), scale );
if ( Options::showMercury() && data->PCat->findByName("Mercury")->hasTrail() ) drawPlanetTrail( psky, data->PCat->findByName("Mercury"), scale );
if ( Options::showVenus() && data->PCat->findByName("Venus")->hasTrail() ) drawPlanetTrail( psky, data->PCat->findByName("Venus"), scale );
- if ( Options::showMoon() && data->Moon->hasTrail() ) drawPlanetTrail( psky, data->Moon, scale );
+// if ( Options::showMoon() && data->Moon->hasTrail() ) drawPlanetTrail( psky, data->Moon, scale );
if ( Options::showMars() && data->PCat->findByName("Mars")->hasTrail() ) drawPlanetTrail( psky, data->PCat->findByName("Mars"), scale );
if ( Options::showJupiter() && data->PCat->findByName("Jupiter")->hasTrail() ) drawPlanetTrail( psky, data->PCat->findByName("Jupiter"), scale );
if ( Options::showSaturn() && data->PCat->findByName("Saturn")->hasTrail() ) drawPlanetTrail( psky, data->PCat->findByName("Saturn"), scale );
@@ -1618,7 +1618,7 @@
if ( com->hasTrail() ) drawPlanetTrail( psky, com, scale );
}
}
-
+/**
//Now draw the actual solar system bodies. Draw furthest to closest.
//Draw Asteroids
if ( Options::showAsteroids() ) {
@@ -1646,7 +1646,7 @@
}
}
}
-
+*/
//Draw Comets
if ( Options::showComets() ) {
for ( KSComet *com = data->cometList.first(); com; com = data->cometList.next() ) {
@@ -1781,9 +1781,11 @@
if ( Options::showMoon() ) {
drawPlanet(psky, data->Moon, QColor( "White" ), MINZOOM, 1, scale );
}
+
}
}
+/** moved into planethelper
void SkyMap::drawPlanet( QPainter &psky, KSPlanetBase *p, QColor c,
double zoommin, int resize_mult, double scale ) {
@@ -1849,6 +1851,7 @@
}
}
}
+*/
void SkyMap::exportSkyImage( const QPaintDevice *pd ) {
QPainter p;
More information about the Kstars-devel
mailing list