[Kstars-devel] [kstars] kstars: Add Horizontal coordinate grid.

Jérôme SONRIER jsid at emor3j.fr.eu.org
Wed Mar 7 00:35:59 UTC 2012


Git commit d5221a5225e2042096f5dad90644b297483765b6 by Jérôme SONRIER.
Committed on 06/03/2012 at 00:15.
Pushed by jsonrier into branch 'master'.

Add Horizontal coordinate grid.

CCBUG: 278556
CCMAIL: kstars-devel at kde.org

M  +2    -0    kstars/CMakeLists.txt
M  +2    -1    kstars/colorscheme.cpp
M  +2    -1    kstars/data/chart.colors
M  +2    -1    kstars/data/classic.colors
M  +2    -1    kstars/data/moonless-night.colors
M  +2    -1    kstars/data/night.colors
A  +-    --    kstars/icons/hi22-action-kstars_hgrid.png
A  +-    --    kstars/icons/hi32-action-kstars_hgrid.png
A  +-    --    kstars/icons/hi48-action-kstars_hgrid.png
A  +-    --    kstars/icons/hi64-action-kstars_hgrid.png
A  +216  -0    kstars/icons/hisc-action-kstars_hgrid.svg
M  +17   -16   kstars/kstars.cpp
M  +19   -9    kstars/kstars.kcfg
M  +8    -3    kstars/kstarsactions.cpp
M  +2    -1    kstars/kstarsdata.cpp
M  +3    -2    kstars/kstarsdcop.cpp
M  +7    -3    kstars/kstarsinit.cpp
M  +2    -1    kstars/kstarsui-indi.rc
M  +2    -1    kstars/kstarsui-win.rc
M  +2    -1    kstars/kstarsui.rc
M  +5    -5    kstars/options/opsadvanced.ui
M  +16   -3    kstars/options/opsguides.ui
M  +2    -79   kstars/skycomponents/coordinategrid.cpp
M  +3    -3    kstars/skycomponents/coordinategrid.h
C  +18   -15   kstars/skycomponents/equatorialcoordinategrid.cpp [from: kstars/skycomponents/coordinategrid.cpp - 076% similarity]
C  +13   -13   kstars/skycomponents/equatorialcoordinategrid.h [from: kstars/skycomponents/coordinategrid.h - 063% similarity]
A  +118  -0    kstars/skycomponents/horizontalcoordinategrid.cpp     [License: GPL (v2+)]
C  +14   -12   kstars/skycomponents/horizontalcoordinategrid.h [from: kstars/skycomponents/coordinategrid.h - 065% similarity]
M  +1    -7    kstars/skycomponents/linelistindex.cpp
M  +2    -0    kstars/skycomponents/linelistindex.h
M  +9    -5    kstars/skycomponents/skymapcomposite.cpp
M  +4    -2    kstars/skycomponents/skymapcomposite.h

http://commits.kde.org/kstars/d5221a5225e2042096f5dad90644b297483765b6

diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index fe8354b..dd733ee 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -216,6 +216,8 @@ set(libkstarscomponents_SRCS
    skycomponents/constellationnamescomponent.cpp 
    skycomponents/supernovaecomponent.cpp
    skycomponents/coordinategrid.cpp 
+   skycomponents/equatorialcoordinategrid.cpp 
+   skycomponents/horizontalcoordinategrid.cpp 
    skycomponents/ecliptic.cpp 
    skycomponents/equator.cpp 
    skycomponents/horizoncomponent.cpp 
diff --git a/kstars/colorscheme.cpp b/kstars/colorscheme.cpp
index f362fa0..da3ad0a 100644
--- a/kstars/colorscheme.cpp
+++ b/kstars/colorscheme.cpp
@@ -63,7 +63,8 @@ ColorScheme::ColorScheme() : FileName() {
     appendItem("EclColor",         i18n("Ecliptic"),               "#613d12");
     appendItem("HorzColor",        i18n("Horizon"),                "#091f14");
     appendItem("CompassColor",     i18n("Compass Labels"),         "#909055");
-    appendItem("GridColor",        i18n("Coordinate Grid"),        "#445566");
+    appendItem("EquatorialGridColor", i18n("Equatorial Coordinate Grid"), "#445566");
+    appendItem("HorizontalGridColor", i18n("Horizontal Coordinate Grid"), "#091f14");
     appendItem("BoxTextColor",     i18n("Info Box Text"),          "#d2dbef");
     appendItem("BoxGrabColor",     i18n("Info Box Selected"),      "#900000");
     appendItem("BoxBGColor",       i18n("Info Box Background"),    "#000000");
diff --git a/kstars/data/chart.colors b/kstars/data/chart.colors
index e9105ea..08a2525 100644
--- a/kstars/data/chart.colors
+++ b/kstars/data/chart.colors
@@ -16,7 +16,8 @@
 #999900 :EclColor
 #55AA33 :HorzColor
 #FFFFFF :CompassColor
-#445566 :GridColor
+#445566 :EquatorialGridColor
+#55AA33 :HorizontalGridColor
 #000000 :BoxTextColor
 #FF0000 :BoxGrabColor
 #FFFFFF :BoxBGColor
diff --git a/kstars/data/classic.colors b/kstars/data/classic.colors
index 21d390a..4918d45 100644
--- a/kstars/data/classic.colors
+++ b/kstars/data/classic.colors
@@ -16,7 +16,8 @@
 #666633 :EclColor
 #55AA33 :HorzColor
 #FFFFFF :CompassColor
-#445566 :GridColor
+#445566 :EquatorialGridColor
+#55AA33 :HorizontalGridColor
 #FFFFFF :BoxTextColor
 #FF0000 :BoxGrabColor
 #223344 :BoxBGColor
diff --git a/kstars/data/moonless-night.colors b/kstars/data/moonless-night.colors
index ce66761..66da477 100644
--- a/kstars/data/moonless-night.colors
+++ b/kstars/data/moonless-night.colors
@@ -16,7 +16,8 @@
 #613d12 :EclColor
 #091f14 :HorzColor
 #a0a0a0 :CompassColor
-#445566 :GridColor
+#445566 :EquatorialGridColor
+#091f14 :HorizontalGridColor
 #d2dbef :BoxTextColor
 #900000 :BoxGrabColor
 #000000 :BoxBGColor
diff --git a/kstars/data/night.colors b/kstars/data/night.colors
index fe9a3ca..2a9f0bf 100644
--- a/kstars/data/night.colors
+++ b/kstars/data/night.colors
@@ -16,7 +16,8 @@
 #AA0000 :EclColor 
 #993333 :HorzColor
 #AA7777 :CompassColor
-#770000 :GridColor
+#770000 :EquatorialGridColor
+#993333 :HorizontalGridColor
 #AA0000 :BoxTextColor
 #FF0000 :BoxGrabColor
 #000000 :BoxBGColor
diff --git a/kstars/icons/hi22-action-kstars_hgrid.png b/kstars/icons/hi22-action-kstars_hgrid.png
new file mode 100644
index 0000000..b4a9574
Binary files /dev/null and b/kstars/icons/hi22-action-kstars_hgrid.png differ
diff --git a/kstars/icons/hi32-action-kstars_hgrid.png b/kstars/icons/hi32-action-kstars_hgrid.png
new file mode 100644
index 0000000..6f1d7df
Binary files /dev/null and b/kstars/icons/hi32-action-kstars_hgrid.png differ
diff --git a/kstars/icons/hi48-action-kstars_hgrid.png b/kstars/icons/hi48-action-kstars_hgrid.png
new file mode 100644
index 0000000..eed756f
Binary files /dev/null and b/kstars/icons/hi48-action-kstars_hgrid.png differ
diff --git a/kstars/icons/hi64-action-kstars_hgrid.png b/kstars/icons/hi64-action-kstars_hgrid.png
new file mode 100644
index 0000000..cf01f62
Binary files /dev/null and b/kstars/icons/hi64-action-kstars_hgrid.png differ
diff --git a/kstars/icons/hisc-action-kstars_hgrid.svg b/kstars/icons/hisc-action-kstars_hgrid.svg
new file mode 100644
index 0000000..3acc363
--- /dev/null
+++ b/kstars/icons/hisc-action-kstars_hgrid.svg
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="64px"
+   height="64px"
+   id="svg2493"
+   sodipodi:version="0.32"
+   inkscape:version="0.48.1 r9760"
+   sodipodi:docname="hisc-action-kstars_hgrid.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.1"
+   inkscape:export-filename="/home/emor3j/dvlpt/kstars/kstars/icons/hi22-action-kstars_hgrid.png"
+   inkscape:export-xdpi="30.9375"
+   inkscape:export-ydpi="30.9375">
+  <defs
+     id="defs2495">
+    <linearGradient
+       id="linearGradient3764">
+      <stop
+         style="stop-color:#ffffb7;stop-opacity:1;"
+         offset="0"
+         id="stop3766" />
+      <stop
+         id="stop3772"
+         offset="0.5"
+         style="stop-color:#f4e55b;stop-opacity:1;" />
+      <stop
+         style="stop-color:#ea9a00;stop-opacity:1;"
+         offset="1"
+         id="stop3768" />
+    </linearGradient>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3909">
+      <rect
+         style="fill:#000000"
+         id="rect3911"
+         width="64"
+         height="64"
+         x="0.11584596"
+         y="-0.029678673"
+         clip-path="none" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3959">
+      <rect
+         style="fill:#000000"
+         id="rect3961"
+         width="64"
+         height="64"
+         x="0.090115756"
+         y="-0.090114839"
+         clip-path="none" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3963">
+      <rect
+         style="fill:#000000"
+         id="rect3965"
+         width="64"
+         height="64"
+         x="0.090115756"
+         y="-0.090114839"
+         clip-path="none" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3967">
+      <rect
+         style="fill:#000000"
+         id="rect3969"
+         width="64"
+         height="64"
+         x="0.090115756"
+         y="-0.090114839"
+         clip-path="none" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3971">
+      <rect
+         style="fill:#000000"
+         id="rect3973"
+         width="64"
+         height="64"
+         x="0.090115756"
+         y="-0.090114839"
+         clip-path="none" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3975">
+      <rect
+         style="fill:#000000"
+         id="rect3977"
+         width="64"
+         height="64"
+         x="0.090115756"
+         y="-0.090114839"
+         clip-path="none" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath3979">
+      <rect
+         style="fill:#000000"
+         id="rect3981"
+         width="64"
+         height="64"
+         x="0.090115756"
+         y="-0.090114839"
+         clip-path="none" />
+    </clipPath>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="7.5724253"
+     inkscape:cx="28.061921"
+     inkscape:cy="35.901943"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:document-units="px"
+     inkscape:grid-bbox="true"
+     inkscape:window-width="1172"
+     inkscape:window-height="949"
+     inkscape:window-x="481"
+     inkscape:window-y="36"
+     inkscape:window-maximized="0" />
+  <metadata
+     id="metadata2498">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <rect
+       style="fill:#000000"
+       id="rect2501-4-8"
+       width="64"
+       height="64"
+       x="0"
+       y="0"
+       clip-path="none" />
+    <path
+       style="fill:#0064c5;fill-opacity:1;stroke:none"
+       d="M 70.099166,46.753031 C 47.268987,60.928941 18.057406,60.718836 -4.5889875,46.134312 l -3.6018252,3.601825 C 16.50688,66.136272 48.807575,66.334155 73.700991,50.354856 l -3.601825,-3.601825 z"
+       id="path3368"
+       sodipodi:nodetypes="ccccc"
+       inkscape:connector-curvature="0"
+       clip-path="url(#clipPath3979)" />
+    <path
+       style="fill:#0064c5;fill-opacity:1;fill-rule:evenodd;stroke:none"
+       d="m 32.08929,-3.2866875 -2.708379,2.1855144 0.171674,68.8617281 2.4994,2.051225 2.442797,-1.949673 -0.121946,-69.2918703 -2.283546,-1.8569242 z"
+       id="path3405"
+       sodipodi:nodetypes="ccccccc"
+       inkscape:connector-curvature="0"
+       clip-path="url(#clipPath3975)"
+       transform="translate(0,0.09011484)" />
+    <path
+       style="fill:#0064c5;fill-opacity:1;fill-rule:evenodd;stroke:none"
+       d="m 21.533708,-6.3050504 -3.318232,1.0493423 -24.9133737,64.1972811 1.5809588,2.820478 2.9850093,-0.926392 25.1163076,-64.57979 -1.45067,-2.5609194 z"
+       id="path3405-4"
+       sodipodi:nodetypes="ccccccc"
+       inkscape:connector-curvature="0"
+       inkscape:transform-center-x="-5.1960427"
+       inkscape:transform-center-y="1.4133698"
+       clip-path="url(#clipPath3971)" />
+    <path
+       style="fill:#0064c5;fill-opacity:1;fill-rule:evenodd;stroke:none"
+       d="m 42.796685,-7.872101 -1.739564,3.0142507 24.959753,64.1792623 3.07041,1.013463 1.576737,-2.698589 L 45.59575,-6.9621649 42.796685,-7.872101 z"
+       id="path3405-4-9"
+       sodipodi:nodetypes="ccccccc"
+       inkscape:connector-curvature="0"
+       inkscape:transform-center-x="-4.7540911"
+       inkscape:transform-center-y="-2.5091037"
+       clip-path="url(#clipPath3967)" />
+    <path
+       style="fill:#0064c5;fill-opacity:1;stroke:none"
+       d="M 71.547122,23.048264 C 48.716943,37.224174 19.505362,37.014069 -3.1410322,22.429545 l -3.601825,3.601825 C 17.954836,42.431505 50.255531,42.629388 75.148947,26.650089 l -3.601825,-3.601825 z"
+       id="path3368-5"
+       sodipodi:nodetypes="ccccc"
+       inkscape:connector-curvature="0"
+       clip-path="url(#clipPath3963)" />
+    <path
+       style="fill:#0064c5;fill-opacity:1;stroke:none"
+       d="M 70.490657,-0.32601789 C 47.660478,13.849892 18.448897,13.639787 -4.1974971,-0.94473689 L -7.7993221,2.6570881 C 16.898371,19.057223 49.199066,19.255106 74.092482,3.2758071 l -3.601825,-3.60182499 z"
+       id="path3368-5-0"
+       sodipodi:nodetypes="ccccc"
+       inkscape:connector-curvature="0"
+       clip-path="url(#clipPath3959)" />
+  </g>
+</svg>
diff --git a/kstars/kstars.cpp b/kstars/kstars.cpp
index bd84e28..e833720 100644
--- a/kstars/kstars.cpp
+++ b/kstars/kstars.cpp
@@ -166,22 +166,23 @@ void KStars::applyConfig( bool doApplyFocus ) {
     #endif
 
 
-    actionCollection()->action("show_time_box"    )->setChecked( Options::showTimeBox() );
-    actionCollection()->action("show_location_box")->setChecked( Options::showGeoBox() );
-    actionCollection()->action("show_focus_box"   )->setChecked( Options::showFocusBox() );
-    actionCollection()->action("show_statusBar"   )->setChecked( Options::showStatusBar() );
-    actionCollection()->action("show_sbAzAlt"     )->setChecked( Options::showAltAzField() );
-    actionCollection()->action("show_sbRADec"     )->setChecked( Options::showRADecField() );
-    actionCollection()->action("show_stars"       )->setChecked( Options::showStars() );
-    actionCollection()->action("show_deepsky"     )->setChecked( Options::showDeepSky() );
-    actionCollection()->action("show_planets"     )->setChecked( Options::showSolarSystem() );
-    actionCollection()->action("show_clines"      )->setChecked( Options::showCLines() );
-    actionCollection()->action("show_cnames"      )->setChecked( Options::showCNames() );
-    actionCollection()->action("show_cbounds"     )->setChecked( Options::showCBounds() );
-    actionCollection()->action("show_mw"          )->setChecked( Options::showMilkyWay() );
-    actionCollection()->action("show_grid"        )->setChecked( Options::showGrid() );
-    actionCollection()->action("show_horizon"     )->setChecked( Options::showGround() );
-    actionCollection()->action("show_flags"       )->setChecked( Options::showFlags() );
+    actionCollection()->action("show_time_box"        )->setChecked( Options::showTimeBox() );
+    actionCollection()->action("show_location_box"    )->setChecked( Options::showGeoBox() );
+    actionCollection()->action("show_focus_box"       )->setChecked( Options::showFocusBox() );
+    actionCollection()->action("show_statusBar"       )->setChecked( Options::showStatusBar() );
+    actionCollection()->action("show_sbAzAlt"         )->setChecked( Options::showAltAzField() );
+    actionCollection()->action("show_sbRADec"         )->setChecked( Options::showRADecField() );
+    actionCollection()->action("show_stars"           )->setChecked( Options::showStars() );
+    actionCollection()->action("show_deepsky"         )->setChecked( Options::showDeepSky() );
+    actionCollection()->action("show_planets"         )->setChecked( Options::showSolarSystem() );
+    actionCollection()->action("show_clines"          )->setChecked( Options::showCLines() );
+    actionCollection()->action("show_cnames"          )->setChecked( Options::showCNames() );
+    actionCollection()->action("show_cbounds"         )->setChecked( Options::showCBounds() );
+    actionCollection()->action("show_mw"              )->setChecked( Options::showMilkyWay() );
+    actionCollection()->action("show_equatorial_grid" )->setChecked( Options::showEquatorialGrid() );
+    actionCollection()->action("show_horizontal_grid" )->setChecked( Options::showHorizontalGrid() );
+    actionCollection()->action("show_horizon"         )->setChecked( Options::showGround() );
+    actionCollection()->action("show_flags"           )->setChecked( Options::showFlags() );
     statusBar()->setVisible( Options::showStatusBar() );
 
     //color scheme
diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index 986f322..a8ac000 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -288,9 +288,9 @@
 			<whatsthis>Toggle whether constellation names are hidden while the display is in motion.</whatsthis>
 			<default>false</default>
 		</entry>
-		<entry name="HideGrid" type="Bool">
-			<label>Hide coordinate grid while moving?</label>
-			<whatsthis>Toggle whether the coordinate grid is hidden while the display is in motion.</whatsthis>
+		<entry name="HideGrids" type="Bool">
+			<label>Hide coordinate grids while moving?</label>
+			<whatsthis>Toggle whether the coordinate grids are hidden while the display is in motion.</whatsthis>
 			<default>true</default>
 		</entry>
 		<entry name="HideMilkyWay" type="Bool">
@@ -398,11 +398,16 @@
 			<whatsthis>Toggle whether the equator line is drawn in the sky map.</whatsthis>
 			<default>false</default>
 		</entry>
-		<entry name="ShowGrid" type="Bool">
-			<label>Draw coordinate grid in the sky map?</label>
-			<whatsthis>Toggle whether the coordinate grid is drawn in the sky map.</whatsthis>
+		<entry name="ShowEquatorialGrid" type="Bool">
+			<label>Draw equatorial coordinate grid in the sky map?</label>
+			<whatsthis>Toggle whether the equatorial coordinate grid is drawn in the sky map.</whatsthis>
 			<default>false</default>
 		</entry>
+        <entry name="ShowHorizontalGrid" type="Bool">
+            <label>Draw horizontal coordinate grid in the sky map?</label>
+            <whatsthis>Toggle whether the horizontal coordinate grid is drawn in the sky map.</whatsthis>
+            <default>false</default>
+        </entry>
 		<entry name="ShowGround" type="Bool">
 			<label>Draw opaque ground in the sky map?</label>
 			<whatsthis>Toggle whether the region below the horizon is opaque.</whatsthis>
@@ -784,11 +789,16 @@
 			<whatsthis>The color for the equator line.</whatsthis>
 			<default>#FFF</default>
 		</entry>
-		<entry name="GridColor" type="String">
-			<label>Color of coordinate grid lines</label>
-			<whatsthis>The color for the coordinate grid lines.</whatsthis>
+		<entry name="EquatorialGridColor" type="String">
+			<label>Color of equatorial coordinate grid lines</label>
+			<whatsthis>The color for the equatorial coordinate grid lines.</whatsthis>
 			<default>#456</default>
 		</entry>
+        <entry name="HorizontalGridColor" type="String">
+            <label>Color of horizontal coordinate grid lines</label>
+            <whatsthis>The color for the horizontal coordinate grid lines.</whatsthis>
+            <default>#5A3</default>
+        </entry>
 		<entry name="SpecialObjectColor" type="String">
 			<label>Color of objects with extra links available</label>
 			<whatsthis>The color for objects which have extra URL links available.</whatsthis>
diff --git a/kstars/kstarsactions.cpp b/kstars/kstarsactions.cpp
index ff5d516..ba7018a 100644
--- a/kstars/kstarsactions.cpp
+++ b/kstars/kstarsactions.cpp
@@ -156,11 +156,16 @@ void KStars::slotViewToolBar() {
         if ( kcd ) {
             opguides->kcfg_ShowMilkyWay->setChecked( a->isChecked() );
         }
-    } else if ( a == actionCollection()->action( "show_grid" ) ) {
-        Options::setShowGrid( a->isChecked() );
+    } else if ( a == actionCollection()->action( "show_equatorial_grid" ) ) {
+        Options::setShowEquatorialGrid( a->isChecked() );
         if ( kcd ) {
-            opguides->kcfg_ShowGrid->setChecked( a->isChecked() );
+            opguides->kcfg_ShowEquatorialGrid->setChecked( a->isChecked() );
         }
+    } else if ( a == actionCollection()->action( "show_horizontal_grid" ) ) {
+        Options::setShowHorizontalGrid( a->isChecked() );
+        if ( kcd ) {
+            opguides->kcfg_ShowHorizontalGrid->setChecked( a->isChecked() );
+        }    
     } else if ( a == actionCollection()->action( "show_horizon" ) ) {
         Options::setShowGround( a->isChecked() );
         if( !a->isChecked() && Options::useRefraction() ) {
diff --git a/kstars/kstarsdata.cpp b/kstars/kstarsdata.cpp
index 89cfb62..0417b60 100644
--- a/kstars/kstarsdata.cpp
+++ b/kstars/kstarsdata.cpp
@@ -1036,7 +1036,8 @@ bool KStarsData::executeScript( const QString &scriptname, SkyMap *map ) {
                 if ( fn[1] == "ShowNGC"         && bOk ) { Options::setShowNGC(      bVal ); cmdCount++; }
                 if ( fn[1] == "ShowIC"          && bOk ) { Options::setShowIC(       bVal ); cmdCount++; }
                 if ( fn[1] == "ShowMilkyWay"    && bOk ) { Options::setShowMilkyWay( bVal ); cmdCount++; }
-                if ( fn[1] == "ShowGrid"        && bOk ) { Options::setShowGrid(     bVal ); cmdCount++; }
+                if ( fn[1] == "ShowEquatorialGrid" && bOk ) { Options::setShowEquatorialGrid( bVal ); cmdCount++; }
+                if ( fn[1] == "ShowHorizontalGrid" && bOk ) { Options::setShowHorizontalGrid( bVal ); cmdCount++; }
                 if ( fn[1] == "ShowEquator"     && bOk ) { Options::setShowEquator(  bVal ); cmdCount++; }
                 if ( fn[1] == "ShowEcliptic"    && bOk ) { Options::setShowEcliptic( bVal ); cmdCount++; }
                 if ( fn[1] == "ShowHorizon"     && bOk ) { Options::setShowHorizon(  bVal ); cmdCount++; }
diff --git a/kstars/kstarsdcop.cpp b/kstars/kstarsdcop.cpp
index c045e47..c8f4108 100644
--- a/kstars/kstarsdcop.cpp
+++ b/kstars/kstarsdcop.cpp
@@ -313,7 +313,8 @@ void KStars::changeViewOption( const QString &op, const QString &val ) {
     if ( op == "ShowCBounds"     && bOk ) Options::setShowCBounds(  bVal );
     if ( op == "ShowCNames"      && bOk ) Options::setShowCNames(   bVal );
     if ( op == "ShowMilkyWay"    && bOk ) Options::setShowMilkyWay( bVal );
-    if ( op == "ShowGrid"        && bOk ) Options::setShowGrid(     bVal );
+    if ( op == "ShowEquatorialGrid" && bOk ) Options::setShowEquatorialGrid( bVal );
+    if ( op == "ShowHorizontalGrid" && bOk ) Options::setShowHorizontalGrid( bVal );
     if ( op == "ShowEquator"     && bOk ) Options::setShowEquator(  bVal );
     if ( op == "ShowEcliptic"    && bOk ) Options::setShowEcliptic( bVal );
     if ( op == "ShowHorizon"     && bOk ) Options::setShowHorizon(  bVal );
@@ -349,7 +350,7 @@ void KStars::changeViewOption( const QString &op, const QString &val ) {
     if ( op == "HideCNames"  && bOk ) Options::setHideCNames(  bVal );
     if ( op == "HideCLines"  && bOk ) Options::setHideCLines(  bVal );
     if ( op == "HideCBounds" && bOk ) Options::setHideCBounds( bVal );
-    if ( op == "HideGrid"    && bOk ) Options::setHideGrid(    bVal );
+    if ( op == "HideGrids"    && bOk ) Options::setHideGrids( bVal );
     if ( op == "HideLabels"  && bOk ) Options::setHideLabels(  bVal );
 
     if ( op == "UseAltAz"         && bOk ) Options::setUseAltAz(      bVal );
diff --git a/kstars/kstarsinit.cpp b/kstars/kstarsinit.cpp
index fa0e4b4..bbc70fe 100644
--- a/kstars/kstarsinit.cpp
+++ b/kstars/kstarsinit.cpp
@@ -484,10 +484,14 @@ void KStars::initActions() {
         << i18nc("Toggle Milky Way in the display", "Milky Way" )
         << KIcon("kstars_mw" )
         << ToolTip( i18n("Toggle milky way") );
-    actionCollection()->add<KToggleAction>("show_grid", this, SLOT( slotViewToolBar() ) )
-        << i18nc("Toggle Coordinate Grid in the display", "Coord. grid" )
+    actionCollection()->add<KToggleAction>("show_equatorial_grid", this, SLOT( slotViewToolBar() ) )
+        << i18nc("Toggle Equatorial Coordinate Grid in the display", "Equatorial coord. grid" )
         << KIcon("kstars_grid" )
-        << ToolTip( i18n("Toggle coordinate grid") );
+        << ToolTip( i18n("Toggle equatorial coordinate grid") );
+    actionCollection()->add<KToggleAction>("show_horizontal_grid", this, SLOT( slotViewToolBar() ) )
+        << i18nc("Toggle Horizontal Coordinate Grid in the display", "Horizontal coord. grid" )
+        << KIcon("kstars_hgrid" )
+        << ToolTip( i18n("Toggle horizontal coordinate grid") );
     actionCollection()->add<KToggleAction>("show_horizon", this, SLOT( slotViewToolBar() ) )
         << i18nc("Toggle the opaque fill of the ground polygon in the display", "Ground" )
         << KIcon("kstars_horizon" )
diff --git a/kstars/kstarsui-indi.rc b/kstars/kstarsui-indi.rc
index 6903a36..c9ba3c1 100644
--- a/kstars/kstarsui-indi.rc
+++ b/kstars/kstarsui-indi.rc
@@ -153,7 +153,8 @@
 	<Action name="show_cnames" />
 	<Action name="show_cbounds" />
 	<Action name="show_mw" />
-	<Action name="show_grid" />
+	<Action name="show_equatorial_grid" />
+    <Action name="show_horizontal_grid" />
 	<Action name="show_horizon" />
 </ToolBar>
 </kpartgui>
diff --git a/kstars/kstarsui-win.rc b/kstars/kstarsui-win.rc
index b9505a2..6e42c6c 100644
--- a/kstars/kstarsui-win.rc
+++ b/kstars/kstarsui-win.rc
@@ -147,7 +147,8 @@
 	<Action name="show_cnames" />
 	<Action name="show_cbounds" />
 	<Action name="show_mw" />
-	<Action name="show_grid" />
+	<Action name="show_equatorial_grid" />
+    <Action name="show_horizontal_grid" />
 	<Action name="show_horizon" />
 </ToolBar>
 </kpartgui>
diff --git a/kstars/kstarsui.rc b/kstars/kstarsui.rc
index 8080c36..9ee4b0e 100644
--- a/kstars/kstarsui.rc
+++ b/kstars/kstarsui.rc
@@ -147,7 +147,8 @@
 	<Action name="show_cnames" />
 	<Action name="show_cbounds" />
 	<Action name="show_mw" />
-	<Action name="show_grid" />
+	<Action name="show_equatorial_grid" />
+    <Action name="show_horizontal_grid" />
 	<Action name="show_horizon" />
 </ToolBar>
 </kpartgui>
diff --git a/kstars/options/opsadvanced.ui b/kstars/options/opsadvanced.ui
index 20fc9df..9321edd 100644
--- a/kstars/options/opsadvanced.ui
+++ b/kstars/options/opsadvanced.ui
@@ -397,15 +397,15 @@
          </widget>
         </item>
         <item row="6" column="1" >
-         <widget class="QCheckBox" name="kcfg_HideGrid" >
+         <widget class="QCheckBox" name="kcfg_HideGrids" >
           <property name="toolTip" >
-           <string>Hide coordinate grid while moving?</string>
+           <string>Hide coordinate grids while moving?</string>
           </property>
           <property name="whatsThis" >
-           <string>If checked, then the coordinate grid will be hidden when the map is in motion.</string>
+           <string>If checked, then the coordinate grids will be hidden when the map is in motion.</string>
           </property>
           <property name="text" >
-           <string>Coordinate grid</string>
+           <string>Coordinate grids</string>
           </property>
          </widget>
         </item>
@@ -504,7 +504,7 @@
   <tabstop>kcfg_HideMilkyWay</tabstop>
   <tabstop>kcfg_HideCNames</tabstop>
   <tabstop>kcfg_HideCLines</tabstop>
-  <tabstop>kcfg_HideGrid</tabstop>
+  <tabstop>kcfg_HideGrids</tabstop>
  </tabstops>
  <resources/>
  <connections/>
diff --git a/kstars/options/opsguides.ui b/kstars/options/opsguides.ui
index 3d94407..baec64d 100644
--- a/kstars/options/opsguides.ui
+++ b/kstars/options/opsguides.ui
@@ -193,15 +193,28 @@
     </spacer>
    </item>
    <item>
-    <widget class="QCheckBox" name="kcfg_ShowGrid" >
+    <widget class="QCheckBox" name="kcfg_ShowEquatorialGrid" >
      <property name="toolTip" >
-      <string>Draw coordinate grid?</string>
+      <string>Draw equatorial coordinate grid?</string>
      </property>
      <property name="whatsThis" >
       <string>If checked, a grid of lines will be drawn every 2 hours in Right Ascension and every 20 degrees in Declination.</string>
      </property>
      <property name="text" >
-      <string>Coor&dinate grid</string>
+      <string>Equatorial coor&dinate grid</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="kcfg_ShowHorizontalGrid" >
+     <property name="toolTip" >
+      <string>Draw horizontal coordinate grid?</string>
+     </property>
+     <property name="whatsThis" >
+      <string>If checked, a grid of lines will be drawn every 30 degrees in Azimuth and every 20 degrees in Altitude.</string>
+     </property>
+     <property name="text" >
+      <string>Horizontal coor&dinate grid</string>
      </property>
     </widget>
    </item>
diff --git a/kstars/skycomponents/coordinategrid.cpp b/kstars/skycomponents/coordinategrid.cpp
index 8b3cedb..fb85567 100644
--- a/kstars/skycomponents/coordinategrid.cpp
+++ b/kstars/skycomponents/coordinategrid.cpp
@@ -17,84 +17,7 @@
 
 #include "coordinategrid.h"
 
-#include <QPen>
-#include <QBrush>
-#include <QColor>
-
-#include "Options.h"
-#include "kstarsdata.h"
-#include "skymap.h"
-#include "linelist.h"
-#include "dms.h"
-
-#include "skypainter.h"
-
-CoordinateGrid::CoordinateGrid( SkyComposite *parent )
-        : NoPrecessIndex(parent, i18n("Coordinate Grid") )
-{
-    KStarsData *data = KStarsData::Instance();
-    //emitProgressText( i18n("Loading coordinate grid" ) );
-    intro();
-
-    // start the new fangled way here
-
-    double eps    =   0.1;
-    double minRa  =   0.0;
-    double maxRa  =  23.0;
-    double dRa    =   2.0;
-    double minDec = -80.0;
-    double maxDec =  90.0;
-    double dDec   =  20.0;
-    double dDec2  =   4.0;
-    double dRa2   =   0.2;
-
-    double max, dec, dec2, ra, ra2;
-
-    LineList* lineList;
-
-    for ( ra = minRa; ra < maxRa; ra += dRa ) {
-        for ( dec = -90.0; dec < maxDec - eps; dec += dDec ) {
-            lineList = new LineList();
-            max = dec + dDec;
-            if ( max > 90.0 ) max = 90.0;
-            for ( dec2 = dec; dec2 <= max + eps; dec2 += dDec2 ) {
-                SkyPoint* p = new SkyPoint( ra, dec2 );
-                p->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
-                lineList->append( p );
-            }
-            appendLine( lineList );
-        }
-    }
-
-    for ( dec = minDec; dec < maxDec + eps; dec += dDec ) {
-        // Adjust point density
-        int nPoints = int(round( fabs(cos(dec* dms::PI / 180.0)) * dRa / dRa2 ));
-        if ( nPoints < 5 )
-            nPoints = 5;
-        double dRa3 = dRa / nPoints;
-
-        for ( ra = minRa; ra < maxRa + eps; ra += dRa ) {
-            lineList = new LineList();
-            for ( ra2 = ra; ra2 <= ra + dRa + eps; ra2 += dRa3 ) {
-                SkyPoint* p = new SkyPoint( ra2, dec );
-                p->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
-                lineList->append( p );
-            }
-            appendLine( lineList );
-        }
-    }
-    summary();
-}
-
-bool CoordinateGrid::selected()
-{
-    return Options::showGrid() &&
-           ! ( Options::hideOnSlew() && Options::hideGrid() && SkyMap::IsSlewing() );
-}
-
-void CoordinateGrid::preDraw( SkyPainter* skyp )
+CoordinateGrid::CoordinateGrid( SkyComposite *parent, const QString& name )
+        : NoPrecessIndex( parent, name )
 {
-    KStarsData *data = KStarsData::Instance();
-    QColor color = data->colorScheme()->colorNamed( "GridColor" );
-    skyp->setPen( QPen( QBrush( color ), 1, Qt::DotLine ) );
 }
diff --git a/kstars/skycomponents/coordinategrid.h b/kstars/skycomponents/coordinategrid.h
index e0c17e4..5a6a673 100644
--- a/kstars/skycomponents/coordinategrid.h
+++ b/kstars/skycomponents/coordinategrid.h
@@ -36,11 +36,11 @@ public:
     	*(meridians and parallels)
     	*@p parent Pointer to the parent SkyComposite object
     	*/
-    CoordinateGrid( SkyComposite *parent );
+    CoordinateGrid( SkyComposite *parent, const QString& name );
 
-    void preDraw( SkyPainter *skyp );
+    virtual void preDraw( SkyPainter *skyp ) = 0;
 
-    bool selected();
+    virtual bool selected() = 0;
 };
 
 
diff --git a/kstars/skycomponents/coordinategrid.cpp b/kstars/skycomponents/equatorialcoordinategrid.cpp
similarity index 76%
copy from kstars/skycomponents/coordinategrid.cpp
copy to kstars/skycomponents/equatorialcoordinategrid.cpp
index 8b3cedb..8bd1e0d 100644
--- a/kstars/skycomponents/coordinategrid.cpp
+++ b/kstars/skycomponents/equatorialcoordinategrid.cpp
@@ -1,9 +1,9 @@
 /***************************************************************************
-                          coordinategrid.h  -  K Desktop Planetarium
+                    equatorialcoordinategrid.cpp  -  K Desktop Planetarium
                              -------------------
-    begin                : 15 Sept. 2005
-    copyright            : (C) 2005 by Jason Harris
-    email                : kstars at 30doradus.org
+    begin                : Tue 01 Mar 2012
+    copyright            : (C) 2012 by Jerome SONRIER
+    email                : jsid at emor3j.fr.eu.org
  ***************************************************************************/
 
 /***************************************************************************
@@ -15,7 +15,7 @@
  *                                                                         *
  ***************************************************************************/
 
-#include "coordinategrid.h"
+#include "equatorialcoordinategrid.h"
 
 #include <QPen>
 #include <QBrush>
@@ -29,14 +29,12 @@
 
 #include "skypainter.h"
 
-CoordinateGrid::CoordinateGrid( SkyComposite *parent )
-        : NoPrecessIndex(parent, i18n("Coordinate Grid") )
+EquatorialCoordinateGrid::EquatorialCoordinateGrid( SkyComposite *parent )
+        : CoordinateGrid( parent, i18n("Equatorial Coordinate Grid" ) )
 {
     KStarsData *data = KStarsData::Instance();
-    //emitProgressText( i18n("Loading coordinate grid" ) );
-    intro();
 
-    // start the new fangled way here
+    intro();
 
     double eps    =   0.1;
     double minRa  =   0.0;
@@ -67,6 +65,10 @@ CoordinateGrid::CoordinateGrid( SkyComposite *parent )
     }
 
     for ( dec = minDec; dec < maxDec + eps; dec += dDec ) {
+        // Do not paint the line on the equator
+        if ( dec < 0.1 && dec > -0.1 )
+            continue;
+        
         // Adjust point density
         int nPoints = int(round( fabs(cos(dec* dms::PI / 180.0)) * dRa / dRa2 ));
         if ( nPoints < 5 )
@@ -83,18 +85,19 @@ CoordinateGrid::CoordinateGrid( SkyComposite *parent )
             appendLine( lineList );
         }
     }
+    
     summary();
 }
 
-bool CoordinateGrid::selected()
+bool EquatorialCoordinateGrid::selected()
 {
-    return Options::showGrid() &&
-           ! ( Options::hideOnSlew() && Options::hideGrid() && SkyMap::IsSlewing() );
+    return Options::showEquatorialGrid() &&
+           ! ( Options::hideOnSlew() && Options::hideGrids() && SkyMap::IsSlewing() );
 }
 
-void CoordinateGrid::preDraw( SkyPainter* skyp )
+void EquatorialCoordinateGrid::preDraw( SkyPainter* skyp )
 {
     KStarsData *data = KStarsData::Instance();
-    QColor color = data->colorScheme()->colorNamed( "GridColor" );
+    QColor color = data->colorScheme()->colorNamed( "EquatorialGridColor" );
     skyp->setPen( QPen( QBrush( color ), 1, Qt::DotLine ) );
 }
diff --git a/kstars/skycomponents/coordinategrid.h b/kstars/skycomponents/equatorialcoordinategrid.h
similarity index 63%
copy from kstars/skycomponents/coordinategrid.h
copy to kstars/skycomponents/equatorialcoordinategrid.h
index e0c17e4..03245b2 100644
--- a/kstars/skycomponents/coordinategrid.h
+++ b/kstars/skycomponents/equatorialcoordinategrid.h
@@ -1,9 +1,9 @@
 /***************************************************************************
-                          coordinategrid.h  -  K Desktop Planetarium
+                      equatorialcoordinategrid.h  -  K Desktop Planetarium
                              -------------------
-    begin                : 15 Sept. 2005
-    copyright            : (C) 2005 by Jason Harris
-    email                : kstars at 30doradus.org
+    begin                : Tue 01 Mar 2012
+    copyright            : (C) 2012 by Jerome SONRIER
+    email                : jsid at emor3j.fr.eu.org
  ***************************************************************************/
 
 /***************************************************************************
@@ -15,28 +15,28 @@
  *                                                                         *
  ***************************************************************************/
 
-#ifndef COORDINATEGRID_H
-#define COORDINATEGRID_H
+#ifndef EQUATORIALCOORDINATEGRID_H
+#define EQUATORIALCOORDINATEGRID_H
 
-#include "noprecessindex.h"
+#include "coordinategrid.h"
 
 /**
-	*@class CoordinateGrid
-	*Collection of all the circles in the coordinate grid
+	*@class EquatorialCoordinateGrid
+	*Collection of all the circles in the equatorial coordinate grid
 
-	*@author Jason Harris
+	*@author Jérôme SONRIER
 	*@version 0.1
 	*/
-class CoordinateGrid : public NoPrecessIndex
+class EquatorialCoordinateGrid : public CoordinateGrid
 {
 public:
     /**
     	*@short Constructor
-    	*Simply adds all of the coordinate grid circles 
+    	*Simply adds all of the equatorial coordinate grid circles 
     	*(meridians and parallels)
     	*@p parent Pointer to the parent SkyComposite object
     	*/
-    CoordinateGrid( SkyComposite *parent );
+    EquatorialCoordinateGrid( SkyComposite *parent );
 
     void preDraw( SkyPainter *skyp );
 
diff --git a/kstars/skycomponents/horizontalcoordinategrid.cpp b/kstars/skycomponents/horizontalcoordinategrid.cpp
new file mode 100644
index 0000000..06c57d8
--- /dev/null
+++ b/kstars/skycomponents/horizontalcoordinategrid.cpp
@@ -0,0 +1,118 @@
+/***************************************************************************
+                      horizontalcoordinategrid.h  -  K Desktop Planetarium
+                             -------------------
+    begin                : Tue 01 Mar 2012
+    copyright            : (C) 2012 by Jerome SONRIER
+    email                : jsid at emor3j.fr.eu.org
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "horizontalcoordinategrid.h"
+
+#include <QPen>
+#include <QBrush>
+#include <QColor>
+
+#include "Options.h"
+#include "kstarsdata.h"
+#include "skymap.h"
+#include "linelist.h"
+#include "dms.h"
+
+#include "skypainter.h"
+
+HorizontalCoordinateGrid::HorizontalCoordinateGrid( SkyComposite *parent )
+        : CoordinateGrid( parent, i18n("Horizontal Coordinate Grid" ) )
+{
+    //KStarsData *data = KStarsData::Instance();
+    
+    intro();
+
+    double eps    =   0.1;
+    double minAz  =   0.0;
+    double maxAz  = 359.0;
+    double dAz    =  30.0;
+    double minAlt = -80.0;
+    double maxAlt =  90.0;
+    double dAlt   =  20.0;
+    double dAlt2  =   4.0;
+    double dAz2   =   0.2;
+
+    double max, alt, alt2, az, az2;
+
+    LineList* lineList;
+    
+   
+    for ( az = minAz; az < maxAz; az += dAz ) {
+        for ( alt = -90.0; alt < maxAlt - eps; alt += dAlt ) {
+            lineList = new LineList();
+            max = alt + dAlt;
+            if ( max > 90.0 ) max = 90.0;
+            for ( alt2 = alt; alt2 <= max + eps; alt2 += dAlt2 ) {
+                SkyPoint* p = new SkyPoint();
+                p->setAz( az );
+                p->setAlt( alt2 );
+                //p->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
+                lineList->append( p );
+            }
+            appendLine( lineList );
+        }
+    }
+
+    for ( alt = minAlt; alt < maxAlt + eps; alt += dAlt ) {
+        // Do not paint the line on the horizon
+        if ( alt < 0.1 && alt > -0.1 )
+            continue;
+        
+        // Adjust point density
+        int nPoints = int(round( fabs(cos(alt* dms::PI / 180.0)) * dAz / dAz2 ));
+        if ( nPoints < 5 )
+            nPoints = 5;
+        double dAz3 = dAz / nPoints;
+
+        for ( az = minAz; az < maxAz + eps; az += dAz ) {
+            lineList = new LineList();
+            for ( az2 = az; az2 <= az + dAz + eps; az2 += dAz3 ) {
+                SkyPoint* p = new SkyPoint();
+                p->setAz( az2 );
+                p->setAlt( alt );
+                //p->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
+                lineList->append( p );
+            }
+            appendLine( lineList );
+        }
+    }
+    summary();
+}
+
+bool HorizontalCoordinateGrid::selected()
+{
+    return Options::showHorizontalGrid() &&
+           ! ( Options::hideOnSlew() && Options::hideGrids() && SkyMap::IsSlewing() );
+}
+
+void HorizontalCoordinateGrid::preDraw( SkyPainter* skyp )
+{
+    KStarsData *data = KStarsData::Instance();
+    QColor color = data->colorScheme()->colorNamed( "HorizontalGridColor" );
+    skyp->setPen( QPen( QBrush( color ), 1, Qt::DotLine ) );
+}
+
+void HorizontalCoordinateGrid::update( KSNumbers* )
+{
+    KStarsData *data = KStarsData::Instance();
+
+    for ( int i=0; i<listList().count(); i++ ) {
+        for ( int j=0; j<listList().at( i )->points()->count(); j++ ) {
+            listList().at( i )->points()->at( j )->HorizontalToEquatorial( data->lst(), data->geo()->lat() );
+        }
+    }
+}
diff --git a/kstars/skycomponents/coordinategrid.h b/kstars/skycomponents/horizontalcoordinategrid.h
similarity index 65%
copy from kstars/skycomponents/coordinategrid.h
copy to kstars/skycomponents/horizontalcoordinategrid.h
index e0c17e4..67f462f 100644
--- a/kstars/skycomponents/coordinategrid.h
+++ b/kstars/skycomponents/horizontalcoordinategrid.h
@@ -1,9 +1,9 @@
 /***************************************************************************
-                          coordinategrid.h  -  K Desktop Planetarium
+                      horizontalcoordinategrid.h  -  K Desktop Planetarium
                              -------------------
-    begin                : 15 Sept. 2005
-    copyright            : (C) 2005 by Jason Harris
-    email                : kstars at 30doradus.org
+    begin                : Tue 01 Mar 2012
+    copyright            : (C) 2012 by Jerome SONRIER
+    email                : jsid at emor3j.fr.eu.org
  ***************************************************************************/
 
 /***************************************************************************
@@ -15,19 +15,19 @@
  *                                                                         *
  ***************************************************************************/
 
-#ifndef COORDINATEGRID_H
-#define COORDINATEGRID_H
+#ifndef HORIZONTALCOORDINATEGRID_H
+#define HORIZONTALCOORDINATEGRID_H
 
-#include "noprecessindex.h"
+#include "coordinategrid.h"
 
 /**
-	*@class CoordinateGrid
-	*Collection of all the circles in the coordinate grid
+	*@class HorizontalCoordinateGrid
+	*Collection of all the circles in the horizontal coordinate grid
 
-	*@author Jason Harris
+	*@author Jérôme SONRIER
 	*@version 0.1
 	*/
-class CoordinateGrid : public NoPrecessIndex
+class HorizontalCoordinateGrid : public CoordinateGrid
 {
 public:
     /**
@@ -36,9 +36,11 @@ public:
     	*(meridians and parallels)
     	*@p parent Pointer to the parent SkyComposite object
     	*/
-    CoordinateGrid( SkyComposite *parent );
+    HorizontalCoordinateGrid( SkyComposite *parent );
 
     void preDraw( SkyPainter *skyp );
+    
+    void update( KSNumbers* );
 
     bool selected();
 };
diff --git a/kstars/skycomponents/linelistindex.cpp b/kstars/skycomponents/linelistindex.cpp
index 160febc..74e50c1 100644
--- a/kstars/skycomponents/linelistindex.cpp
+++ b/kstars/skycomponents/linelistindex.cpp
@@ -179,13 +179,7 @@ void LineListIndex::drawLines( SkyPainter *skyp )
     DrawID   drawID   = skyMesh()->drawID();
     UpdateID updateID = KStarsData::Instance()->updateID();
 
-    MeshIterator region( skyMesh(), drawBuffer() );
-
-    while ( region.hasNext() ) {
-        LineListList* lineListList = m_lineIndex->value( region.next() );
-        if ( lineListList == 0 )
-            continue;
-
+    foreach ( LineListList* lineListList, m_lineIndex->values() ) {
         for (int i = 0; i < lineListList->size(); i++) {
             LineList* lineList = lineListList->at( i );
 
diff --git a/kstars/skycomponents/linelistindex.h b/kstars/skycomponents/linelistindex.h
index b4d4f95..eb2cc8e 100644
--- a/kstars/skycomponents/linelistindex.h
+++ b/kstars/skycomponents/linelistindex.h
@@ -150,6 +150,8 @@ protected:
 
     virtual LineListLabel* label() {return 0;};
     
+    inline LineListList  listList() { return m_listList; }
+    
 private:
     QString      m_name;
 
diff --git a/kstars/skycomponents/skymapcomposite.cpp b/kstars/skycomponents/skymapcomposite.cpp
index 8422e10..1b8beb6 100644
--- a/kstars/skycomponents/skymapcomposite.cpp
+++ b/kstars/skycomponents/skymapcomposite.cpp
@@ -32,7 +32,8 @@
 #include "constellationlines.h"
 #include "culturelist.h"
 #include "constellationnamescomponent.h"
-#include "coordinategrid.h"
+#include "equatorialcoordinategrid.h"
+#include "horizontalcoordinategrid.h"
 #include "customcatalogcomponent.h"
 #include "deepskycomponent.h"
 #include "equator.h"
@@ -71,7 +72,8 @@ SkyMapComposite::SkyMapComposite(SkyComposite *parent ) :
     //Stars must come before constellation lines
     addComponent( m_MilkyWay       = new MilkyWay( this ));
     addComponent( m_Stars          = StarComponent::Create( this ));
-    addComponent( m_CoordinateGrid = new CoordinateGrid( this ));
+    addComponent( m_EquatorialCoordinateGrid = new EquatorialCoordinateGrid( this ));
+    addComponent( m_HorizontalCoordinateGrid = new HorizontalCoordinateGrid( this ));
 
     // Do add to components.
     addComponent( m_CBoundLines = new ConstellationBoundaryLines( this ));
@@ -117,7 +119,8 @@ void SkyMapComposite::update(KSNumbers *num )
     //1. Milky Way
     //m_MilkyWay->update( data, num );
     //2. Coordinate grid
-    //m_CoordinateGrid->update( data, num );
+    //m_EquatorialCoordinateGrid->update( num );
+    m_HorizontalCoordinateGrid->update( num );
     //3. Constellation boundaries
     //m_CBounds->update( data, num );
     //4. Constellation lines
@@ -197,7 +200,7 @@ void SkyMapComposite::draw( SkyPainter *skyp )
     m_skyMesh->aperture( focus, radius + 1.0, DRAW_BUF ); // divide by 2 for testing
 
     // create the no-precess aperture if needed
-    if ( Options::showGrid() || Options::showCBounds() || Options::showEquator() ) {
+    if ( Options::showEquatorialGrid() || Options::showHorizontalGrid() || Options::showCBounds() || Options::showEquator() ) {
         m_skyMesh->index( focus, radius + 1.0, NO_PRECESS_BUF );
     }
 
@@ -220,7 +223,8 @@ void SkyMapComposite::draw( SkyPainter *skyp )
 
     m_MilkyWay->draw( skyp );
 
-    m_CoordinateGrid->draw( skyp );
+    m_EquatorialCoordinateGrid->draw( skyp );
+    m_HorizontalCoordinateGrid->draw( skyp );
 
     // Draw constellation boundary lines only if we draw western constellations
     if ( m_Cultures->current() == "Western" )
diff --git a/kstars/skycomponents/skymapcomposite.h b/kstars/skycomponents/skymapcomposite.h
index bc93f7f..5a516f1 100644
--- a/kstars/skycomponents/skymapcomposite.h
+++ b/kstars/skycomponents/skymapcomposite.h
@@ -33,7 +33,8 @@ class CultureList;
 class ConstellationBoundaryLines;
 class ConstellationLines;
 class ConstellationNamesComponent;
-class CoordinateGrid;
+class EquatorialCoordinateGrid;
+class HorizontalCoordinateGrid;
 class DeepSkyComponent;
 class Ecliptic;
 class Equator;
@@ -205,7 +206,8 @@ private:
     ConstellationBoundaryLines  *m_CBoundLines;
     ConstellationNamesComponent *m_CNames;
     ConstellationLines          *m_CLines;
-    CoordinateGrid              *m_CoordinateGrid;
+    EquatorialCoordinateGrid    *m_EquatorialCoordinateGrid;
+    HorizontalCoordinateGrid    *m_HorizontalCoordinateGrid;
     DeepSkyComponent            *m_DeepSky;
     Equator                     *m_Equator;
     Ecliptic                    *m_Ecliptic;



More information about the Kstars-devel mailing list