Statistics
| Revision:

gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.fmap / src / main / java / org / gvsig / raster / fmap / layers / FLyrRaster.java @ 2582

History | View | Annotate | Download (10.4 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
5
* 
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
* 
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
* 
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
* MA  02110-1301, USA.
20
* 
21
*/
22
package org.gvsig.raster.fmap.layers;
23

    
24
import java.awt.Graphics2D;
25
import java.awt.geom.AffineTransform;
26
import java.awt.geom.Point2D;
27
import java.awt.image.BufferedImage;
28
import java.io.File;
29
import java.util.ArrayList;
30
import java.util.List;
31

    
32
import org.cresques.cts.IProjection;
33
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
34
import org.gvsig.fmap.dal.coverage.datastruct.NoData;
35
import org.gvsig.fmap.dal.coverage.exception.InvalidSourceException;
36
import org.gvsig.fmap.dal.coverage.exception.ROIException;
37
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
38
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
39
import org.gvsig.fmap.dal.coverage.grid.render.Render;
40
import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
41
import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
42
import org.gvsig.fmap.dal.coverage.util.Historical;
43
import org.gvsig.fmap.dal.exception.ReadException;
44
import org.gvsig.fmap.geom.primitive.Envelope;
45
import org.gvsig.fmap.mapcontext.MapContext;
46
import org.gvsig.fmap.mapcontext.ViewPort;
47
import org.gvsig.fmap.mapcontext.layers.FLayer;
48
import org.gvsig.fmap.mapcontext.layers.LayerListener;
49
import org.gvsig.raster.roi.ROI;
50
import org.gvsig.tools.task.Cancellable;
51

    
52
/**
53
 * All kind of raster layers should implement this interface.
54
 * 
55
 * @author Nacho Brodin (nachobrodin@gmail.com)
56
 */
57
@SuppressWarnings("deprecation")
58
public interface FLyrRaster extends FLayer {
59
        /**
60
         * Sets the layer as initialized. That's implies that the layer has
61
         * the right filters and is opened, 
62
         * @param initialized
63
         */
64
        public void setLayerInitialized(boolean initialized);
65
        
66
        /**
67
         * Gets the uniform resource identifier
68
         * @return
69
         */
70
        public String getURI();
71
        
72
        /**
73
         * Returns true if a color table exists
74
         * @return
75
         */
76
        public boolean existColorTable();
77
        
78
        /**
79
         * Define la ultima leyenda valida de la capa o se pone a null para que la
80
         * capa busque una leyenda valida.
81
         * @param ct
82
         */
83
        public void setLastLegend(ColorTable ct);
84
        
85
        /**
86
         * Crea el objeto renderizador de raster
87
         * @return Rendering
88
         */
89
        public Render getRender();
90
        
91
        /**
92
         * Gets the MapContext object
93
         * @return
94
         */
95
        public MapContext getMapContext();
96
        
97
        /**
98
         * Gets the full extent
99
         * @return
100
         */
101
        public Extent getFullRasterExtent();
102
        
103
        /**
104
         * Gets the DataStore
105
         * @return
106
         */
107
        public RasterDataStore getDataStore();
108
        
109
        /**
110
         * Metodo para consultar si una capa puede ser un RGB. Suponemos que es un RGB
111
         * si el tipo de datos es de tipo byte y su interpretacion de color tiene
112
         * asignada los tres colores.
113
         * @return boolean
114
         */
115
        public boolean isRGB();
116
        
117
        /**
118
         * Returns true if the drawn is going to be tiled
119
         * @return
120
         */
121
        public boolean isTiled();
122
        
123
        /**
124
         * Gets the regions of interest
125
         * @return 
126
         * @throws ROIException 
127
         */
128
        public List<ROI> getRois() throws ROIException;
129
        
130
        /**
131
         * Sets the regions of interest
132
         */
133
        public void setRois(List<ROI> rois);
134
        
135
        /**
136
         * Sets the files which contain the regions of interest. This method is temporal until
137
         * after the refactoring of ROIs.
138
         * @param file
139
         * @throws RmfSerializerException
140
         */
141
        public void setROIsFiles(List<File> file) throws RmfSerializerException;
142
        
143
        /**
144
         * Gets the files which contain the regions of interest. This method is temporal until
145
         * after the refactoring of ROIs.
146
         * @return
147
         * @throws RmfSerializerException
148
         */
149
        public List<File> getROIsFiles() throws RmfSerializerException;
150
        
151
        /**
152
         * Obtiene la proyecci?n del fichero.
153
         * @return IProjection
154
         */
155
        public IProjection readProjection() throws RasterDriverException;
156
        
157
        /**
158
         * Gets the tile size
159
         * @return
160
         */
161
        public int[] getTileSize();
162
        
163
        /**
164
         * Obtiene el valor NoData asociado al raster.
165
         * @return double
166
         */
167
        public NoData getNoDataValue();
168
        
169
        /**
170
         * Returs a string with the extension of the first file
171
         */
172
        public String getFileFormat();
173
        
174
        /**
175
         * Obtiene el flag que dice si la imagen est? o no georreferenciada
176
         * @return true si est? georreferenciada y false si no lo est?.
177
         */
178
        public boolean isGeoreferenced();
179
        
180
        /**
181
         * Returns the number of bands of each dataset
182
         * @return
183
         */
184
        public int[] getBandCountFromDataset();
185
        
186
        /**
187
         * Gets the projection in well known text format
188
         * @return
189
         * @throws RasterDriverException
190
         */
191
        public String getWktProjection() throws RasterDriverException;
192
        
193
        /**
194
         * Gets the color interpretation
195
         * @param band
196
         * @param dataset
197
         * @return
198
         */
199
        public String getColorInterpretation(int band, int dataset);
200
        
201
        /**
202
         * When a process is using information of this layer this variable will contain
203
         * the thread ID.
204
         * @param readingData
205
         */
206
        public void setReadingData(String readingData);
207
        
208
        /**
209
         * Sets the nodata value for this layer
210
         * @param noDataValue the noDataValue to set
211
         */
212
        public void setNoDataValue(NoData noDataValue);
213
        
214
        /**
215
         * Sets the minimum scale visible. Lower scales won't be drawn.
216
         *
217
         * @param minScale the scale > 0, -1 if not defined
218
         * @see #getMinScale()
219
         */
220
        public void setMinScale(double minScale);
221
        
222
        /**
223
         * Sets the maximum scale visible. Higher scales won't be drawn.
224
         *
225
         * @param maxScale the scale > 0, -1 if not defined
226
         * @see #getMaxScale()
227
         */
228
        public void setMaxScale(double maxScale);
229

    
230
        /**
231
         * Returns the maximum scale visible. Higher scales won't be drawn.
232
         *
233
         * @return the maximum scale > 0, -1 if not defined
234
         * @see #setMaxScale(double)
235
         */
236
        public double getMaxScale();
237
        
238
        /**
239
         * Returns the minimum scale visible. Lower scales won't be drawn.
240
         *
241
         * @return the minimum scale > 0, -1 if not defined
242
         * @see #setMinScale(double)
243
         */
244
        public double getMinScale();
245
        
246
        /**
247
         * @return Returns the removeRasterFlag.
248
         */
249
        public boolean isRemoveRasterFlag();
250

    
251
        /**
252
         * Asigna el valor del flag que dice si destruimos la memoria del raster
253
         * al eliminarlo del TOC o  no.
254
         * @param removeRasterFlag The removeRasterFlag to set.
255
         */
256
        public void setRemoveRasterFlag(boolean removeRasterFlag);
257
        
258
        /**
259
         * Borra de la lista de listeners el que se pasa como par?metro.
260
         *
261
         * @param o LayerListener a borrar.
262
         *
263
         * @return True si ha sido correcto el borrado del Listener.
264
         */
265
        public boolean removeLayerListener(LayerListener o);
266
        
267
        /**
268
         * @throws ReadException
269
         * @throws ReadDriverException
270
         * @see com.iver.cit.gvsig.fmap.layers.LayerOperations#draw(java.awt.image.BufferedImage,
271
         *                 java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort,
272
         *                 com.iver.utiles.swing.threads.Cancellable)
273
         */
274
        public void draw(BufferedImage image, Graphics2D g, ViewPort vp, Cancellable cancel, double scale) throws ReadException;
275
        
276
        /**
277
         * Clones this layer
278
         * @return
279
         * @throws Exception
280
         */
281
        public FLayer cloneLayer() throws Exception;
282
        
283
        /**
284
         * Gets a layer which the source is a file
285
         * @return
286
         * @throws RasterDriverException 
287
         */
288
        public FLayer getFileLayer() throws RasterDriverException;
289
        
290
        /**
291
         * Gets the position of the alpha band  
292
         * @return
293
         */
294
        public int getAlphaBandNumber();
295
        
296
        public String getName();
297
        
298
        /**
299
         * Gets the projection
300
         * @return
301
         */
302
        public IProjection getProjection();
303
        
304
        /**
305
         * Devuelve si es reproyectable o no la capa
306
         * @return
307
         */
308
        public boolean isReproyectable();
309
        
310
        /**
311
         * Recupera del raster la matriz de transformaci?n que lo situa en cualquier parte de la vista
312
         * @return AffineTransform
313
         */
314
        public AffineTransform getAffineTransform();
315
        
316
        /**
317
         * Obtiene la lista de transformaciones que se han ido aplicando al raster.
318
         * @return Historical. Lista de AffineTransform
319
         */
320
        public Historical getAffineTransformHistorical();
321
        
322
        /**
323
         * Asigna al raster la matriz de transformaci?n para situarlo en cualquier parte de la vista
324
         * @param transf
325
         */
326
        public void setAffineTransform(AffineTransform transf);
327
        
328
        /**
329
         * Asigna al raster la matriz de transformaci?n para situarlo en cualquier parte de la vista.
330
         * Esta versi?n no guarda en el historico.
331
         * @param transf
332
         */
333
        public void setAffineTransformWithoutHistorical(AffineTransform transf);
334
        
335
        /**
336
         * Salva la georreferenciaci?n a fichero rmf.
337
         * @param fName
338
         * @throws RmfSerializerException
339
         */
340
        public void saveGeoToRmf() throws RmfSerializerException;
341
        
342
        /**
343
         * Metodo que obtiene si un punto cae dentro de los l?mites de la capa
344
         * o fuera de ellos.
345
         * @param p Punto a calcular
346
         * @return true si est? dentro de los l?mites y false si est? fuera
347
         */
348
        public boolean isInside(Point2D p);
349
        
350
        /**
351
         * Returns true if this layer is remote
352
         * @return
353
         */
354
        public boolean isRemote();
355
        
356
        /**
357
         * Gets the attribute list
358
         * <UL>
359
         * <LI>Filename</LI>
360
         * <LI>Filesize</LI>
361
         * <LI>Width</LI>
362
         * <LI>Height</LI>
363
         * <LI>Bands</LI>
364
         * </UL>
365
         * @return ArrayList<Object>
366
         */
367
        public ArrayList<Object> getAttributes();
368
        
369
        /**
370
         * Returns the full bounding box of this layer
371
         * @return
372
         */
373
        public Envelope getFullEnvelope();
374
        
375
        /**
376
         * Ajusta las coordenadas especificadas en el par?metro al ?rea m?xima
377
         * del raster en p?xeles.
378
         * @param req Punto a ajustar dentro del extener del raster
379
         */
380
        public Point2D adjustWorldRequest(Point2D req);
381
        
382
        /**
383
         * Adds a new file. The behavior of this function depends on 
384
         * the kind of provider and its implementation.
385
         * @param file
386
         * @throws InvalidSourceException 
387
         */
388
        public void addFile(String file) throws InvalidSourceException;
389
        
390
        /**
391
         * Removes a file. The behavior of this function depends on 
392
         * the kind of provider and its implementation.
393
         * @param file
394
         */
395
        public void removeFile(String file);
396
        
397
        /**
398
         * When this flag is true then renderice nodata value as transparent
399
         * @param t
400
         */
401
        public void setNoDataTransparent(boolean t);
402
        
403
        /**
404
         * Sets the layer projection
405
         * @param proj
406
         */
407
        public void setProjection(IProjection proj, boolean persist) throws RmfSerializerException;
408

    
409
}