Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

Faruk Hadzic
Hello to everyone,

I created patch/workaround for ticket #1987,
and I'm requesting review of this patch as suggested by zspitzer.

Best Regards,

Faruk
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
Reply | Threaded
Open this post in threaded view
|

Re: Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

weltonw
Hi Faruk,

I took a look at your proposed change.

The existing code was written to handle dots appearing in line patterns (a line symbol).
* In MgDev/Common/Stylization/SE_SymbolDefProxies.cpp, in SE_Polyline::evaluate, the code checks for zero-length segments, and replaces them with short line segments of length LINE_SEGMENT_DOT_SIZE.
* In AGGRenderer::_TransferPoints the code checks for these short segments and replaces them with one-pixel long lines.

In your case you have a dot appearing in a hatch pattern (an area symbol), but the code doesn't currently have any special handling for this.
* In SE_SymbolDefProxies.cpp, in SE_Polygon::evaluate, there's no check for zero-length segments.
* Consequently AGGRenderer::_TransferPoints doesn't modify the segment into a one-pixel long line that's actually visible when rendered.

Instead of your proposed fix, I think it would be better to update SE_Polygon::evaluate to have the same zero-length segment check as SE_Polyline::evaluate (the exact same block of code can be added to SE_Polyline::evaluate).  Then no change would be needed to AGGRenderer::_TransferPoints (or AGGRenderer::_TransferPointsClamped, which you didn't update).

Can you give that a try and let us know the result?

Thanks,
Walt

________________________________________
From: [hidden email] [[hidden email]] on behalf of Faruk Hadzic [[hidden email]]
Sent: Wednesday, June 05, 2013 3:53 AM
To: [hidden email]
Subject: [mapguide-internals] Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

Hello to everyone,

I created patch/workaround for ticket #1987,
and I'm requesting review of this patch as suggested by zspitzer.

Best Regards,

Faruk
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
Reply | Threaded
Open this post in threaded view
|

Re: Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

weltonw
> the exact same block of code can be added to SE_Polyline::evaluate
I meant to say SE_Polygon::evaluate

________________________________________
From: [hidden email] [[hidden email]] on behalf of Walt Welton-Lair [[hidden email]]
Sent: Wednesday, June 05, 2013 10:49 PM
To: MapGuide Internals Mail List
Subject: Re: [mapguide-internals] Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

Hi Faruk,

I took a look at your proposed change.

The existing code was written to handle dots appearing in line patterns (a line symbol).
* In MgDev/Common/Stylization/SE_SymbolDefProxies.cpp, in SE_Polyline::evaluate, the code checks for zero-length segments, and replaces them with short line segments of length LINE_SEGMENT_DOT_SIZE.
* In AGGRenderer::_TransferPoints the code checks for these short segments and replaces them with one-pixel long lines.

In your case you have a dot appearing in a hatch pattern (an area symbol), but the code doesn't currently have any special handling for this.
* In SE_SymbolDefProxies.cpp, in SE_Polygon::evaluate, there's no check for zero-length segments.
* Consequently AGGRenderer::_TransferPoints doesn't modify the segment into a one-pixel long line that's actually visible when rendered.

Instead of your proposed fix, I think it would be better to update SE_Polygon::evaluate to have the same zero-length segment check as SE_Polyline::evaluate (the exact same block of code can be added to SE_Polyline::evaluate).  Then no change would be needed to AGGRenderer::_TransferPoints (or AGGRenderer::_TransferPointsClamped, which you didn't update).

Can you give that a try and let us know the result?

Thanks,
Walt

________________________________________
From: [hidden email] [[hidden email]] on behalf of Faruk Hadzic [[hidden email]]
Sent: Wednesday, June 05, 2013 3:53 AM
To: [hidden email]
Subject: [mapguide-internals] Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

Hello to everyone,

I created patch/workaround for ticket #1987,
and I'm requesting review of this patch as suggested by zspitzer.

Best Regards,

Faruk
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
Reply | Threaded
Open this post in threaded view
|

Re: Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

Faruk Hadzic
Hi Walt,

I'm guessing that you are referring to other ticket -
2285<http://osgeo-org.1560.x6.nabble.com/Patch-Ticket-2285-tp5058019.html>
but any way:
I took look at your suggestions but I'm falling to see when dots from DWF
goes through this code?

Here is call stack:
d:\mapguide\common\renderers\aggrenderer.cpp (2066):
AGGRenderer::_TransferPoints
d:\mapguide\common\renderers\aggrenderer.cpp (2258):
AGGRenderer::DrawScreenPolyline
d:\mapguide\common\renderers\aggw2drewriter.cpp (681): agr_process_polyline
d:\mapguide\oem\dwftk7.1\develop\global\src\dwf\whiptk\polyline.cpp (450):
WT_Polyline::process
d:\mapguide\oem\dwftk7.1\develop\global\src\dwf\whiptk\file.cpp (1524):
WT_File::process_next_object
d:\mapguide\common\renderers\aggrenderer.cpp (2961):
AGGRenderer::AddW2DContent
d:\mapguide\common\renderers\aggrenderer.cpp (2888):
AGGRenderer::AddDWFContent
d:\mapguide\common\stylization\defaultstylizer.cpp (461):
DefaultStylizer::StylizeDrawingLayer
d:\mapguide\server\src\services\mapping\mappingutil.cpp (810):
MgMappingUtil::StylizeLayers
d:\mapguide\server\src\services\rendering\serverrenderingservice.cpp
(1592): MgServerRenderingService::RenderLayers
d:\mapguide\server\src\services\rendering\serverrenderingservice.cpp
(1012): MgServerRenderingService::RenderMapInternal
d:\mapguide\server\src\services\rendering\serverrenderingservice.cpp (923):
MgServerRenderingService::RenderMapInternal
d:\mapguide\server\src\services\rendering\serverrenderingservice.cpp (604):
MgServerRenderingService::RenderMap
d:\mapguide\server\src\services\rendering\oprendermap.cpp (237):
MgOpRenderMap::Execute
d:\mapguide\server\src\services\rendering\renderingservicehandler.cpp (81):
MgRenderingServiceHandler::ProcessOperation
...
mgserver executable calls

As I understand dots pattern is read using DWF Toolkit as lines and
directly draw using render without going through any stylization.

Also tried to debug on method that you suggested but it's not reached
during drawing of this pattern.

Regarding _TransferPointClamped it's not called from
AGGRenderer::DrawScreenPolyline()
so I didn't modified this code.

Please correct me if I'm missing to see something obvious.

Best Regards,
Faruk
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
Reply | Threaded
Open this post in threaded view
|

Re: Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

Jackie Ng
Any updates on this?

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

weltonw
I still have it on my TODO list to do the final review on this, but I haven't yet had time...

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jackie Ng
Sent: Monday, August 05, 2013 7:59 AM
To: [hidden email]
Subject: Re: [mapguide-internals] Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

Any updates on this?

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Hatches-from-DWF-files-renders-poorly-using-AGG-Render-patch-Ticket-1987-tp5058015p5070809.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
Reply | Threaded
Open this post in threaded view
|

Re: Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

weltonw
FYI - fixes for both tickets 1987 and 2285 have been reviewed and submitted.

Walt

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Walt Welton-Lair
Sent: Tuesday, August 06, 2013 7:21 PM
To: MapGuide Internals Mail List
Subject: Re: [mapguide-internals] Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

I still have it on my TODO list to do the final review on this, but I haven't yet had time...

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jackie Ng
Sent: Monday, August 05, 2013 7:59 AM
To: [hidden email]
Subject: Re: [mapguide-internals] Hatches from DWF files renders poorly using AGG Render - patch (Ticket 1987)

Any updates on this?

- Jackie



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Hatches-from-DWF-files-renders-poorly-using-AGG-Render-patch-Ticket-1987-tp5058015p5070809.html
Sent from the MapGuide Internals mailing list archive at Nabble.com.
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals
_______________________________________________
mapguide-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-internals