[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Sun Feb 20 02:53:25 CET 2005


CVS commit by harris: 

Two refraction-related fixes found while going through the QA list:

slotCenter() centered on position of object without atmospheric refraction 
correction (which got corrected by the first clock update, but went unfixed 
if clock was paused).  Fixed by determining the refracted position if 
Options::useRefraction() is true.

Also added Options::useRefraction() as final argument to dXdYToRaDec() in 
several places in skymap.cpp and skymapevents.cpp.  The argument was missing 
and defaults to "true", so there was slightly strange behavior when 
refraction correction was turned off.

much more to come...

CCMAIL: kstars-devel at kde.org


  M +9 -5      skymap.cpp   1.153
  M +3 -3      skymapevents.cpp   1.101


--- kdeedu/kstars/kstars/skymap.cpp  #1.152:1.153
@@ -523,4 +523,7 @@ void SkyMap::slotCenter( void ) {
         //update the destination to the selected coordinates
         if ( Options::useAltAz() ) { 
+                if ( Options::useRefraction() )
+                        setDestinationAltAz( refract( focusPoint()->alt(), true ).Degrees(), focusPoint()->az()->Degrees() );
+                else
                 setDestinationAltAz( focusPoint()->alt()->Degrees(), focusPoint()->az()->Degrees() );
         } else {
@@ -813,7 +816,8 @@ void SkyMap::updateFocus() {
                 if ( Options::useAltAz() ) {
                         //Tracking any object in Alt/Az mode requires focus updates
-                        setFocusAltAz(
-                                        refract( focusObject()->alt(), true ).Degrees(),
-                                        focusObject()->az()->Degrees() );
+                        double dAlt = focusObject()->alt()->Degrees();
+                        if ( Options::useRefraction() ) 
+                                dAlt = refract( focusObject()->alt(), true ).Degrees();
+                        setFocusAltAz( dAlt, focusObject()->az()->Degrees() );
                         focus()->HorizontalToEquatorial( data->LST, data->geo()->lat() );
                         setDestination( focus() );
@@ -1142,5 +1146,5 @@ void SkyMap::forceUpdate( bool now )
         if (! unusablePoint (dx, dy)) {
                 //determine RA, Dec of mouse pointer
-                setMousePoint( dXdYToRaDec( dx, dy, Options::useAltAz(), data->LST, data->geo()->lat() ) );
+                setMousePoint( dXdYToRaDec( dx, dy, Options::useAltAz(), data->LST, data->geo()->lat(), Options::useRefraction() ) );
         }
 

--- kdeedu/kstars/kstars/skymapevents.cpp  #1.100:1.101
@@ -476,5 +476,5 @@ void SkyMap::mouseMoveEvent( QMouseEvent
 
         //determine RA, Dec of mouse pointer
-        setMousePoint( dXdYToRaDec( dx, dy, Options::useAltAz(), data->LST, data->geo()->lat() ) );
+        setMousePoint( dXdYToRaDec( dx, dy, Options::useAltAz(), data->LST, data->geo()->lat(), Options::useRefraction() ) );
         mousePoint()->EquatorialToHorizontal( data->LST, data->geo()->lat() );
 
@@ -540,5 +540,5 @@ void SkyMap::mouseMoveEvent( QMouseEvent
 
                 //redetermine RA, Dec of mouse pointer, using new focus
-                setMousePoint( dXdYToRaDec( dx, dy, Options::useAltAz(), data->LST, data->geo()->lat() ) );
+                setMousePoint( dXdYToRaDec( dx, dy, Options::useAltAz(), data->LST, data->geo()->lat(), Options::useRefraction() ) );
                 setClickedPoint( mousePoint() );
 
@@ -580,5 +580,5 @@ void SkyMap::mouseReleaseEvent( QMouseEv
                 double dy = ( 0.5*height() - ZoomRect.center().y() )/Options::zoomFactor();
 
-                SkyPoint newcenter = dXdYToRaDec( dx, dy, Options::useAltAz(), data->LST, data->geo()->lat() );
+                SkyPoint newcenter = dXdYToRaDec( dx, dy, Options::useAltAz(), data->LST, data->geo()->lat(), Options::useRefraction() );
                 setClickedPoint( &newcenter );
                 setClickedObject( NULL );




More information about the Kstars-devel mailing list