Statistics
| Revision:

gvsig-raster / org.gvsig.raster / tags / 2.0.0 / org.gvsig.raster.fmap / src / main / java / org / gvsig / raster / fmap / layers / FLyrRaster.java @ 1708

History | View | Annotate | Download (10.5 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.util.ArrayList;
29

    
30
import org.cresques.cts.IProjection;
31
import org.gvsig.fmap.dal.coverage.datastruct.Extent;
32
import org.gvsig.fmap.dal.coverage.datastruct.NoData;
33
import org.gvsig.fmap.dal.coverage.exception.GridException;
34
import org.gvsig.fmap.dal.coverage.exception.InvalidSourceException;
35
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
36
import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
37
import org.gvsig.fmap.dal.coverage.grid.Grid;
38
import org.gvsig.fmap.dal.coverage.grid.ROI;
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.tools.task.Cancellable;
50

    
51
/**
52
 * All kind of raster layers should implement this interface.
53
 * 
54
 * @author Nacho Brodin (nachobrodin@gmail.com)
55
 */
56
@SuppressWarnings("deprecation")
57
public interface FLyrRaster extends FLayer {
58
        /**
59
         * Gets the uniform resource identifier
60
         * @return
61
         */
62
        public String getURI();
63
        
64
        /**
65
         * Returns true if a color table exists
66
         * @return
67
         */
68
        public boolean existColorTable();
69
        
70
        /**
71
         * Define la ultima leyenda valida de la capa o se pone a null para que la
72
         * capa busque una leyenda valida.
73
         * @param ct
74
         */
75
        public void setLastLegend(ColorTable ct);
76
        
77
        /**
78
         * Crea el objeto renderizador de raster
79
         * @return Rendering
80
         */
81
        public Render getRender();
82
        
83
        /**
84
         * Gets the MapContext object
85
         * @return
86
         */
87
        public MapContext getMapContext();
88
        
89
        /**
90
         * Gets the full extent
91
         * @return
92
         */
93
        public Extent getFullRasterExtent();
94
        
95
        /**
96
         * Gets the DataStore
97
         * @return
98
         */
99
        public RasterDataStore getDataStore();
100
        
101
        /**
102
         * Metodo para consultar si una capa puede ser un RGB. Suponemos que es un RGB
103
         * si el tipo de datos es de tipo byte y su interpretacion de color tiene
104
         * asignada los tres colores.
105
         * @return boolean
106
         */
107
        public boolean isRGB();
108
        
109
        /**
110
         * Returns true if the drawn is going to be tiled
111
         * @return
112
         */
113
        public boolean isTiled();
114
        
115
        /**
116
         * Gets the regions of interest
117
         * @return 
118
         */
119
        public ArrayList<ROI> getRois();
120
        
121
        /**
122
         * Sets the regions of interest
123
         *
124
         */
125
        public void setRois(ArrayList<ROI> rois);
126
        
127
        /**
128
         * Obtiene la proyecci?n del fichero.
129
         * @return IProjection
130
         */
131
        public IProjection readProjection() throws RasterDriverException;
132
        
133
        /**
134
         * Gets the tile size
135
         * @return
136
         */
137
        public int[] getTileSize();
138
        
139
        /**
140
         * Obtiene el grid de la capa completa. Esta llamada devuelve un buffer de solo lectura
141
         * @param interpolated true si se solicita un grid interpolado y false si se solicita sin interpolar.
142
         * @return Grid.
143
         * @throws InterruptedException
144
         */
145
        public Grid getReadOnlyFullGrid(boolean interpolated) throws GridException, InterruptedException;
146
        
147
        /**
148
         * Obtiene el valor NoData asociado al raster.
149
         * @return double
150
         */
151
        public NoData getNoDataValue();
152
        
153
        /**
154
         * Gets the height in pixels of this raster layer
155
         */
156
        public double getPxHeight();
157

    
158
        /**
159
         * Gets the width in pixels of this raster layer
160
         */
161
        public double getPxWidth();
162
        
163
        /**
164
         * Returs a string with the extension of the first file
165
         */
166
        public String getFileFormat();
167
        
168
        /**
169
         * Obtiene el flag que dice si la imagen est? o no georreferenciada
170
         * @return true si est? georreferenciada y false si no lo est?.
171
         */
172
        public boolean isGeoreferenced();
173
        
174
        /**
175
         * Returns the number of bands of each dataset
176
         * @return
177
         */
178
        public int[] getBandCountFromDataset();
179
        
180
        /**
181
         * Gets the projection in well known text format
182
         * @return
183
         * @throws RasterDriverException
184
         */
185
        public String getWktProjection() throws RasterDriverException;
186
        
187
        /**
188
         * Gets the color interpretation
189
         * @param band
190
         * @param dataset
191
         * @return
192
         */
193
        public String getColorInterpretation(int band, int dataset);
194
        
195
        /**
196
         * When a process is using information of this layer this variable will contain
197
         * the thread ID.
198
         * @param readingData
199
         */
200
        public void setReadingData(String readingData);
201
        
202
        /**
203
         * Sets the nodata value for this layer
204
         * @param noDataValue the noDataValue to set
205
         */
206
        public void setNoDataValue(NoData noDataValue);
207
        
208
        /**
209
         * Sets the minimum scale visible. Lower scales won't be drawn.
210
         *
211
         * @param minScale the scale > 0, -1 if not defined
212
         * @see #getMinScale()
213
         */
214
        public void setMinScale(double minScale);
215
        
216
        /**
217
         * Sets the maximum scale visible. Higher scales won't be drawn.
218
         *
219
         * @param maxScale the scale > 0, -1 if not defined
220
         * @see #getMaxScale()
221
         */
222
        public void setMaxScale(double maxScale);
223

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

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

    
382
        /**
383
         * Returns the maximun Y coordinate of the bounding
384
         * @return
385
         */
386
        public double getMaxY();
387

    
388
        /**
389
         * Returns the minimun X coordinate of the bounding
390
         * @return
391
         */
392
        public double getMinX();
393

    
394
        /**
395
         * Returns the minimun Y coordinate of the bounding
396
         * @return
397
         */
398
        public double getMinY();
399
        
400
        /**
401
         * Adds a new file. The behavior of this function depends on 
402
         * the kind of provider and its implementation.
403
         * @param file
404
         * @throws InvalidSourceException 
405
         */
406
        public void addFile(String file) throws InvalidSourceException;
407
        
408
        /**
409
         * Removes a file. The behavior of this function depends on 
410
         * the kind of provider and its implementation.
411
         * @param file
412
         */
413
        public void removeFile(String file);
414
        
415
        /**
416
         * When this flag is true then renderice nodata value as transparent
417
         * @param t
418
         */
419
        public void setNoDataTransparent(boolean t);
420

    
421
}