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

Akarsh Simha akarshsimha at gmail.com
Mon Jun 30 00:16:36 CEST 2008


SVN commit 826149 by asimha:

Incorporating James' improvements for the star size formula.

It looks much better now. I liked the constant at 5.8 instead of 6.0,
so I kept it at that. I also found the name sizeMagLim more meaningful
than fake_maglim which I cooked up in a hurry.

Thanks James!

CCMAIL: kstars-devel at kde.org



 M  +6 -4      starcomponent.cpp  


--- branches/kstars/summer/kdeedu/kstars/kstars/skycomponents/starcomponent.cpp #826148:826149
@@ -259,7 +259,9 @@
     visibleStarCount = 0;
 
     t.start();
-    float fake_maglim = ( ( maglim > m_FaintMagnitude * (1 - 1.5/16) ) ? m_FaintMagnitude * ( 1 - 1.5/16 ) : maglim );
+    float sizeMagLim = ( 2.000 + 2.444 * Options::memUsage() / 10.0 ) * ( lgz - lgmin ) + 5.8;
+    if( sizeMagLim > m_FaintMagnitude * ( 1 - 1.5/16 ) )
+        sizeMagLim = m_FaintMagnitude * ( 1 - 1.5/16 );
 
     if( veryFrugalMem )
         m_StarBlockFactory.freeAll();
@@ -313,8 +315,8 @@
             QPointF o = map->toScreen( curStar );
             
             if ( ! map->onScreen( o ) ) continue;
-            float size = ( sizeFactor*( fake_maglim - mag ) / fake_maglim ) + 1.;
-            if ( size <= 0. ) continue;
+            float size = ( sizeFactor*( sizeMagLim - mag ) / sizeMagLim ) + 1.;
+            if ( size <= 1.0 ) size = 1.0;
 
             curStar->draw( psky, o.x(), o.y(), size, (starColorMode()==0),
                            starColorIntensity(), true );
@@ -365,7 +367,7 @@
                 QPointF o = map->toScreen( curStar );
 
                 if ( ! map->onScreen( o ) ) continue;
-                float size = ( sizeFactor*( fake_maglim - mag ) / fake_maglim ) + 1.;
+                float size = ( sizeFactor*( sizeMagLim - mag ) / sizeMagLim ) + 1.;
                 if ( size <= 0. ) continue;
                 curStar->draw( psky, o.x(), o.y(), size, (starColorMode()==0),
                                starColorIntensity(), true );


More information about the Kstars-devel mailing list