[Kstars-devel] branches/kstars/hdevalence/kstars/kstars/projections

Henry de Valence hdevalence at gmail.com
Sat Aug 7 23:20:25 CEST 2010


SVN commit 1160337 by hdevalence:

Filter away points below the horizon in Equatorial mode.

We don't call EquatorialToHorizontal first because it is
expensive and has usually already been called.

Ideally there would be a way to know whether or not
the given SkyPoint had its two sets of coordinates syncronized,
but it doesn't seem that there is a way to do this.

Instead, we add the proviso that the points must have already
had EquatorialToHorizontal called on them.

CCMAIL:kstars-devel at kde.org


 M  +2 -2      projector.cpp  
 M  +10 -1     projector.h  


--- branches/kstars/hdevalence/kstars/kstars/projections/projector.cpp #1160336:1160337
@@ -196,8 +196,8 @@
             p->EquatorialToHorizontal( m_data->lst(), m_data->geo()->lat() );
         if( p->alt().Degrees() < -1.0 ) return false;
     }
-    */
-    if( m_vp.fillGround && m_vp.useAltAz && p->alt().Degrees() < -1.0 ) return false;
+    */ //Here we hope that the point has already been 'synchronized'
+    if( m_vp.fillGround /*&& m_vp.useAltAz*/ && p->alt().Degrees() < -1.0 ) return false;
 
     if ( m_vp.useAltAz ) {
         dY = fabs( p->altRefracted().Degrees() - m_vp.focus->alt().Degrees() );
--- branches/kstars/hdevalence/kstars/kstars/projections/projector.h #1160336:1160337
@@ -138,7 +138,14 @@
      * absolutely essential that checkVisibility() is significantly faster than
      * the computations required to draw the object to the screen.
      *
-     * The function first checks the difference between the Declination/Altitude
+     * If the ground is to be filled, the function first checks whether the point is
+     * below the horizon, because they will be covered by the ground anyways.
+     * Importantly, it does not call the expensive EquatorialToHorizontal function.
+     * This means that the horizontal coordinates MUST BE CORRECT! The vast majority
+     * of points are already synchronized, so recomputing the horizontal coordinates is
+     * a waste.
+     *
+     * The function then checks the difference between the Declination/Altitude
      * coordinate of the Focus position, and that of the point p.  If the absolute
      * value of this difference is larger than fov, then the function returns false.
      * For most configurations of the sky map window, this simple check is enough to
@@ -165,6 +172,8 @@
      * @return true if the point p was found to be inside the Sky map window.
      * @see SkyMap::setMapGeometry()
      * @see SkyMap::fov()
+     * @note If you are creating skypoints using equatorial coordinates, then
+     * YOU MUST CALL EQUATORIALTOHORIZONTAL BEFORE THIS FUNCTION!
      */
     bool checkVisibility( SkyPoint *p ) const;
 


More information about the Kstars-devel mailing list