[Kstars-devel] KDE/kdeedu/kstars/kstars
Jason Harris
kstars at 30doradus.org
Sun Oct 28 16:07:30 CET 2007
SVN commit 730352 by harris:
Enamble Trails for solar system objects.
CCMAIL: kstars-devel at kde.org
M +6 -0 jupitermoons.cpp
M +3 -2 ksplanetbase.cpp
M +7 -1 skycomponents/jupitermoonscomponent.cpp
M +1 -0 skycomponents/skymapcomposite.cpp
M +0 -2 skycomponents/solarsystemcomposite.h
--- trunk/KDE/kdeedu/kstars/kstars/jupitermoons.cpp #730351:730352
@@ -507,5 +507,11 @@
if ( ZJ[i] < 0.0 ) InFront[i] = true;
else InFront[i] = false;
+
+ //Update Trails
+ if ( Moon[i]->hasTrail() ) {
+ Moon[i]->addToTrail();
+ if ( Moon[i]->trail().size() > MAXTRAIL ) Moon[i]->trail().takeFirst();
+ }
}
}
--- trunk/KDE/kdeedu/kstars/kstars/ksplanetbase.cpp #730351:730352
@@ -63,6 +63,7 @@
if ( lat && LST ) {
findPosition( num, lat, LST, data->skyComposite()->earth() );
+ //Don't add to the trail this time
if ( hasTrail() ) Trail.takeLast();
} else {
findGeocentricPosition( num, data->skyComposite()->earth() );
@@ -79,8 +80,8 @@
localizeCoords( num, lat, LST ); //correct for figure-of-the-Earth
if ( hasTrail() ) {
- Trail.append( SkyPoint( ra(), dec() ) );
- if ( Trail.count() > MAXTRAIL ) Trail.takeFirst();
+ addToTrail();
+ if ( Trail.size() > MAXTRAIL ) Trail.takeFirst();
}
if ( isMajorPlanet() )
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/jupitermoonscomponent.cpp #730351:730352
@@ -186,10 +186,16 @@
}
void JupiterMoonsComponent::drawTrails( KStars *ks, QPainter& psky ) {
+ //DEBUG
+ kDebug() << "Jupiter Moon trailS " << endl;
+
for ( uint i=0; i<4; ++i ) {
TrailObject *moon = jmoons->moon(i);
- if ( ! visible() || ! moon->hasTrail() ) return;
+ //DEBUG
+ kDebug() << QString("Jupiter Moon %1 has trail: %2").arg(i).arg(moon->trail().size()) << endl;
+ if ( ! visible() || ! moon->hasTrail() ) continue;
+
SkyMap *map = ks->map();
KStarsData *data = ks->data();
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skymapcomposite.cpp #730351:730352
@@ -226,6 +226,7 @@
m_Stars->draw( ks, psky );
+ m_SolarSystem->drawTrails( ks, psky );
m_SolarSystem->draw( ks, psky );
//DISABLE_SATELLITES
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/solarsystemcomposite.h #730351:730352
@@ -60,8 +60,6 @@
virtual void draw( KStars *ks, QPainter& psky );
- //Do the drawing in this class, since we are keeping the list of objects
- //with Trails here
void drawTrails( KStars *ks, QPainter& psky );
void reloadAsteroids( KStarsData *data );
More information about the Kstars-devel
mailing list