gvSIG bugs #171

Every drawing of a raster layer changes drawVersion property

Added by Jose Manuel Vivó Arnal over 12 years ago. Updated over 11 years ago.

Status:Closed% Done:

0%

Priority:NormalSpent time:-
Assignee:Ignacio Brodín
Category:Raster
Target version:2.0.0-devel-2050
Severity: Add-on version:2.0.0-SNAPSHOT
gvSIG version:2.0.0 Add-on build:18
gvSIG build:2043 Add-on resolve version:
Operative System: Add-on resolve build:
Keywords: Proyecto:
Has patch:No Hito:
Add-on name:Formats: WMS support (org.gvsig.raster.wms.app.wmsclient)

Description

I try to use a LayerListener.drawValueChanged() to detect when a redraw in a MapControl is needed:

       mapContext.getLayers().addLayerListener(new LayerListener() {

            public void visibilityChanged(LayerEvent e) {
                mapControl.rePaintDirtyLayers();
            }

            public void nameChanged(LayerEvent e) {
                // Nothing to do
            }

            public void editionChanged(LayerEvent e) {
                // Nothing to do
            }

            public void drawValueChanged(LayerEvent e) {
                mapControl.rePaintDirtyLayers();
            }

            public void activationChanged(LayerEvent e) {
                // Nothing to do
            }
        });

But I found that every time a raster layer is draw this property is updated. This makes drawing process never end.

History

#1 Updated by Joaquín del Cerro Murciano over 12 years ago

  • Category set to Application

#2 Updated by Joaquín del Cerro Murciano over 12 years ago

  • Assignee set to Ignacio Brodín
  • Add-on name deleted (unknown)

#3 Updated by Cesar Ordiñana about 12 years ago

  • Category changed from Application to Raster

#4 Updated by Ignacio Brodín about 12 years ago

I don't understand what you're saying. Raster layers don't implement the methods of the LayerListener interface. How can the layer update that property? Give me a clue, please.

#5 Updated by Ignacio Brodín almost 12 years ago

  • Status changed from New to Awaiting response

#6 Updated by Jose Manuel Vivó Arnal almost 12 years ago

The problem is that every time a raster layer is drawn call to updateDrawVersion (not in a direct way).

This makes LayerListener.drawValueChanged useless.

The drawVersion property must be updated just in case any draw related property has been changed. This allows layer draw cache to work properly (otherwise raster layers never will be cached).

#7 Updated by Ignacio Brodín almost 12 years ago

updateDrawVersion in a raster layer is called only when:

- the layer is added
- the layer is removed
- some property is changed (from properties dialog, visibility, affine transform and so on)

I have set a break point at the method updateDrawVersion in FLyrDefault and redrawing the layer or doing pan or zoom is not called. Any other clue?

#8 Updated by Ignacio Brodín almost 12 years ago

  • Status changed from Awaiting response to Won't fix

#9 Updated by Cesar Ordiñana almost 12 years ago

  • Status changed from Won't fix to New
  • Add-on name set to Formats: WMS support (org.gvsig.raster.wms.app.wmsclient)
  • Add-on version set to 2.0.0-SNAPSHOT
  • Add-on build set to 18

I reopen the ticket as I have found the same problem while trying to create a kind of "animation" with the graphics layer, by creating a random number of points with a refresh rate over a given gvSIG view.

The animation performs well if there are only vectorial layers loaded in the view, as after the first draw all the layers are cached and only the graphicslayer is drawn.

But if I add a WMS layer, each time the view is drawn (after calling invalidate on the MapContext), the updateDrawVersion method is called. This way the WMS layer is never cached and is redrawn each time.

I haven't tried with other types of raster layers, so I don't know if it only happens in WMS layers. The version of the WMS addon installed is the last one currently available in the addon repository (2.0.0-SNAPSHOT-18).

#10 Updated by Ignacio Brodín almost 12 years ago

  • Status changed from New to Fixed
  • Target version set to 2.0.0-devel-2050

Ok, now
Every time that a tiled raster layer was painted, the transparency change because a set of pixels was read from the alpha band. It produced that the method callPropertyChange in DataStoreTransparency was called and the updateDrawVersion call after that. I think that is not neccesary execute callPropertyChange and I have removed this called.

gvsig-raster:r1140

#11 Updated by Joaquín del Cerro Murciano over 11 years ago

  • Status changed from Fixed to Closed

Also available in: Atom PDF