[Kstars-devel] KDE/kdeedu/kstars/kstars

James Bowlin bowlin at mindspring.com
Wed Aug 15 20:29:34 CEST 2007


SVN commit 700506 by jbowlin:

Fixed "hide on slewing" for all skycomponents.

Added a static SkyMap::IsSlewing() method.

It seems the "hide objects while moving" checkbox is not connected
to Options::hideOnSlew()  (or my logic was wrong).  So that checkbox
does not have any effect on the actual hiding of things.

CCMAIL: kstars-devel at kde.org


 M  +3 -1      skycomponents/constellationboundarylines.cpp  
 M  +2 -1      skycomponents/constellationlines.cpp  
 M  +3 -1      skycomponents/constellationnamescomponent.cpp  
 M  +3 -1      skycomponents/coordinategrid.cpp  
 M  +21 -4     skycomponents/deepskycomponent.cpp  
 M  +2 -1      skycomponents/milkyway.cpp  
 M  +3 -2      skycomponents/solarsystemcomposite.cpp  
 M  +3 -0      skymap.h  
 M  +2 -2      skyobject.cpp  
 M  +1 -1      starobject.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/constellationboundarylines.cpp #700505:700506
@@ -27,6 +27,7 @@
 #include "Options.h"
 #include "kstars.h"
 #include "kstarsdata.h"
+#include "skymap.h"
 #include "ksutils.h"
 #include "skyobject.h"
 #include "ksfilereader.h"
@@ -148,7 +149,8 @@
 
 bool ConstellationBoundaryLines::selected()
 {
-    return Options::showCBounds();
+    return Options::showCBounds() &&
+		! ( Options::hideOnSlew() && Options::hideCBounds() && SkyMap::IsSlewing() );
 }
 
 void ConstellationBoundaryLines::preDraw( KStars *kstars, QPainter &psky )
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/constellationlines.cpp #700505:700506
@@ -41,7 +41,8 @@
 
 bool ConstellationLines::selected()
 {
-    return Options::showCLines();
+    return Options::showCLines() &&
+		! ( Options::hideOnSlew() && Options::hideCLines() && SkyMap::IsSlewing() );
 }
 
 void ConstellationLines::preDraw( KStars *kstars, QPainter &psky )
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/constellationnamescomponent.cpp #700505:700506
@@ -38,7 +38,9 @@
 
 bool ConstellationNamesComponent::selected()
 {
-    return Options::showCNames();
+    return Options::showCNames() &&
+		! ( Options::hideOnSlew() && Options::hideCNames() && SkyMap::IsSlewing() );
+
 }
 
 void ConstellationNamesComponent::init(KStarsData *)
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/coordinategrid.cpp #700505:700506
@@ -23,6 +23,7 @@
 #include "Options.h"
 #include "kstars.h"
 #include "kstarsdata.h"
+#include "skymap.h"
 #include "coordinategrid.h"
 #include "linelist.h"
 
