[Kstars-devel] branches/kstars/summer/kdeedu/kstars/kstars/skycomponents

Akarsh Simha akarshsimha at gmail.com
Sat Jun 21 02:59:29 CEST 2008


SVN commit 822670 by asimha:

+ Modifying the formula for size of stars to maintain discernability
  between brighter and fainter stars.

+ Adding more debug info (visible star count) and making appropriate
  corrections.

CCMAIL: kstars-devel at kde.org



 M  +10 -4     starcomponent.cpp  
 M  +1 -0      starcomponent.h  


--- branches/kstars/summer/kdeedu/kstars/kstars/skycomponents/starcomponent.cpp #822669:822670
@@ -248,7 +248,10 @@
     t_updateCache = 0;
     t_drawUnnamed = 0;
 
+    visibleStarCount = 0;
+
     t.start();
+    float fake_maglim = ( ( maglim > 13.0 ) ? 13.0 : maglim );
     while ( region.hasNext() ) {
         ++nTrixels;
         Trixel currentRegion = region.next();
@@ -276,11 +279,12 @@
             QPointF o = map->toScreen( curStar );
             
             if ( ! map->onScreen( o ) ) continue;
-            float size = ( sizeFactor*( maglim - mag ) / maglim ) + 1.;
+            float size = ( sizeFactor*( fake_maglim - mag ) / fake_maglim ) + 1.;
             if ( size <= 0. ) continue;
 
             curStar->draw( psky, o.x(), o.y(), size, (starColorMode()==0),
                            starColorIntensity(), true );
+            visibleStarCount++;
             
             if ( m_hideLabels || mag > labelMagLim ) continue;
             
@@ -342,10 +346,11 @@
                 QPointF o = map->toScreen( curStar );
 
                 if ( ! map->onScreen( o ) ) continue;
-                float size = ( sizeFactor*( maglim - mag ) / maglim ) + 1.;
+                float size = ( sizeFactor*( fake_maglim - mag ) / fake_maglim ) + 1.;
                 if ( size <= 0. ) continue;
                 curStar->draw( psky, o.x(), o.y(), size, (starColorMode()==0),
                                starColorIntensity(), true );
+                visibleStarCount++;
             }
         }
         
@@ -699,8 +704,9 @@
     kDebug() << "Number of visible trixels                    = " << nTrixels << endl;
     kDebug() << "Number of visible StarBlocks                 = " << nBlocks << endl;
     kDebug() << "Number of StarBlocks allocated via SBF       = " << m_StarBlockFactory.getBlockCount() << endl;
-    kDebug() << "Number of visible unnamed stars              = " << nStars << endl;
-    kDebug() << "Magnitude of the faintest star               = " << faintMag << endl;
+    kDebug() << "Number of unnamed stars in memory            = " << nStars << endl;
+    kDebug() << "Number of visible stars (named + unnamed)    = " << visibleStarCount << endl;
+    kDebug() << "Magnitude of the faintest star in memory     = " << faintMag << endl;
     kDebug() << "Target magnitude limit                       = " << magLim << endl;
     kDebug() << "Size of each StarBlock                       = " << sizeof( StarBlock ) << endl;
     kDebug() << "Size of each StarObject                      = " << sizeof( StarObject ) << endl;
--- branches/kstars/summer/kdeedu/kstars/kstars/skycomponents/starcomponent.h #822669:822670
@@ -167,6 +167,7 @@
     bool           starsLoaded;
     float          m_zoomMagLimit;
     float          magLim;
+    unsigned long  visibleStarCount;
 
     KStarsSplash*  m_reloadSplash;
     KStarsSplash*  m_reindexSplash;


More information about the Kstars-devel mailing list