Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Tiled Rendering and Mapgraphics Again

Hello Jody,

I'm slowly getting back into the udig mapgraphic rendering stuff. I have looked at this and am happy to change the workflow as you have suggested.

However I have one question regarding this statement:
"to see the same bugs I am seeing open up a map and hit the "New Page" button in the toolbar"

I don't see any 'New Page' button - what am I missing?

Emily


Jody Garnett wrote:
Okay the problem was that the layer was null; no that does not make
much sense to me either :-)

However the other way of looking at this is that Renderer has two
methods (one rendering onto a provided Graphics2D, and one for
rendering onto a raster held in the context).

So we need to change your workflow a bit:
- MapGraphicRenderer.render( Graphics2D destination, IProgressMonitor
monitor ) should not use caching - it is "raw" and draws directly to
the provided destination
- MapGraphicRenderer.render( IProgressMonitor monitor ) is called to
render into the provided context; I think this may be where the code
for your cache can live? After it sets up the cache image it can use
the first method to draw into it?

In anycase I am a bit confused on this one; to see the same bugs I am
seeing open up a map and hit the "New Page" button in the toolbar;
this will create a new page editor - and it is the MapPrinter box that
is having all this trouble.

Jody

On Sat, Mar 14, 2009 at 8:58 PM, Jody Garnett <jody.garnett@xxxxxxxxx> wrote:
Okay my first useful feedback - as part of the code sprint I am
looking into printing in landscape mode.

And one of your changes is producing a NPE.

// this line is causing trouble when the renderer is used for printing
//
BlackboardItem cached =
(BlackboardItem)getContext().getLayer().getBlackboard().get(BLACKBOARD_IMAGE_KEY);

I am going to see what I can be done.
Jody


On Thu, Mar 5, 2009 at 11:01 AM, Emily Gouge <egouge@xxxxxxxxxxxxxxx> wrote:
Hey Jody,

What I have done is update the Mapgraphic Renderer to render the entire
viewport onto a single image.  This image is then stored on the layer
blackboard and used when rendering tiles.  When the tile comes along to
render the mapgraphic the image is taken off the blackboard and the part
that matches the tiles bounds are clipped and drawn.

In order to make this work; when the mapgraphic context is created a
viewport listener is added to the map so when the viewport bounds change the
image cached on the layer's blackboard is cleared.

The issues with the styling is not that layer.refresh() is not being called
but rather that this doesn't cause my "cached" mapgraphic image on the
blackboard to be cleared.

A simple solution would be do not cache this image; but I can't imagine that
would be very good performance wise as it would be rendering the image
multiple times.

I could add another listener that listeners for style events and clears the
cache.

Or maybe I could store information about the styles with my cached image and
if they have changed then refresh the cached mapgraphic.

Emily


Jody Garnett wrote:
Hi Emily.
On Thu, Mar 5, 2009 at 9:48 AM, Emily Gouge <egouge@xxxxxxxxxxxxxxx>
wrote:

The ongoing issue of tiled rendering and mapgraphics is causing me issues
again so I'm working on a solution.  (The mapgraphics currently don't
render
properly if using tiled rendering).

Good to hear you making progress on this; when you have a moment I am
interested to hear what approach your solution is taking.

I currently have a solution that works most of the time.  The only thing
it
doesn't do properly right now is refresh when the style is changed.

Interesting. So the style changing would change the layer blackboard which
would fire an event (or EMF Notification?). From their we need to check to
see who is listening and make sure they issue a layer.refresh( null )
event?

I'm wondering if somebody can review my proposed changes and provide me
with some feedback and ideas for dealing with the style change issue I'm
having.  If somebody is willing to review the code I'll pass it along to
them.

I have a bit of a backlog on uDig items right now; so I cannot in good
faith
volunteer at this time (I still owe Anrdrea a style save api).

Jody



------------------------------------------------------------------------

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top