Revision 335 org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.algorithm/org.gvsig.geoprocess.algorithm.base/src/main/java/org/gvsig/geoprocess/algorithm/base/core/GeometryOperation.java

View differences:

GeometryOperation.java
46 46
 */
47 47
@SuppressWarnings("deprecation")
48 48
public abstract class GeometryOperation {
49
	protected DALFeaturePersister              persister          = null;
50
	protected FeatureStore                     inFeatureStore     = null;
51
	protected ArrayList<FeatureStore>          inFeatureStoreList = null;
52
	protected boolean                          selectedGeom       = false;
53
	protected int                              numberOfFeatures   = 0;
54
	protected EditableFeature                  lastEditFeature    = null;
55
    protected SimpleTaskStatus                 status             = null;
56
    protected AbstractSextanteGeoProcess       process            = null;
57
    protected int                              procesSize         = 0;
49
	protected DALFeaturePersister              persister           = null;
50
	protected FeatureStore                     inFeatureStore      = null;
51
	protected ArrayList<FeatureStore>          inFeatureStoreList  = null;
52
	protected int                              numberOfFeatures    = 0;
53
	protected EditableFeature                  lastEditFeature     = null;
54
    protected SimpleTaskStatus                 status              = null;
55
    protected AbstractSextanteGeoProcess       process             = null;
56
    protected boolean                          selectedGeomInput   = false;
57
    protected boolean                          selectedGeomOverlay = false;
58
    protected int                              procesSize          = 0;
58 59
	
59 60
    public GeometryOperation(AbstractSextanteGeoProcess process) {
60 61
    	this.process = process;
61 62
    }
62 63
    
64
    /**
65
     * Assigns the flag to use only the selected geometries 
66
     * in the overlay layer
67
     */
68
    public void setSelectedGeomOverlayLayer(boolean setSelected) {
69
    	this.selectedGeomOverlay = setSelected;
70
    }
71
    
63 72
	/**
64 73
	 * Invokes this operation and returns an EditableFeature
65 74
	 * @param g
......
109 118
	public void computesGeometryOperation(FeatureStore inFeatStore,
110 119
									FeatureStore outFeatStore,
111 120
									String[] attrNames,
112
									boolean selectedGeom,
121
									boolean selectedGeomInput,
122
									boolean selectedGeomOverlay,
113 123
									boolean closeOutStore) throws DataException {
114 124
		this.inFeatureStore = inFeatStore;
115
		this.selectedGeom = selectedGeom;
116 125
		FeatureSet featuresSet = null;
117
		
126
		this.selectedGeomInput = selectedGeomInput;
127
		this.selectedGeomOverlay = selectedGeomOverlay;
118 128
		if(outFeatStore != null)
119 129
			setFeatureStore(outFeatStore, attrNames);
120 130
		DisposableIterator it = null;
121 131

  
122
		if(selectedGeom) {
132
		if(selectedGeomInput) {
123 133
			featuresSet = (FeatureSet)inFeatStore.getSelection();
124 134
		} else {
125 135
			featuresSet = inFeatStore.getFeatureSet();
......
182 192
	public void computesFeatureOperation(FeatureStore inFeatStore,
183 193
									FeatureStore outFeatStore,
184 194
									String[] attrNames,
185
									boolean selectedGeom,
195
									boolean selectedGeomInput,
196
									boolean selectedGeomOverlay,
186 197
									boolean closeOutStore) throws DataException {
187 198
		this.inFeatureStore = inFeatStore;
188
		this.selectedGeom = selectedGeom;
189 199
		FeatureSet featuresSet = null;
190 200
		featuresSet = inFeatStore.getFeatureSet();
201
		this.selectedGeomInput = selectedGeomInput;
202
		this.selectedGeomOverlay = selectedGeomOverlay;
191 203
		
192 204
		if(outFeatStore != null)
193 205
			setFeatureStore(outFeatStore, attrNames);
194 206
		DisposableIterator it = null;
195 207

  
196
		if(selectedGeom) {
208
		if(selectedGeomInput) {
197 209
			DataSet ds = inFeatStore.getSelection();
198 210
            it = ((FeatureSelection) ds).fastIterator();
199 211
		} else
......
236 248
	public void computesGeometryOperationInAList(ArrayList<FeatureStore> inFeatStoreList,
237 249
									FeatureStore outFeatStore,
238 250
									String[] attrNames,
239
									boolean selectedGeom,
251
									boolean selectedGeomInput,
252
									boolean selectedGeomOverlay,
240 253
									boolean closeOutStore) throws DataException {
241 254
		this.inFeatureStoreList = inFeatStoreList;
255
		this.selectedGeomInput = selectedGeomInput;
256
		this.selectedGeomOverlay = selectedGeomOverlay;
242 257
		
243 258
		if (status != null && process != null) {
244 259
            status.setRangeOfValues(0, inFeatStoreList.size());
......
255 270
			computesGeometryOperation(inFeatStoreList.get(i), 
256 271
										i == 0 ? outFeatStore : null, 
257 272
										attrNames, 
258
										selectedGeom, 
273
										selectedGeomInput,
274
										selectedGeomOverlay,
259 275
										false);
260 276
			if(process.getTaskMonitor().isCanceled())
261 277
				return;

Also available in: Unified diff