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

Henry de Valence hdevalence at gmail.com
Sun Feb 20 20:57:44 CET 2011


Sorry for the delayed response. I feel sort of stupid for putting in
the comment that I did, since it doesn't really give helpful
information. As I recall, there was a very good reason why that was
like that, but I can't remember what it was.

Do you notice any change with the horizon (testing in outline and
filled mode) with and without that line?
Also, constellations. Unfortunately I can't test stuff at the moment
since I don't have a working trunk and unfortunately don't have a lot
of time to build one at the moment.

As for the QRect thing, I am biased against that method, because it
will create a new QRect object (which needs to malloc because it uses
a d-pointer) every single time we need to project something, and then
destruct it when we're done. So if we do 100 000 projections, we have
just malloc'd and free'd memory 100000 times, which is needless.

Cheers,
Henry de Valence

On 13 February 2011 09:32, Jérôme SONRIER <jsid at emor3j.fr.eu.org> wrote:
> 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