[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars
From:       Alexey Khudyakov <alexey.skladnoy () gmail ! com>
Date:       2010-01-31 14:07:27
Message-ID: 1264946847.787308.8667.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1082922 by khudyakov:

Remove unused functions from SkyMap

 M  +6 -52     skymap.cpp  
 M  +8 -34     skymap.h  


--- trunk/KDE/kdeedu/kstars/kstars/skymap.cpp #1082921:1082922
@@ -1102,7 +1102,8 @@
             ( p1.x() > scaledRect().width() && 
               p2.x() > scaledRect().width() ) ||
             ( p1.y() > scaledRect().height() && 
-              p2.y() > scaledRect().height() ) ) return false;
+              p2.y() > scaledRect().height() ) )
+        return false;
     return true;
 }
 
@@ -1116,47 +1117,6 @@
     return true;
 }
 
-
-
-//Return the on-screen portion of the given SkyLine, if any portion of it
-//is onscreen
-QList<QPointF> SkyMap::toScreen( SkyLine *line, bool oRefract, bool doClipLines ) {
-    QList<QPointF> screenLine;
-
-    //Initialize spLast to the first point
-    SkyPoint *spLast = line->point(0);
-    bool on(false), onLast(false); //on-screen flags
-
-    foreach ( SkyPoint *sp, line->points() ) {
-        QPointF p = toScreen( sp, oRefract, &on );
-        QPointF pLast = toScreen( spLast, oRefract,&onLast );
-
-        //Make sure the point is not null
-        if ( ! isPointNull( p ) ) {
-
-            //If either this point or the previous are offscreen
-            //and the user wants clipped lines, then we have to
-            //interpolate to find the intersection of the line
-            //segment with the screen edge
-            if ( doClipLines  &&  onscreenLine( p, pLast ) ) {
-                screenLine.append( pLast );
-                screenLine.append( p );
-            }
-            //If the current point is onscreen, add it to the list
-            else if ( on ) {
-                //First, add pLast if it is offscreen
-                if ( !onLast )
-                    screenLine.append( pLast );
-                screenLine.append( p );
-            }
-        }
-
-        spLast = sp;
-    }
-
-    return screenLine;
-}
-
 bool SkyMap::onscreenLine( QPointF &p1, QPointF &p2 ) {
     //If the SkyMap rect contains both points or either point is null,
     //we can return immediately
@@ -1385,8 +1345,10 @@
     // Ensure that stars are recomputed
     data->incUpdateID();
 
-    if ( now ) repaint();
-    else update();
+    if( now )
+        repaint();
+    else
+        update();
 }
 
 float SkyMap::fov() {
@@ -1394,14 +1356,6 @@
     return diagonalPixels / ( 2 * Options::zoomFactor() * dms::DegToRad );
 }
 
-bool SkyMap::checkVisibility( SkyLine *sl ) {
-    foreach ( SkyPoint *p, sl->points() ) {
-        if ( checkVisibility( p ) )
-            return true;
-    }
-    return false;
-}
-
 bool SkyMap::checkVisibility( SkyPoint *p ) {
     //TODO deal with alternate projections
     double dX, dY;
--- trunk/KDE/kdeedu/kstars/kstars/skymap.h #1082921:1082922
@@ -75,7 +75,6 @@
 
     static bool IsSlewing() { return pinstance->isSlewing(); }
 
-
     /** Destructor (empty) */
     ~SkyMap();
 
@@ -341,7 +340,6 @@
      * between *p1 and *p2 that just clips.
      */
     QPointF clipLine( SkyPoint *p1, SkyPoint *p2 );
-
     QPoint clipLineI( SkyPoint *p1, SkyPoint *p2 );
 
     /**Given the coordinates of the SkyPoint argument, determine the
@@ -357,44 +355,22 @@
     QPointF toScreen( SkyPoint *o, bool useRefraction=true, bool *onVisibleHemisphere=NULL);
     QPointF toScreenQuaternion( SkyPoint *o );
 
-    /**
-    	*@return the given SkyLine, transformed to screen pixel coordinates.
-    	*If only a portion of the line is on-screen, this function returns 
-    	*the on-screen segment.  If no portion of the line is on-screen, 
-    	*a null line is returned.
-    	*
-    	*@param o pointer to the SkyLine which is to be transformed to screen coordinates
-    	*@param useRefraction if true, refract according to the user option UseRefraction; 
-    	*if false, do not use refraction regardless of user option
-    	*@param doClipLines if true, lines will be truncated at the screen edge
-    	*/
-    QList<QPointF> toScreen( SkyLine *o, bool useRefraction=true, bool doClipLines=true );
 
-    /**
-        *@return the current scale factor for drawing the map.
-        *@note the scale factor should be 1.0 unless we are printing.
-        */
+    /**@return the current scale factor for drawing the map.
+     * @note the scale factor should be 1.0 unless we are printing.
+     */
     inline double scale() { return m_Scale; }
 
-    /**
-        *@return the bounding rectangle of the skymap, scaled by the current scale factor
-        */
+    /** @return the bounding rectangle of the skymap, scaled by the current scale factor */
     QRect scaledRect();
 
-    /**
-        *@return whether the given QPoint is on the SkyMap.
-        */
+    /** @return whether the given QPoint is on the SkyMap. */
     bool onScreen( QPoint &point );
-    /**
-        *@return whether the given QPointF is on the SkyMap.
-        */
-
+    /** @return whether the given QPointF is on the SkyMap. */
     bool onScreen( QPointF &pointF );
 
-    /**
-       *@return true if the line connecting the two points is possibly on screen.
-       * will return some false postives.
-       */
+    /** @return true if the line connecting the two points is possibly on screen.
+     * will return some false postives. */
     bool onScreen( QPointF &p1, QPointF &p2 );
     bool onScreen( QPoint &p1, QPoint &p2 );
 
@@ -447,8 +423,6 @@
     	*/
     bool checkVisibility( SkyPoint *p );
 
-    bool checkVisibility( SkyLine *l );
-
     /**Determine the on-screen position angle of a SkyObject.  This is the sum
     	*of the object's sky position angle (w.r.t. North), and the position angle
     	*of "North" at the position of the object (w.r.t. the screen Y-axis).  
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic