[kde-doc-english] [kstars] kstars: Add option to toggle display of deep-sky objects of unknown magnitude

Akarsh Simha akarsh.simha at kdemail.net
Fri Nov 28 04:01:58 UTC 2014


Git commit 2f04e554e4fe3405acb370b7ddbedbd3134c5953 by Akarsh Simha.
Committed on 28/11/2014 at 03:54.
Pushed by asimha into branch 'master'.

Add option to toggle display of deep-sky objects of unknown magnitude

So far, objects that had unknown magnitudes were never drawn in
KStars, except for a workaround to permit the display of IC objects,
many of which had unknown magnitudes.

While the Steinicke catalog is revised, we use the blue magnitudes
from it, and not all objects have blue magnitudes. So using the
Steinicke catalog renders many objects not drawn.

This commit adds an option in the Catalog settings UI that allows the
user to toggle the display of objects of unknown magnitudes. The
default state of this setting is 'true', so that the user is not
frustrated to find some NGC / IC objects invisible. The patch also
removes the work-around for IC objects.

This only affects objects of unknown magnitude -- the faint objects
are still hidden and revealed as the user zooms in.

BUG:
GUI:

M  +5    -0    kstars/kstars.kcfg
M  +7    -0    kstars/options/opscatalog.ui
M  +4    -2    kstars/skycomponents/deepskycomponent.cpp

http://commits.kde.org/kstars/2f04e554e4fe3405acb370b7ddbedbd3134c5953

diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index 4cd8a9d..60cb901 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -683,6 +683,11 @@
       <whatsthis>The faint magnitude limit for drawing deep-sky objects, when fully zoomed out.</whatsthis>
       <default>5.0</default>
     </entry>
+    <entry name="ShowUnknownMagObjects" type="Bool">
+      <label>Show deep-sky objects of unknown magnitude</label>
+      <whatsthis>When enabled, objects whose magnitudes are unknown, or not available to KStars, are drawn irrespective of the faint limits set.</whatsthis>
+      <default>true</default>
+    </entry>
     <!--
         <entry name="MagLimitDrawStar" type="Double">
         <label>Faint limit for stars</label>
diff --git a/kstars/options/opscatalog.ui b/kstars/options/opscatalog.ui
index 41ccebe..b9976b3 100644
--- a/kstars/options/opscatalog.ui
+++ b/kstars/options/opscatalog.ui
@@ -599,6 +599,13 @@ These magnitude limits do not affect IC objects, as the magnitudes for many IC o
          </layout>
         </item>
         <item>
+         <widget class="QCheckBox" name="kcfg_ShowUnknownMagObjects">
+          <property name="text">
+           <string>Show objects of unknown magnitude</string>
+          </property>
+         </widget>
+        </item>
+        <item>
          <spacer>
           <property name="orientation">
            <enum>Qt::Horizontal</enum>
diff --git a/kstars/skycomponents/deepskycomponent.cpp b/kstars/skycomponents/deepskycomponent.cpp
index 918ec51..be19a6c 100644
--- a/kstars/skycomponents/deepskycomponent.cpp
+++ b/kstars/skycomponents/deepskycomponent.cpp
@@ -407,6 +407,7 @@ void DeepSkyComponent::drawDeepSkyCatalog( SkyPainter *skyp, bool drawObject,
 
 
     double maglim = Options::magLimitDrawDeepSky();
+    bool showUnknownMagObjects = Options::showUnknownMagObjects();
 
     //adjust maglimit for ZoomLevel
     double lgmin = log10(MINZOOM);
@@ -449,8 +450,9 @@ void DeepSkyComponent::drawDeepSkyCatalog( SkyPainter *skyp, bool drawObject,
             //only draw objects if flags set, it's bigger than 1 pixel (unless
             //zoom > 2000.), and it's brighter than maglim (unless mag is
             //undefined (=99.9)
-            if ( (size > 1.0 || Options::zoomFactor() > 2000.) &&
-                 ( mag < (float)maglim || obj->isCatalogIC() ) )
+            bool sizeCriterion = (size > 1.0 || Options::zoomFactor() > 2000.);
+            bool magCriterion = ( mag < (float)maglim ) || ( showUnknownMagObjects && ( std::isnan( mag ) || mag > 36.0 ) );
+            if ( sizeCriterion && magCriterion )
             {
 
                 bool drawn = skyp->drawDeepSkyObject(obj, drawImage);


More information about the kde-doc-english mailing list