SVN commit 1144329 by khudyakov: Remove funnctions SkyMap::setDestination{,AltAz} which accept doubles as parameters. This improve type safety and reduce number of possibilities to screw something CCMAIL: kstars-devel@kde.org M +7 -7 kstarsactions.cpp M +1 -1 kstarsdcop.cpp M +2 -15 skymap.cpp M +0 -20 skymap.h M +1 -1 skymapdraw.cpp M +2 -2 skymapevents.cpp --- trunk/KDE/kdeedu/kstars/kstars/kstarsactions.cpp #1144328:1144329 @@ -693,15 +693,15 @@ map()->stopTracking(); if ( sender() == actionCollection()->action("zenith") ) - map()->setDestinationAltAz( 90.0, map()->focus()->az().Degrees() ); + map()->setDestinationAltAz( dms(90.0), map()->focus()->az() ); else if ( sender() == actionCollection()->action("north") ) - map()->setDestinationAltAz( 15.0, 0.0001 ); + map()->setDestinationAltAz( dms(15.0), dms(0.0001) ); else if ( sender() == actionCollection()->action("east") ) - map()->setDestinationAltAz( 15.0, 90.0 ); + map()->setDestinationAltAz( dms(15.0), dms(90.0) ); else if ( sender() == actionCollection()->action("south") ) - map()->setDestinationAltAz( 15.0, 180.0 ); + map()->setDestinationAltAz( dms(15.0), dms(180.0) ); else if ( sender() == actionCollection()->action("west") ) - map()->setDestinationAltAz( 15.0, 270.0 ); + map()->setDestinationAltAz( dms(15.0), dms(270.0) ); } void KStars::slotTrack() { @@ -768,9 +768,9 @@ //automatically correct the final pointing from the intermediate offset position to the final position data()->setSnapNextFocus(); if ( Options::useAltAz() ) { - map()->setDestinationAltAz( focusDialog->point().alt().Degrees(), focusDialog->point().az().Degrees() ); + map()->setDestinationAltAz( focusDialog->point().alt(), focusDialog->point().az() ); } else { - map()->setDestination( focusDialog->point().ra().Hours(), focusDialog->point().dec().Degrees() ); + map()->setDestination( focusDialog->point().ra(), focusDialog->point().dec() ); } //Now, if the requested point was near a pole, we need to reset the Alt/Dec of the focus. --- trunk/KDE/kdeedu/kstars/kstars/kstarsdcop.cpp #1144328:1144329 @@ -65,7 +65,7 @@ } void KStars::setAltAz( double alt, double az ) { - map()->setDestinationAltAz(alt,az); + map()->setDestinationAltAz( dms(alt), dms(az) ); } void KStars::lookTowards ( const QString &direction ) { --- trunk/KDE/kdeedu/kstars/kstars/skymap.cpp #1144328:1144329 @@ -397,7 +397,7 @@ //update the destination to the selected coordinates if ( Options::useAltAz() ) { - setDestinationAltAz( focusPoint()->altRefracted().Degrees(), focusPoint()->az().Degrees() ); + setDestinationAltAz( focusPoint()->altRefracted(), focusPoint()->az() ); } else { setDestination( focusPoint() ); } @@ -701,17 +701,11 @@ } void SkyMap::setDestination( const dms &ra, const dms &dec ) { - Destination.set( ra, dec ); + destination()->set( ra, dec ); destination()->EquatorialToHorizontal( data->lst(), data->geo()->lat() ); emit destinationChanged(); } -void SkyMap::setDestination( double ra, double dec ) { - Destination.set( ra, dec ); - destination()->EquatorialToHorizontal( data->lst(), data->geo()->lat() ); - emit destinationChanged(); -} - void SkyMap::setDestinationAltAz( const dms &alt, const dms &az) { destination()->setAlt(alt); destination()->setAz(az); @@ -719,13 +713,6 @@ emit destinationChanged(); } -void SkyMap::setDestinationAltAz(double alt, double az) { - destination()->setAlt(alt); - destination()->setAz(az); - destination()->HorizontalToEquatorial( data->lst(), data->geo()->lat() ); - emit destinationChanged(); -} - void SkyMap::setClickedPoint( SkyPoint *f ) { ClickedPoint = *f; } --- trunk/KDE/kdeedu/kstars/kstars/skymap.h #1144328:1144329 @@ -181,32 +181,12 @@ */ void setDestination( const dms &ra, const dms &dec ); - /**@short sets the destination point of the sky map, using ra/dec coordinates - * - *@note This function behaves essentially like the above function. - *It differs only in the data types of its arguments. - * - *@param ra the new right ascension - *@param dec the new declination - */ - void setDestination(double ra, double dec); - /**@short sets the destination point of the sky map, using its alt/az coordinates. *@param alt the new altitude *@param az the new azimuth */ void setDestinationAltAz( const dms &alt, const dms & az); - /**@short sets the destination point of the sky map, using its alt/az coordinates. - * - *@note This function behaves essentially like the above function. - *It differs only in the data types of its arguments. - * - *@param alt the new altitude - *@param az the new azimuth - */ - void setDestinationAltAz(double alt, double az); - /**@short set the FocusPoint; the position that is to be the next Destination. *@param f a pointer to the FocusPoint SkyPoint. */ --- trunk/KDE/kdeedu/kstars/kstars/skymapdraw.cpp #1144328:1144329 @@ -290,7 +290,7 @@ psky.setPen( data->colorScheme()->colorNamed( "UserLabelColor" ) ); - bool drawPlanets = Options::showSolarSystem() && !(checkSlewing && Options::hidePlanets(); + bool drawPlanets = Options::showSolarSystem() && !(checkSlewing && Options::hidePlanets()); bool drawComets = drawPlanets && Options::showComets(); bool drawAsteroids = drawPlanets && Options::showAsteroids(); bool drawMessier = Options::showDeepSky() && ( Options::showMessier() || Options::showMessierImages() ) && !(checkSlewing && Options::hideMessier() ); --- trunk/KDE/kdeedu/kstars/kstars/skymapevents.cpp #1144328:1144329 @@ -394,7 +394,7 @@ scrollCount = 0; if ( Options::useAltAz() ) - setDestinationAltAz( focus()->alt().Degrees(), focus()->az().Degrees() ); + setDestinationAltAz( focus()->alt(), focus()->az() ); else setDestination( focus() ); @@ -548,7 +548,7 @@ slewing = false; if ( Options::useAltAz() ) - setDestinationAltAz( focus()->alt().Degrees(), focus()->az().Degrees() ); + setDestinationAltAz( focus()->alt(), focus()->az() ); else setDestination( focus() ); } _______________________________________________ Kstars-devel mailing list Kstars-devel@kde.org https://mail.kde.org/mailman/listinfo/kstars-devel