@@ -32,7 +33,8 @@
 
 bool CoordinateGrid::selected()
 {
-    return Options::showGrid();
+    return Options::showGrid() &&
+		! ( Options::hideOnSlew() && Options::hideGrid() && SkyMap::IsSlewing() );
 }
 
 void CoordinateGrid::preDraw( KStars *kstars, QPainter &psky )
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/deepskycomponent.cpp #700505:700506
@@ -242,14 +242,31 @@
 {
 	if ( ! selected() ) return;
 
+	bool drawFlag;
+
     m_scale = scale;
     m_data  = ks->data();
     m_map   = ks->map();
 
-    drawDeepSkyCatalog( psky, Options::showMessier(), &m_MessierIndex, "MessColor" );
-    drawDeepSkyCatalog( psky, Options::showNGC(),     &m_NGCIndex,     "NGCColor" );
-    drawDeepSkyCatalog( psky, Options::showIC(),      &m_ICIndex,      "ICColor" );
-    drawDeepSkyCatalog( psky, Options::showOther(),   &m_OtherIndex,   "NGCColor" );
+	drawFlag = Options::showMessier() &&  
+		! ( Options::hideOnSlew() && Options::hideMessier() && SkyMap::IsSlewing() );
+
+    drawDeepSkyCatalog( psky, drawFlag, &m_MessierIndex, "MessColor" );
+
+	drawFlag = Options::showNGC() &&  
+		! ( Options::hideOnSlew() && Options::hideNGC() && SkyMap::IsSlewing() );
+
+    drawDeepSkyCatalog( psky, drawFlag,     &m_NGCIndex,     "NGCColor" );
+
+	drawFlag = Options::showIC() &&  
+		! ( Options::hideOnSlew() && Options::hideIC() && SkyMap::IsSlewing() );
+
+    drawDeepSkyCatalog( psky, drawFlag,      &m_ICIndex,      "ICColor" );
+
+	drawFlag = Options::showOther() &&  
+		! ( Options::hideOnSlew() && Options::hideOther() && SkyMap::IsSlewing() );
+
+    drawDeepSkyCatalog( psky, drawFlag,   &m_OtherIndex,   "NGCColor" );
 }
 
 void DeepSkyComponent::drawDeepSkyCatalog( QPainter& psky, bool drawObject,
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/milkyway.cpp #700505:700506
@@ -98,7 +98,8 @@
 
 bool MilkyWay::selected() 
 {
-    return Options::showMilkyWay();
+    return Options::showMilkyWay() &&
+		! ( Options::hideOnSlew() && Options::hideMilkyWay() && SkyMap::IsSlewing() );
 }
 
 void MilkyWay::draw(KStars *kstars, QPainter& psky, double scale)
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/solarsystemcomposite.cpp #700505:700506
@@ -27,6 +27,7 @@
 
 #include "Options.h"
 #include "kstars.h"
+#include "skymap.h"
 #include "kstarsdata.h"
 #include "ksnumbers.h"
 #include "ksplanet.h"
@@ -71,8 +72,8 @@
 
 bool SolarSystemComposite::selected()
 {
-    return Options::showSolarSystem();
-    // FIXME: should be: return Options::showSolarSystem();
+    return Options::showSolarSystem() &&
+		! ( Options::hideOnSlew() && Options::hidePlanets() && SkyMap::IsSlewing() );
 }
 
 void SolarSystemComposite::init(KStarsData *data)
--- trunk/KDE/kdeedu/kstars/kstars/skymap.h #700505:700506
@@ -76,6 +76,9 @@
 
 	static SkyMap* Instance();
 
+	static bool IsSlewing() { return pinstance->isSlewing(); }
+
+
 	/**
 	*Destructor (empty)
 	*/
--- trunk/KDE/kdeedu/kstars/kstars/skyobject.cpp #700505:700506
@@ -424,7 +424,7 @@
 void SkyObject::drawNameLabel( QPainter &psky, double x, double y, double scale ) {
 	//set the zoom-dependent font
 	QFont stdFont( psky.font() );
-    SkyLabeler::setZoomFont( psky );
+    SkyLabeler::SetZoomFont( psky );
 	double offset = labelOffset( scale );
 	if ( Options::useAntialias() )
 		psky.drawText( QPointF(x+offset, y+offset), translatedName() );
@@ -435,6 +435,6 @@
 }
 
 double SkyObject::labelOffset( double scale ) {
-    return SkyLabeler::zoomOffset( scale );
+    return SkyLabeler::ZoomOffset( scale );
 }
 
--- trunk/KDE/kdeedu/kstars/kstars/starobject.cpp #700505:700506
@@ -409,7 +409,7 @@
 void StarObject::drawNameLabel( QPainter &psky, double x, double y, double scale ) {
 	//set the zoom-dependent font
 	QFont stdFont( psky.font() );
-    SkyLabeler::setZoomFont( psky );
+    SkyLabeler::SetZoomFont( psky );
 	drawLabel( psky, x, y, Options::zoomFactor(), scale );
 	psky.setFont( stdFont );
 }


More information about the Kstars-devel mailing list