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

Jason Harris kstars at 30doradus.org
Tue Jul 15 07:40:30 CEST 2008


Actually, I think this fix is not correct.  The code for determining
the value of onVisibleHemisphere for non-Equirectangular projections
was already there, beginning at line 1004.

That said, it does appear that your patch has solved the runaway CPU
usage issue at high zoom when a line is moved off-screen.
Essentially, your code makes the onVisibleHemisphere parameter a flag
that indicates whether the point lies within the bounds of the SkyMap
widget.  This has some negative side effects:

+ if a line on the sky intersects the SkyMap widget, but its endpoints
are offscreen, the line is no longer drawn.

+ If you zoom all the way out (with the default projection), you'll
see that lines on the sky extend out further than the circular edge
where stars stop being drawn.  This edge is the "visible horizon" that
you have superseded with this patch, so lines in the sky don't follow
it anymore.

The change is affecting lines in the sky because we use the
onVisibleHemisphere value to determine whether lines should be drawn.

So, to summarize: we do need something like your patch, where we clip
lines with the bounding rectangle of the SkyMap; however, the place
you have put it is not quite right.

regards,
Jason



On 7/14/08, Jason Harris <kstars at 30doradus.org> wrote:
> Excellent!  If you confirm that this fix works, can you please
> backport it to the 4.1 branch as well?  If you don't have the branch
> checked out, then I can backport it.
>
>
>
> On 7/14/08, Akarsh Simha <akarshsimha at gmail.com> wrote:
>> SVN commit 832597 by asimha:
>>
>> onVisibleHemisphere was not set correctly for projections other than
>> Equirectangular in SkyMap::toScreen(). This commit fixes that.
>>
>> Hopefully, this fixes the irresponsiveness caused when the coordinate
>> grid is enabled at high zoom.
>>
>> CCMAIL: kstars-devel at kde.org
>>
>>
>>
>>  M  +7 -0      skymap.cpp
>>
>>
>> --- trunk/KDE/kdeedu/kstars/kstars/skymap.cpp #832596:832597
>> @@ -1041,6 +1041,13 @@
>>      p.setX( 0.5*Width  - zoomscale*k*cosY*sindX );
>>      p.setY( 0.5*Height - zoomscale*k*( cosY0*sinY - sinY0*cosY*cosdX ) );
>>
>> +    if ( onVisibleHemisphere != NULL ) {
>> +        if ( scaledRect().contains( p.toPoint() ) )  //FIXME -jbb
>> +            *onVisibleHemisphere = true;
>> +        else
>> +            *onVisibleHemisphere = false;
>> +    }
>> +
>>      return p;
>>  }
>>
>> _______________________________________________
>> 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