[Marble-devel] geoProjected Ellipses look like polygons
Josh Knox
jknox at lauferwind.com
Mon Jul 14 15:49:48 UTC 2014
OK, I've got a "workaround" that works for me at the moment.
In GeoPainter.cpp, line 330 the degreeResolution is is determined as:
// Optimizing the precision by determining the size which the
// ellipse covers on the screen:
const qreal degreeResolution = d->m_viewport->angularResolution() * RAD2DEG;
Then the precision is calculated:
// To create a circle shape even for very small precision we require uneven numbers:
const int precision = qMin<qreal>( width / degreeResolution / 8 + 1, 81 );
The precision affects the number of points that are drawn for the ellipse. More points, smoother ellipse.
I modified the angularResolutionterm to be 1/3 the size:
const qreal degreeResolution = d->m_viewport->angularResolution() * RAD2DEG * 0.333;
This yields a greater precision which draws geoProjected ellipses as they were in the 4.11 branch.
While this works for me, I don't think this is the correct fix. It would appear that the d->m_viewport->angularResolution() is the value that has changed in recent branches.
I haven't looked into that.
Josh
On 07/11/2014 05:06 PM, Josh Knox wrote:
> To narrow down the issue, I tried building against a few previous versions of Marble sources I had checked out locally.
>
> The ellipses look OK in branches 4.10 (libmarblewidget.so.15.0) and 4.11 (libmarblewidget.so.0.16.5). The issue appears in branch 4.12 (libmarblewidget.so.17.0) and is in master.
>
> I can't see any difference in GeoPainter::drawEllipse between those versions, so the issue must be elsewhere.
>
> I should be able to look at this more next week once I clear my plate of other stuff.
>
> Have a good weekend!
>
> Josh
>
>
> On 07/10/2014 01:25 PM, Josh Knox wrote:
>> I just built against master (libmarblewidget.so.0.18.3). Same issue exists for geoProjected ellipses. :(
>>
>> For reference, geoProjected ellipses draw much better with libmarblewidget.so.0.15.0
>>
>> Josh
>>
>> On 07/10/2014 07:03 AM, Josh wrote:
>>> Hi Dennis,
>>>
>>> The example, as is, does not produce this issue. If the ellipse is drawn with isGeoProjected=true, then the issue is apparent.
>>>
>>> Attached code only changes the call to drawEllipse, to draw a geoprojected circle at the example's home location:
>>>
>>> painter->drawEllipse(home, (60.0/1243.76), (60.0/1853.17), true);
>>>
>>> Image shows the issue. Zooming in and out should show the problem.
>>>
>>> If you don't see it in master, I'll try building against that.
>>>
>>> Thanks for looking!
>>>
>>> Josh
>>>
>>> On 07/05/2014 03:49 AM, Dennis Nienhüser wrote:
>>>> Hi Josh,
>>>>
>>>> I wasn't able to reproduce that problem in master. Can you provide a
>>>> minimal example in the style of [0] that results in the rendering
>>>> problem on your system?
>>>>
>>>> Regards,
>>>> Dennis
>>>>
>>>> [0]
>>>> http://quickgit.kde.org/?p=marble.git&a=blob&h=a1aa719&f=examples%2Fcpp%2Fgeopainter%2Fmain.cpp
>>>>
>>>> Am 30.06.2014 15:29, schrieb Josh Knox:
>>>>> Hi Torsten,
>>>>>
>>>>> Here's a couple screen shots that shows it clearly, side-by-side.
>>>>>
>>>>> Notice the dashed range rings and the small center red circle. These are all drawn with GeoPainter::drawEllipse. They show the issue I'm seeing.
>>>>>
>>>>> Then compare with the light blue and light red circles, which are drawn from predefined point sets using GeoPainter::drawPolygon. These maintian their nice circular shape.
>>>>>
>>>>> All my uses of drawEllipse are affected like this, so I guess that's the basic test case.
>>>>>
>>>>> Does this demonstrate the issue clear enough?
>>>>>
>>>>> Thanks for looking at this,
>>>>>
>>>>> Josh
>>>>>
>>>>>
>>>>>
>>>>> On 06/27/2014 06:05 PM, Torsten Rahn wrote:
>>>>>> Interesting, I haven't noticed this yet - although this might very well be the case.
>>>>>> Could you provide a test case or maybe a screenshot which shows this change clearly? :)
>>>>>>
>>>>>> Best Regards,
>>>>>> Torsten
>>>>>>
>>>>>> -----Original-Nachricht-----
>>>>>> Betreff: [Marble-devel] Ellipses look like polygons
>>>>>> Datum: Fri, 27 Jun 2014 21:51:41 +0200
>>>>>> Von: Josh Knox <jknox at lauferwind.com>
>>>>>> An: "marble-devel at kde.org" <marble-devel at kde.org>
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I've been developing an application using Marble 1.5, that I built from source on Ubuntu 12.04.
>>>>>> I recently started migrating to Ubuntu 14.04 which provides packages for Marble 1.8.
>>>>>>
>>>>>> I use circles to mark various track points and areas, using GeoPainter::drawEllipse.
>>>>>>
>>>>>> With Marble 1.5, this worked quite well visually as the ellipses and circles were drawn as ellipses and circles, and were only reduced to small polygons and lines as the view was zoomed out beyond
>>>>>> a scale of 1:100000.
>>>>>>
>>>>>> With the newer version of Marble, anything drawn with drawEllipse is very polygonal, reducing to squares and lines until I zoom in much closer. Even then, circles still have very noticeable flat edges, especially near 90 and 270 degrees. Strangely, the upper and lower parts of the are much more "circular".
>>>>>>
>>>>>> Is there some difference between 1.5 and 1.8, when drawingellipses/circles that produces this visual
>>>>>> difference; some optimization/approximation perhaps?
>>>>>>
>>>>>> I'd like to have my circles look like circles again. Any ideas/suggestions for improving this?
>>>>>>
>>>>>> Note that I have some irregular but largely circular shapes that I draw as polygons from a set of p redefined points. These retain their roundness at all zoom levels. Maybe I could just draw all my
>>>>>> various circles as predefined polygons and keep those cached for use as needed. Would really prefer
>>>>>> that drawEllipse worked as it used to though.
>>>>>>
>>>>>> Thanks for any suggestions.
>>>>>>
>>>>>> Josh
>>>>>> ____________
> _______________________________________________
> Marble-devel mailing list
> Marble-devel at kde.org
> https://mail.kde.org/mailman/listinfo/marble-devel
>
>
More information about the Marble-devel
mailing list