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

Alexey Khudyakov alexey.skladnoy at gmail.com
Wed Mar 10 17:54:27 CET 2010


SVN commit 1101702 by khudyakov:

Remove quaternion stuff from SkyMap. It's a bit sad but they are
broken. Last time I checked it generated some very strange projections.

Any attempts to calculate projection using quaternions will
require rewrite of deleted code so it's not big loss.

CCMAIL: kstars-devel at kde.org

 M  +0 -20     skymap.cpp  
 M  +9 -13     skymap.h  


--- trunk/KDE/kdeedu/kstars/kstars/skymap.cpp #1101701:1101702
@@ -698,10 +698,6 @@
 }
 
 void SkyMap::setFocus( double ra, double dec ) {
-    //QUATERNION
-    m_rotAxis.createFromEuler( (dec)*dms::DegToRad, (15.0*ra)*dms::DegToRad, 0.0 );
-    m_rotAxis = m_rotAxis.inverse();
-
     Focus.set( ra, dec );
     Options::setFocusRA( ra );
     Options::setFocusDec( dec );
@@ -924,22 +920,6 @@
     return ( north + o->pa() );
 }
 
-//QUATERNION
-QPointF SkyMap::toScreenQuaternion( SkyPoint *o ) {
-    Quaternion oq = o->quat();
-    //	Quaternion invRotAxis = m_rotAxis.inverse();
-    oq.rotateAroundAxis( m_rotAxis );
-
-    //c is the cosine of the angular distance from the center.
-    //I believe this is just the z coordinate.
-    double c = oq.v[Q_Z];
-    double k = projectionK(c);
-    double zoomscale = m_Scale*Options::zoomFactor();
-
-    return QPointF( 0.5*width()  - zoomscale*k*oq.v[Q_X],
-                    0.5*height() - zoomscale*k*oq.v[Q_Y] );
-}
-
 void SkyMap::slotZoomIn() {
     setZoomFactor( Options::zoomFactor() * DZOOM );
 }
--- trunk/KDE/kdeedu/kstars/kstars/skymap.h #1101701:1101702
@@ -343,19 +343,17 @@
     QPoint clipLineI( SkyPoint *p1, SkyPoint *p2 );
 
     /**Given the coordinates of the SkyPoint argument, determine the
-    	*pixel coordinates in the SkyMap.
-    	*@return QPoint containing screen pixel x, y coordinates of SkyPoint.
-    	*@param o pointer to the SkyPoint for which to calculate x, y coordinates.
-    	*@param useRefraction true = use Options::useRefraction() value.  
-    	*false = do not use refraction.  This argument is only needed 
-    	*for the Horizon, which should never be refracted.
-    	*@param onVisibleHemisphere pointer to a bool to indicate whether the point is
-        * on the visible part of the Celestial Sphere.
-    	*/
+     * pixel coordinates in the SkyMap.
+     * @return QPoint containing screen pixel x, y coordinates of SkyPoint.
+     * @param o pointer to the SkyPoint for which to calculate x, y coordinates.
+     * @param useRefraction true = use Options::useRefraction() value.  
+     *   false = do not use refraction.  This argument is only needed 
+     *   for the Horizon, which should never be refracted.
+     * @param onVisibleHemisphere pointer to a bool to indicate whether the point is
+     *   on the visible part of the Celestial Sphere.
+     */
     QPointF toScreen( SkyPoint *o, bool useRefraction=true, bool *onVisibleHemisphere=NULL);
-    QPointF toScreenQuaternion( SkyPoint *o );
 
-
     /**@return the current scale factor for drawing the map.
      * @note the scale factor should be 1.0 unless we are printing.
      */
@@ -864,8 +862,6 @@
     InfoBoxWidget* m_geoBox;
     InfoBoxWidget* m_objBox;
     InfoBoxes*     m_iboxes;
-    //QUATERNION
-    Quaternion m_rotAxis;
 
     static SkyMap* pinstance;
 


More information about the Kstars-devel mailing list