[Kstars-devel] KDE/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Fri Feb 17 15:55:28 CET 2006


SVN commit 510578 by harris:

Added missing function DeepSkyComponent::update()

This seems to have fixed the problem where DSOs were rotating with zoom 
level.

CCMAIL: kstars-devel at kde.org


 M  +0 -3      kstarsinit.cpp  
 M  +18 -3     skycomponents/deepskycomponent.cpp  
 M  +15 -0     skycomponents/deepskycomponent.h  
 M  +3 -3      skycomponents/listcomponent.h  


--- trunk/KDE/kdeedu/kstars/kstars/kstarsinit.cpp #510577:510578
@@ -401,9 +401,6 @@
 	//Initialize Observing List
 	obsList = new ObservingList( this, this );
 
-	//DEBUG
-	kDebug() << "here" << endl;
-
 	data()->setFullTimeUpdate();
 	updateTime();
 
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/deepskycomponent.cpp #510577:510578
@@ -184,6 +184,16 @@
 	} //end for-loop through ngcic files
 }
 
+void DeepSkyComponent::update( KStarsData *data, KSNumbers *num )
+{
+	if ( visible() ) {
+		foreach ( SkyObject *o, objectList() ) {
+			if ( num ) o->updateCoords( num );
+			o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+		}
+	}
+}
+
 void DeepSkyComponent::draw(KStars *ks, QPainter& psky, double scale)
 {
 	if ( ! visible() ) return;
@@ -244,12 +254,17 @@
 		foreach ( DeepSkyObject *obj, catalog ) {
 			if ( map->checkVisibility( obj ) ) {
 				float mag = obj->mag();
-				//only draw objects if flags set and its brighter than maglim (unless mag is undefined (=99.9)
-				if ( mag > 90.0 || mag < (float)maglim ) {
+				float size = scale * obj->a() * dms::PI * Options::zoomFactor() / 10800.0;
+
+				//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 > 90.0 || mag < (float)maglim) ) {
 					QPointF o = map->getXY( obj, Options::useAltAz(), Options::useRefraction(), scale );
 					if ( o.x() >= 0. && o.x() <= Width && o.y() >= 0. && o.y() <= Height ) {
 						//PA for Deep-Sky objects is 90 + PA because major axis is horizontal at PA=0
-						double PositionAngle = 90. - map->findPA( obj, o.x(), o.y(), scale );
+						double PositionAngle = 90. + map->findPA( obj, o.x(), o.y(), scale );
 
 						//Draw Image
 						if ( drawImage && Options::zoomFactor() > 5.*MINZOOM ) {
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/deepskycomponent.h #510577:510578
@@ -55,6 +55,21 @@
 
 		virtual void init(KStarsData *data);
 
+		/**
+			*@short Update the sky positions of this component.
+			*
+			*This function usually just updates the Horizontal (Azimuth/Altitude)
+			*coordinates of the objects in this component.  If the KSNumbers* 
+			*argument is not NULL, this function also recomputes precession and
+			*nutation for the date in KSNumbers.
+			*@p data Pointer to the KStarsData object
+			*@p num Pointer to the KSNumbers object
+			*@note By default, the num parameter is NULL, indicating that 
+			*Precession/Nutation computation should be skipped; this computation 
+			*is only occasionally required.
+			*/
+		virtual void update( KStarsData *data, KSNumbers *num=0 );
+		
 		bool (*visibleMessier)();
 		bool (*visibleNGC)();
 		bool (*visibleIC)();
--- trunk/KDE/kdeedu/kstars/kstars/skycomponents/listcomponent.h #510577:510578
@@ -58,9 +58,9 @@
 			*@short Update the sky positions of this component.
 			*
 			*This function usually just updates the Horizontal (Azimuth/Altitude)
-			*coordinates of the objects in this component.  However, the precession
-			*and nutation must also be recomputed periodically.  Requests to do
-			*so are sent through the doPrecess parameter.
+			*coordinates of the objects in this component.  If the KSNumbers* 
+			*argument is not NULL, this function also recomputes precession and
+			*nutation for the date in KSNumbers.
 			*@p data Pointer to the KStarsData object
 			*@p num Pointer to the KSNumbers object
 			*@note By default, the num parameter is NULL, indicating that 


More information about the Kstars-devel mailing list