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

James Bowlin bowlin at mindspring.com
Mon Aug 13 19:12:42 CEST 2007


SVN commit 699595 by jbowlin:

Implemented Options::hideLabels() feature for stars, asteroids, and
comets, which hides the labels for these objects when slewing.

This was partly done for performance reasons because the no-overlap
feature makes drawing labels a little slower.

Currently, I'm not hiding labels for:

   Constellation Names
   Planets
   Jupiter Moons
   Ecliptic, Equator, Horizon

I don't think hiding the labels for anything on this list is required
for performance reasons.  Some of these labels, such as the planet
labels and the constellation names, are useful for orientation.

I would really like input/feedback on what labels people think should
be hidden by default when skewing since it is now an esthetics choice. 
We may need to rename the hideLabels() checkbox in the config menu to
"Most object labels".  (Sorry).

The comet labels are never displayed now partly because the AU spin
box for the label threshold is pinned to zero in the config menu.

CCMAIL: kstars-devel at kde.org


 M  +4 -4      asteroidscomponent.cpp  
 M  +4 -4      cometscomponent.cpp  
 M  +3 -2      starcomponent.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/asteroidscomponent.cpp #699594:699595
@@ -101,8 +101,11 @@
 	if ( ! selected() ) return;
 	
 	SkyMap *map = ks->map();
+	bool hideLabels =  ! Options::showAsteroidNames() || (map->isSlewing() && Options::hideLabels() );
+	float labelMagLimit  =  Options::magLimitAsteroidName();
 
     psky.setBrush( QBrush( QColor( "gray" ) ) );
+
 	foreach ( SkyObject *o, objectList() ) { 
 		KSAsteroid *ast = (KSAsteroid*) o;
 
@@ -122,10 +125,7 @@
 		else
 			psky.drawEllipse( QRect( int(x1), int(y1), int(size), int(size) ) );
 
-        if ( map->isSlewing() || ! Options::showAsteroidNames() || 
-             ast->mag() >= Options::magLimitAsteroidName() ) continue;
-
-		//Queue Name
+		if ( hideLabels || ast->mag() >= labelMagLimit ) continue;
 		SkyLabeler::Instance()->addOffsetLabel( o, ast->translatedName(), ASTEROID_LABEL );
     }
 }
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/cometscomponent.cpp #699594:699595
@@ -83,6 +83,9 @@
 	
 	SkyMap *map = ks->map();
 
+	bool hideLabels =  ! Options::showCometNames() || (map->isSlewing() && Options::hideLabels() );
+	double rsunLabelLimit = Options::maxRadCometName();
+
 	float Width = scale * map->width();
 	float Height = scale * map->height();
 
@@ -109,10 +112,7 @@
 		else
 			psky.drawEllipse( QRect( int(x1), int(y1), int(size), int(size) ) );
 
-		if ( ! Options::showCometNames() ) continue;
-        if (  com->rsun() >= Options::maxRadCometName() ) continue;
-
-		//Queue label
+		if ( hideLabels || com->rsun() >= rsunLabelLimit ) continue;
 		SkyLabeler::Instance()->addOffsetLabel( o, com->translatedName(), COMET_LABEL );
 	}
 }
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/starcomponent.cpp #699594:699595
@@ -136,7 +136,8 @@
     double labelMagLim = Options::magLimitDrawStarInfo();
 
 	bool checkSlewing = ( map->isSlewing() && Options::hideOnSlew() );
-    bool noLabels =  checkSlewing || ! ( Options::showStarMagnitudes() || Options::showStarNames() );
+    bool hideLabels =  ( map->isSlewing() && Options::hideLabels() ) ||
+		                ! ( Options::showStarMagnitudes() || Options::showStarNames() );
 
     //shortcuts to inform whether to draw different objects
 	bool hideFaintStars( checkSlewing && Options::hideStars() );
@@ -204,7 +205,7 @@
 			curStar->draw( psky, o.x(), o.y(), size, (starColorMode()==0), 
 					       starColorIntensity(), true, scale );
 
-            if ( noLabels ) continue;
+            if ( hideLabels ) continue;
             if ( mag > labelMagLim ) continue;
             //if ( checkSlewing || ! (Options::showStarMagnitudes() || Options::showStarNames()) ) continue;
 


More information about the Kstars-devel mailing list