[Kstars-devel] Re: KDE/kdeedu/kstars/kstars/projections

Jérôme SONRIER jsid at emor3j.fr.eu.org
Sun Feb 13 15:32:38 CET 2011


Ho thanks, I have changed this only for testing and forgot to correct 
the code  before to commit it.

But now I have a question : should we use the actual code :

*onVisibleHemisphere = dX*dX < M_PI*M_PI/4.;

or something like 

*onVisibleHemisphere = QRect( 0, 0, int(m_vp.width), int(m_vp.height) 
).contains( p[0], p[1] ) ;

which show a larger part of  the sky ?

-- 
Jérôme SONRIER

Le samedi 12 février 2011, Henry de Valence a écrit :
> Is there a reason why the onVisibleHemisphere code was changed?
> 
> On 12 February 2011 09:58, Jérôme Sonrier <jsid at emor3j.fr.eu.org> 
wrote:
> > SVN commit 1220031 by jsonrier:
> > 
> > Repair equirectangular projection.
> > 
> > Signatures of Projector::toScreenVec and
> > EquirectangularProjector::toScreenVec was not exactly the same :
> > overriding wasn't acheived.
> > 
> > 
> > CCMAIL: kstars-devel at kde.org
> > 
> > 
> > 
> >  M  +2 -3      equirectangularprojector.cpp
> >  M  +1 -1      equirectangularprojector.h
> > 
> > 
> > ---
> > trunk/KDE/kdeedu/kstars/kstars/projections/equirectangularprojecto
> > r.cpp #1220030:1220031 @@ -40,7 +40,7 @@
> >     return 1.0;
> >  }
> > 
> > -Vector2f EquirectangularProjector::toScreenVec(SkyPoint* o, bool
> > oRefract, bool* onVisibleHemisphere) const +Vector2f
> > EquirectangularProjector::toScreenVec(const SkyPoint* o, bool
> > oRefract, bool* onVisibleHemisphere) const {
> >     double Y, dX;
> >     Vector2f p;
> > @@ -65,8 +65,7 @@
> >     p[0] = 0.5*m_vp.width - m_vp.zoomFactor*dX;
> > 
> >     if ( onVisibleHemisphere )
> > -        //Is fabs(dX) < M_PI/2?
> > -        *onVisibleHemisphere = dX*dX < M_PI*M_PI/4.;
> > +        *onVisibleHemisphere = true;
> > 
> >     return p;
> >  }
> > ---
> > trunk/KDE/kdeedu/kstars/kstars/projections/equirectangularprojecto
> > r.h #1220030:1220031 @@ -31,7 +31,7 @@
> >     virtual SkyMap::Projection type() const;
> >     virtual double radius() const;
> >     virtual bool unusablePoint( const QPointF& p) const;
> > -    virtual Vector2f toScreenVec(SkyPoint* o, bool oRefract =
> > true, bool* onVisibleHemisphere = 0) const; +    virtual Vector2f
> > toScreenVec(const SkyPoint* o, bool oRefract = true, bool*
> > onVisibleHemisphere = 0) const; virtual SkyPoint fromScreen(const
> > QPointF& p, dms* LST, const dms* lat) const; virtual QVector<
> > Vector2f > groundPoly(SkyPoint* labelpoint = 0, bool* drawLabel =
> > 0) const; };
> > _______________________________________________
> > Kstars-devel mailing list
> > Kstars-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/kstars-devel




More information about the Kstars-devel mailing list