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

James Bowlin bowlin at mindspring.com
Wed Aug 15 01:36:46 CEST 2007


SVN commit 700161 by jbowlin:

Implemented simple scaling of the star label mag limit by zoom factor.
The mag spinner in the setup menu now affects the fully zoomed out label
mag limit.  The mag limit is increased as the user zooms in by a factor
I chose to keep the label density roughly constant.  

On my system when I set the spinner to 3.0 and had no other labels
displaying, the label hit-ratio was roughly 50%.  You can see the
label hit-ratio by pressing the "b" key.  It is the number of labels
drawn divided by the number of draw label requests.

I then scaled the label mag limit as a function of the zoom factor
that I sort of picked out of a hat that seemed to keep the hit ratio
at about 50% as I zoomed in.

I also modified SkyLabeler::stats() so it no longer prints an itemized
list of how many of which type of label got requested which is not very
interesting.

CCMAIL: kstars-devel at kde.org


 M  +1 -0      skylabeler.cpp  
 M  +6 -2      starcomponent.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/skylabeler.cpp #700160:700161
@@ -498,6 +498,7 @@
     printf("  screenRows=%d elements=%d virtualSize=%.1f Kbytes\n",
             screenRows.size(), m_elements, float(m_size) / 1024.0 );
 
+	return;
     for ( int i = 0; i < NUM_LABEL_TYPES; i++ ) {
         printf("  %20ss: %d\n", labelName[ i ], labelList[ i ].size() );
     }
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/starcomponent.cpp #700160:700161
@@ -132,8 +132,6 @@
     KStarsData* data = ks->data();
     UpdateID updateID = data->updateID();
 
-    double labelMagLim = Options::magLimitDrawStarInfo();
-
 	bool checkSlewing = ( map->isSlewing() && Options::hideOnSlew() );
     bool hideLabels =  ( map->isSlewing() && Options::hideLabels() ) ||
 		                ! ( Options::showStarMagnitudes() || Options::showStarNames() );
@@ -157,6 +155,12 @@
                    (0.75*lgmax - lgz)/(0.75*lgmax - lgmin);
 
 	float sizeFactor = 6.0 + (lgz - lgmin);
+ 
+	double labelMagLim = Options::magLimitDrawStarInfo();
+	//labelMagLim += ( 7.9 - labelMagLim ) * ( lgz - lgmin) / (lgmax - lgmin );
+	labelMagLim += ( 16.0 - labelMagLim ) * ( lgz - lgmin) / (lgmax - lgmin );
+	if ( labelMagLim > 8.0 ) labelMagLim = 8.0;
+	//printf("labelMagLim = %.1f\n", labelMagLim );
 
 	//Set the brush
 	QColor fillColor( Qt::white );


More information about the Kstars-devel mailing list