Revision 5576

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/ShpStrategy.java
256 256
							// TODO: Comprobar aqu? tambi?n si esto es necesario.
257 257
							if (lyr.isSpatialCacheEnabled())
258 258
							{
259
								if (cache.getMaxFeatures() < cache.size())
259
								if (cache.getMaxFeatures() >= cache.size())
260 260
								{
261
									// lyr.setSpatialCache(null);
262
									// cache = null;
263
								}
264
								else
265
								{
266 261
									// 	Ya reproyectado todo
267 262
									cache.insert(bounds, geom);
268 263
								}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/DBStrategy.java
182 182
					// TODO: Comprobar aqu? tambi?n si esto es necesario.
183 183
					if (lyr.isSpatialCacheEnabled())
184 184
					{
185
						if (cache.getMaxFeatures() < cache.size())
185
						if (cache.getMaxFeatures() >= cache.size())
186 186
						{
187
							// lyr.setSpatialCache(null);
188
							// cache = null;
189
						}
190
						else
191
						{
192 187
							// 	Ya reproyectado todo							
193 188
							cache.insert(geom.getBounds2D(), geom);
194 189
						}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/SpatialCache.java
10 10

  
11 11
public class SpatialCache extends Quadtree {
12 12
	int maxFeatures = 1000; // Por defecto, pero se puede cambiar
13
	int fastNumTotalRegs=0;
13 14

  
14 15
	public int getMaxFeatures() {
15 16
		return maxFeatures;
......
28 29
	public synchronized void insert(Rectangle2D bounds, IGeometry geom) {
29 30
		Envelope env = FConverter.convertRectangle2DtoEnvelope(bounds);
30 31
		this.insert(env, geom);
32
		fastNumTotalRegs++;
31 33
	}
32 34

  
33 35
	public synchronized void query(Envelope searchEnv, ItemVisitor visitor)
......
35 37
		super.query(searchEnv, visitor);
36 38
	}
37 39

  
40
	public void insert(Envelope itemEnv, Object item) {
41
		super.insert(itemEnv, item);
42
		fastNumTotalRegs++;
43
	}
38 44

  
45
	public boolean remove(Envelope itemEnv, Object item) {
46
		boolean resul = super.remove(itemEnv, item);
47
		if (resul)
48
			fastNumTotalRegs--;
49
		return resul;
50
	}
51

  
52
	public int size() {
53
		return fastNumTotalRegs;
54
	}
55

  
56

  
39 57
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrVect.java
1026 1026
			throw new EditionException(e);
1027 1027
		}
1028 1028

  
1029
		setSpatialCacheEnabled(true);
1029
		setSpatialCacheEnabled(b);
1030 1030
		callEditionChanged(LayerEvent
1031 1031
				.createEditionChangedEvent(this, "edition"));
1032 1032

  

Also available in: Unified diff