svn-gvsig-desktop / tags / v10_RC2c / extensions / extGeoreferencing / src / com / iver / cit / gvsig / fmap / layers / FLyrPoints.java @ 8745
History | View | Annotate | Download (35.5 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2006 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
package com.iver.cit.gvsig.fmap.layers; |
20 |
|
21 |
import java.awt.Color; |
22 |
import java.awt.Dimension; |
23 |
import java.awt.Graphics2D; |
24 |
import java.awt.geom.Point2D; |
25 |
import java.awt.geom.Rectangle2D; |
26 |
import java.awt.image.BufferedImage; |
27 |
import java.util.ArrayList; |
28 |
import java.util.Iterator; |
29 |
|
30 |
import org.cresques.cts.ProjectionPool; |
31 |
import org.gvsig.georeferencing.utils.GeoPointPersistence; |
32 |
import org.gvsig.georeferencing.utils.PointManager; |
33 |
|
34 |
import com.iver.andami.PluginServices; |
35 |
import com.iver.cit.gvsig.fmap.DriverException; |
36 |
import com.iver.cit.gvsig.fmap.ViewPort; |
37 |
import com.iver.cit.gvsig.fmap.crs.CRSFactory; |
38 |
import com.iver.cit.gvsig.gui.View; |
39 |
import com.iver.utiles.XMLEntity; |
40 |
import com.iver.utiles.swing.threads.Cancellable; |
41 |
|
42 |
|
43 |
/**
|
44 |
* Clase de capa de marcado de puntos sobre una vista. Dibuja un puntero sobre
|
45 |
* cada punto en la vista. Esta capa hereda de GraphicLayer que es una capa que est?
|
46 |
* metida de forma fija en FMap. Con esto conseguimos que nuestra capa de puntos
|
47 |
* no aparezca en el TOC y siempre se dibuje por encima de todas las capas. Tiene
|
48 |
* el inconveniente de que est? en FMap y si hacemos un dibujado de las capas
|
49 |
* sobre un panel que no sea la vista de gvSIG este GraphicLayer no aparece.
|
50 |
* Si queremos hacer este tipo de dibujados tendremos que dibujar todas las capas
|
51 |
* con el draw de FLayers y al final llamar al draw de FLyrPoints.
|
52 |
*
|
53 |
* @author Nacho Brodin (brodin_ign@gva.es)
|
54 |
*/
|
55 |
public class FLyrPoints extends GraphicLayer { |
56 |
|
57 |
//**********************Params********************************
|
58 |
/**
|
59 |
* Diametro del centro de la cruz
|
60 |
*/
|
61 |
private final int DIAM_CIRCLE = 18; |
62 |
/**
|
63 |
* ?ltima herramienta seleccionada. Despu?s de marcar el segundo punto en la vista ser? la
|
64 |
* herramienta por defecto.
|
65 |
*/
|
66 |
private String lastTool = "zoomIn"; |
67 |
//**********************End Params****************************
|
68 |
|
69 |
//**********************Vars**********************************
|
70 |
private ArrayList pointList = new ArrayList(); |
71 |
private boolean showNumber = true; |
72 |
private FLyrPointsState state = null; |
73 |
private IPersistence geoPointPersistence = null; |
74 |
private FLyrGeoRaster lyrGeoRaster = null; |
75 |
public static boolean isDrawing = false; |
76 |
private PointManager pointManager = null; |
77 |
private boolean lyrVisible = true; |
78 |
private boolean lyrHideViewOnly = true; |
79 |
private Point2D[] transformPointList = null; |
80 |
private boolean withoutBlue = false; |
81 |
private boolean withoutRed = false; |
82 |
//**********************End Vars**********************************
|
83 |
|
84 |
//**********************Classes***********************************
|
85 |
/**
|
86 |
* Estado de la capa de puntos.
|
87 |
* @author Nacho Brodin (brodin_ign@gva.es)
|
88 |
*/
|
89 |
public class FLyrPointsState{ |
90 |
public ArrayList pointList = new ArrayList(); |
91 |
public boolean showNumber = true; |
92 |
public String lastTool = "zoomIn"; |
93 |
} |
94 |
//**********************End Classes*******************************
|
95 |
|
96 |
//**********************Methods***********************************
|
97 |
/**
|
98 |
* Constructor
|
99 |
* @param flyGeoRaster
|
100 |
*/
|
101 |
public FLyrPoints(FLyrGeoRaster lyGeoRaster, IPersistence persistence){
|
102 |
this.lyrGeoRaster = lyGeoRaster;
|
103 |
geoPointPersistence = persistence; |
104 |
} |
105 |
|
106 |
/**
|
107 |
* Salva el estado actual de la capa de puntos. Podr? ser recuperado
|
108 |
* este ?ltimo estado salvado con la funci?n recoveryState
|
109 |
*
|
110 |
*/
|
111 |
public void saveState(){ |
112 |
if(state == null) |
113 |
state = new FLyrPointsState();
|
114 |
else
|
115 |
state.pointList.clear(); |
116 |
|
117 |
for(int i=0;i<this.length();i++) |
118 |
state.pointList.add(((GeoPoint)pointList.get(i)).cloneGeoPoint()); |
119 |
|
120 |
state.showNumber = showNumber; |
121 |
state.lastTool = lastTool; |
122 |
} |
123 |
|
124 |
/**
|
125 |
* Recupera el estado de la capa de puntos desde la ?ltima vez que se
|
126 |
* ejecut? la funci?n saveState. Si no hay ning?n estdo salvado es que
|
127 |
* al principio estaba la capa vacia por lo que reiniciamos la capa de puntos.
|
128 |
*/
|
129 |
public void recoveryState(){ |
130 |
if(state != null){ |
131 |
pointList.clear(); |
132 |
for(int i=0;i<state.pointList.size();i++) |
133 |
pointList.add(((GeoPoint)state.pointList.get(i)).cloneGeoPoint()); |
134 |
|
135 |
showNumber = state.showNumber; |
136 |
lastTool = state.lastTool; |
137 |
} |
138 |
} |
139 |
|
140 |
/**
|
141 |
* Asigna el array de puntos
|
142 |
* @param list
|
143 |
*/
|
144 |
public void setListPoint(ArrayList list){ |
145 |
pointList = list; |
146 |
} |
147 |
|
148 |
/**
|
149 |
* Dibujado de la capa de raster georeferenciado aplicando la
|
150 |
* transformaci?n del viewPort.
|
151 |
*/
|
152 |
public void draw(BufferedImage image, Graphics2D g, ViewPort vp, |
153 |
Cancellable cancel,double scale) throws DriverException { |
154 |
|
155 |
Point2D pto = null; |
156 |
|
157 |
if(lyrHideViewOnly && lyrVisible && lyrGeoRaster != null){ |
158 |
//vp = lyrGeoRaster.toImageCoord(vp);
|
159 |
synchronized (this) { |
160 |
for(int i=0; i<pointList.size();i++){ |
161 |
//Punto de la imagen
|
162 |
if(((GeoPoint)pointList.get(i)).active){
|
163 |
pto = ((GeoPoint)pointList.get(i)).pixelPoint; |
164 |
if(pto != null){ |
165 |
Point2D p = lyrGeoRaster.img2World(pto);
|
166 |
p = vp.fromMapPoint(p); |
167 |
drawPixelCrux(g, p, i); |
168 |
} |
169 |
|
170 |
//Punto de la vista
|
171 |
pto = ((GeoPoint)pointList.get(i)).mapPoint; |
172 |
if(pto != null){ |
173 |
Point2D p = null; |
174 |
p = vp.fromMapPoint(pto); |
175 |
drawMapCrux(g, p, i); |
176 |
} |
177 |
} |
178 |
} |
179 |
} |
180 |
} |
181 |
} |
182 |
|
183 |
/**
|
184 |
* Dibuja el gr?fico que corresponde a los puntos de coordenadas relativas a la imagen de origen
|
185 |
* @param g Graphics sobre el que se dibuja
|
186 |
* @param vp Viewport
|
187 |
* @param cancel
|
188 |
*/
|
189 |
public void drawPixelCrux(Graphics2D g, ViewPort vp, Cancellable cancel){ |
190 |
Point2D pto = null; |
191 |
if(lyrVisible && lyrGeoRaster != null){ |
192 |
for(int i=0; i<pointList.size();i++){ |
193 |
if(((GeoPoint)pointList.get(i)).active){
|
194 |
pto = ((GeoPoint)pointList.get(i)).pixelPoint; |
195 |
if(pto != null){ |
196 |
Point2D p = lyrGeoRaster.img2World(pto);
|
197 |
p = vp.fromMapPoint(p); |
198 |
drawPixelCrux(g, p, i); |
199 |
} |
200 |
} |
201 |
} |
202 |
} |
203 |
} |
204 |
|
205 |
/**
|
206 |
* Dibuja el gr?fico que corresponde a los puntos de coordenadas de mundo real.
|
207 |
* @param g Graphics sobre el que se dibuja
|
208 |
* @param vp Viewport
|
209 |
* @param cancel
|
210 |
*/
|
211 |
public void drawMapCrux(Graphics2D g, ViewPort vp, Cancellable cancel){ |
212 |
Point2D pto = null; |
213 |
if(lyrVisible && lyrGeoRaster != null){ |
214 |
for(int i=0; i<pointList.size();i++){ |
215 |
if(((GeoPoint)pointList.get(i)).active){
|
216 |
pto = ((GeoPoint)pointList.get(i)).mapPoint; |
217 |
if(pto != null){ |
218 |
Point2D p = null; |
219 |
p = vp.fromMapPoint(pto); |
220 |
drawMapCrux(g, p, i); |
221 |
} |
222 |
} |
223 |
} |
224 |
} |
225 |
} |
226 |
|
227 |
/**
|
228 |
* Dibuja sobre el graphics pasado la cruz del punto que marca
|
229 |
* el pixel de la imagen.
|
230 |
* @param g Graphics
|
231 |
*/
|
232 |
private void drawPixelCrux(Graphics2D g, Point2D p, int pointNumber){ |
233 |
int dpto = (DIAM_CIRCLE >> 1); |
234 |
int incr = 5; |
235 |
g.setColor(Color.WHITE);
|
236 |
g.drawOval( (int)p.getX() - dpto + 1, |
237 |
(int)p.getY() - dpto + 1, |
238 |
DIAM_CIRCLE - 2,
|
239 |
DIAM_CIRCLE - 2);
|
240 |
g.drawLine((int)p.getX() - incr, (int)p.getY() - 1, (int)p.getX() - 1, (int)p.getY() - 1); |
241 |
g.drawLine((int)p.getX() - incr, (int)p.getY() + 1, (int)p.getX() - 1, (int)p.getY() + 1); |
242 |
|
243 |
g.drawLine((int)p.getX() + incr, (int)p.getY() - 1, (int)p.getX() + 1, (int)p.getY() - 1); |
244 |
g.drawLine((int)p.getX() + incr, (int)p.getY() + 1, (int)p.getX() + 1, (int)p.getY() + 1); |
245 |
|
246 |
g.drawLine((int)p.getX() - 1, (int)p.getY() - incr, (int)p.getX() - 1, (int)p.getY() - 1); |
247 |
g.drawLine((int)p.getX() + 1, (int)p.getY() - incr, (int)p.getX() + 1, (int)p.getY() - 1); |
248 |
|
249 |
g.drawLine((int)p.getX() - 1, (int)p.getY() + incr, (int)p.getX() - 1, (int)p.getY() + 1); |
250 |
g.drawLine((int)p.getX() + 1, (int)p.getY() + incr, (int)p.getX() + 1, (int)p.getY() + 1); |
251 |
|
252 |
g.setColor(Color.red);
|
253 |
g.drawOval( (int)p.getX() - dpto,
|
254 |
(int)p.getY() - dpto,
|
255 |
DIAM_CIRCLE, |
256 |
DIAM_CIRCLE); |
257 |
g.drawLine((int)p.getX(), (int)p.getY() - dpto - incr, (int)p.getX(), (int)p.getY() + dpto + incr); |
258 |
g.drawLine((int)p.getX() - dpto - incr, (int)p.getY(), (int)p.getX() + dpto + incr, (int)p.getY()); |
259 |
|
260 |
if(showNumber){
|
261 |
String pt = String.valueOf(pointNumber + 1); |
262 |
int ptX = (int)(p.getX() + dpto + 1); |
263 |
int ptY = (int)(p.getY() + dpto - 1); |
264 |
g.setColor(Color.WHITE);
|
265 |
for (int i= -1; i<2; i++) |
266 |
for (int j= -1; j<2; j++) |
267 |
g.drawString(pt, ptX + i, ptY + j ); |
268 |
g.setColor(Color.red);
|
269 |
g.drawString(pt, ptX, ptY ); |
270 |
} |
271 |
} |
272 |
|
273 |
/**
|
274 |
* Dibuja sobre el graphics pasado la cruz del punto que marca
|
275 |
* la coordenada de la vista.
|
276 |
* @param g Graphics
|
277 |
*/
|
278 |
private void drawMapCrux(Graphics2D g, Point2D p, int pointNumber){ |
279 |
int dpto = (DIAM_CIRCLE >> 1); |
280 |
int incr = 5; |
281 |
g.setColor(Color.WHITE);
|
282 |
g.drawRect( (int)p.getX() - dpto + 1, |
283 |
(int)p.getY() - dpto + 1, |
284 |
DIAM_CIRCLE - 2,
|
285 |
DIAM_CIRCLE - 2);
|
286 |
g.drawLine((int)p.getX() - incr, (int)p.getY() - 1, (int)p.getX() - 1, (int)p.getY() - 1); |
287 |
g.drawLine((int)p.getX() - incr, (int)p.getY() + 1, (int)p.getX() - 1, (int)p.getY() + 1); |
288 |
|
289 |
g.drawLine((int)p.getX() + incr, (int)p.getY() - 1, (int)p.getX() + 1, (int)p.getY() - 1); |
290 |
g.drawLine((int)p.getX() + incr, (int)p.getY() + 1, (int)p.getX() + 1, (int)p.getY() + 1); |
291 |
|
292 |
g.drawLine((int)p.getX() - 1, (int)p.getY() - incr, (int)p.getX() - 1, (int)p.getY() - 1); |
293 |
g.drawLine((int)p.getX() + 1, (int)p.getY() - incr, (int)p.getX() + 1, (int)p.getY() - 1); |
294 |
|
295 |
g.drawLine((int)p.getX() - 1, (int)p.getY() + incr, (int)p.getX() - 1, (int)p.getY() + 1); |
296 |
g.drawLine((int)p.getX() + 1, (int)p.getY() + incr, (int)p.getX() + 1, (int)p.getY() + 1); |
297 |
|
298 |
g.setColor(new Color(45, 8 , 165)); |
299 |
g.drawRect( (int)p.getX() - dpto,
|
300 |
(int)p.getY() - dpto,
|
301 |
DIAM_CIRCLE, |
302 |
DIAM_CIRCLE); |
303 |
g.drawLine((int)p.getX(), (int)p.getY() - dpto - incr, (int)p.getX(), (int)p.getY() + dpto + incr); |
304 |
g.drawLine((int)p.getX() - dpto - incr, (int)p.getY(), (int)p.getX() + dpto + incr, (int)p.getY()); |
305 |
if(showNumber){
|
306 |
String pt = String.valueOf(pointNumber + 1); |
307 |
int ptX = (int)(p.getX() + dpto + 1); |
308 |
int ptY = (int)(p.getY() - dpto - 1); |
309 |
g.setColor(Color.WHITE);
|
310 |
for (int i= -1; i<2; i++) |
311 |
for (int j= -1; j<2; j++) |
312 |
g.drawString(pt, ptX + i, ptY + j ); |
313 |
g.setColor(new Color(45, 8 , 165)); |
314 |
g.drawString(String.valueOf(pointNumber + 1), (int)(p.getX() + dpto + 1), (int)(p.getY() - dpto - 1) ); |
315 |
} |
316 |
} |
317 |
|
318 |
/* (non-Javadoc)
|
319 |
* @see com.iver.cit.gvsig.fmap.layers.FLayer#print(java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort, com.iver.cit.gvsig.fmap.operations.Cancellable, double)
|
320 |
*/
|
321 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, |
322 |
double scale) throws DriverException { |
323 |
// TODO Auto-generated method stub
|
324 |
|
325 |
} |
326 |
|
327 |
/**
|
328 |
* Elimina los puntos de la lista que no tiene las dos coordenadas asignadas.
|
329 |
*/
|
330 |
public void clean(){ |
331 |
Iterator iter = pointList.iterator();
|
332 |
while (iter.hasNext()) {
|
333 |
GeoPoint gp = (GeoPoint) iter.next(); |
334 |
if(gp.mapPoint == null || gp.pixelPoint == null) |
335 |
iter.remove(); |
336 |
} |
337 |
} |
338 |
/**
|
339 |
* A?ade un punto a la lista
|
340 |
* @param point punto para la lista
|
341 |
*/
|
342 |
public GeoPoint addPoint(Point2D pixel, Point2D map){ |
343 |
GeoPoint p = new GeoPoint(pixel, map);
|
344 |
pointList.add(p); |
345 |
return p;
|
346 |
} |
347 |
|
348 |
/**
|
349 |
* Obtiene el punto de la posici?n pos
|
350 |
*/
|
351 |
public GeoPoint getPoint(int pos){ |
352 |
try{
|
353 |
return (GeoPoint)pointList.get(pos);
|
354 |
}catch(IndexOutOfBoundsException exc){ |
355 |
return null; |
356 |
} |
357 |
} |
358 |
|
359 |
/**
|
360 |
* Elimina la lista de puntos almacenada
|
361 |
*/
|
362 |
public void clear(){ |
363 |
pointList = new ArrayList(); |
364 |
} |
365 |
|
366 |
/**
|
367 |
* Elimina el punto de la posici?n indicada por el par?metro pos
|
368 |
* @param pos Posici?n del punto a eliminar
|
369 |
*/
|
370 |
public void remove(int pos){ |
371 |
pointList.remove(pos); |
372 |
} |
373 |
|
374 |
/**
|
375 |
*Elimina el ?ltimo punto de la lista.
|
376 |
*/
|
377 |
public void delLastPoint(){ |
378 |
pointList.remove(pointList.size() - 1);
|
379 |
} |
380 |
|
381 |
/**
|
382 |
* Funci?n que obtiene si un punto es nuevo o no. Un punto es nuevo si todavia
|
383 |
* no han sido asignadas todas sus coordenadas.
|
384 |
* @param n N?mero de punto a obtener si es nuevo
|
385 |
* @return true si es nuevo o false si no lo es
|
386 |
*/
|
387 |
public boolean isNewPoint(int n){ |
388 |
if(this.getPoint(n) == null) |
389 |
return false; |
390 |
if(this.getPoint(n).pixelPoint == null || this.getPoint(n).mapPoint == null) |
391 |
return true; |
392 |
return false; |
393 |
} |
394 |
|
395 |
/**
|
396 |
* Devuelve el n?mero de puntos de la capa
|
397 |
* @return entero que representa el n?mero de puntos de la capa
|
398 |
*/
|
399 |
public int length(){ |
400 |
return pointList.size();
|
401 |
} |
402 |
|
403 |
/**
|
404 |
* Actualiza un punto de la lista de una posici?n determinada
|
405 |
* @param point punto para la lista
|
406 |
*/
|
407 |
public void updatePoint(Point2D pixel, Point2D map, int pos){ |
408 |
GeoPoint gp = (GeoPoint)pointList.get(pos); |
409 |
if(pixel != null) |
410 |
gp.pixelPoint = pixel; |
411 |
if(map != null) |
412 |
gp.mapPoint = map; |
413 |
} |
414 |
|
415 |
/**
|
416 |
* Calcula el RMS para el punto de la posici?n pos
|
417 |
* @param pos Posici?n
|
418 |
* @return valor RMS para el punto solicitado
|
419 |
*/
|
420 |
public double calcDoubleRMS(int pos){ |
421 |
if(getPoint(pos).active && transformPointList != null && getPoint(pos).mapPoint != null){ |
422 |
try{
|
423 |
double a = (transformPointList[pos].getX() - getPoint(pos).mapPoint.getX());
|
424 |
double b = (transformPointList[pos].getY() - getPoint(pos).mapPoint.getY());
|
425 |
return Math.sqrt(a*a + b*b); |
426 |
}catch(ArrayIndexOutOfBoundsException e){ |
427 |
//No hacemos nada pq ha intentado obtener un punto que no existe. Hace un return 0
|
428 |
}catch(NullPointerException e){ |
429 |
//No hacemos nada pq el punto a?n no est? completo y est? intentando obtener un valor que no existe.Hace un return 0
|
430 |
} |
431 |
} |
432 |
return -0D; |
433 |
} |
434 |
|
435 |
/**
|
436 |
* Calcula el RMS para el punto de la posici?n pos
|
437 |
* @param pos Posici?n
|
438 |
* @return RMS en forma de String
|
439 |
*/
|
440 |
public String calcRMS(int pos){ |
441 |
return String.valueOf(calcDoubleRMS(pos)); |
442 |
} |
443 |
|
444 |
/**
|
445 |
* Calcula el residuo en X para el punto de la posici?n pos
|
446 |
* @param pos Posici?n
|
447 |
* @return residuo Y en forma de double
|
448 |
*/
|
449 |
public double calcDoubleResX(int pos){ |
450 |
if( getPoint(pos).active &&
|
451 |
transformPointList != null &&
|
452 |
transformPointList[pos] != null &&
|
453 |
getPoint(pos).mapPoint != null){
|
454 |
try{
|
455 |
double a = (transformPointList[pos].getX() - getPoint(pos).mapPoint.getX());
|
456 |
return Math.sqrt(a*a); |
457 |
}catch(ArrayIndexOutOfBoundsException e){ |
458 |
//No hacemos nada pq ha intentado obtener un punto que no existe. Hace un return 0
|
459 |
}catch(NullPointerException e){ |
460 |
//No hacemos nada pq el punto a?n no est? completo y est? intentando obtener un valor que no existe.Hace un return 0
|
461 |
} |
462 |
} |
463 |
return -0; |
464 |
} |
465 |
|
466 |
/**
|
467 |
* Calcula el residuo en X para el punto de la posici?n pos
|
468 |
* @param pos Posici?n
|
469 |
* @return residuo Y en forma de String
|
470 |
*/
|
471 |
public String calcResX(int pos){ |
472 |
return String.valueOf(calcDoubleResX(pos)); |
473 |
} |
474 |
|
475 |
/**
|
476 |
* Calcula el residuo en Y para el punto de la posici?n pos
|
477 |
* @param pos Posici?n
|
478 |
* @return residuo Y en forma de double
|
479 |
*/
|
480 |
public double calcDoubleResY(int pos){ |
481 |
if( getPoint(pos).active &&
|
482 |
transformPointList != null &&
|
483 |
transformPointList[pos] != null &&
|
484 |
getPoint(pos).mapPoint != null){
|
485 |
try{
|
486 |
double b = (transformPointList[pos].getY() - getPoint(pos).mapPoint.getY());
|
487 |
return Math.sqrt(b*b); |
488 |
}catch(ArrayIndexOutOfBoundsException e){ |
489 |
//No hacemos nada pq ha intentado obtener un punto que no existe. Hace un return 0
|
490 |
}catch(NullPointerException e){ |
491 |
//No hacemos nada pq el punto a?n no est? completo y est? intentando obtener un valor que no existe.Hace un return 0
|
492 |
} |
493 |
} |
494 |
return -0D; |
495 |
} |
496 |
|
497 |
/**
|
498 |
* Calcula el residuo en Y para el punto de la posici?n pos
|
499 |
* @param pos Posici?n
|
500 |
* @return residuo Y en forma de String
|
501 |
*/
|
502 |
public String calcResY(int pos){ |
503 |
return String.valueOf(calcDoubleResY(pos)); |
504 |
} |
505 |
|
506 |
/**
|
507 |
* Calcula el error RMS para todos los puntos
|
508 |
* @return Error RMS total en forma de String
|
509 |
*/
|
510 |
public double calcDoubleTotal(){ |
511 |
double add = 0D; |
512 |
int len = 0; |
513 |
try{
|
514 |
for(int i=0;i<transformPointList.length;i++){ |
515 |
add += calcDoubleRMS(i); |
516 |
if(getPoint(i).active)
|
517 |
len ++; |
518 |
} |
519 |
}catch(NullPointerException e){ |
520 |
//transformPointList es null por lo que no hay puntos a transformar devolviendo 0.
|
521 |
return 0D; |
522 |
} |
523 |
return Math.sqrt(add/len); |
524 |
} |
525 |
|
526 |
/**
|
527 |
* Calcula el error RMS para todos los puntos
|
528 |
* @return Error RMS total en forma de String
|
529 |
*/
|
530 |
public String calcTotal(){ |
531 |
return String.valueOf(calcDoubleTotal()); |
532 |
} |
533 |
|
534 |
/**
|
535 |
* Muestra en consola los puntos de la capa
|
536 |
*/
|
537 |
public void showPoints(){ |
538 |
for(int i=0;i<pointList.size();i++) |
539 |
((GeoPoint)pointList.get(i)).show(); |
540 |
} |
541 |
|
542 |
/**
|
543 |
* Salva la lista de puntos sobre el fichero que se la pasa por
|
544 |
* par?metro
|
545 |
* @param file Nombre del fichero
|
546 |
*/
|
547 |
public void PointList2XML(String file){; |
548 |
geoPointPersistence.savePointList(file); |
549 |
} |
550 |
|
551 |
/**
|
552 |
* Recupera una lista de puntos desde un fichero XML
|
553 |
* @param file Nombre del fichero
|
554 |
*/
|
555 |
public void XML2PointList(String file){ |
556 |
geoPointPersistence.loadPointList(file); |
557 |
} |
558 |
|
559 |
/**
|
560 |
* Salva la lista de puntos en forma tabular sobre el fichero que se la pasa por
|
561 |
* par?metro
|
562 |
* @param file Nombre del fichero
|
563 |
*/
|
564 |
public void PointList2CSV(String file){; |
565 |
geoPointPersistence.saveCSVPointList(file); |
566 |
} |
567 |
|
568 |
/**
|
569 |
* Recupera la lista de puntos desde un fichero CSV
|
570 |
* @param file Nombre del fichero
|
571 |
*/
|
572 |
public void PointListFromCSV(String file){; |
573 |
geoPointPersistence.loadCSVPointList(file); |
574 |
} |
575 |
|
576 |
/* (non-Javadoc)
|
577 |
* @see com.iver.cit.gvsig.fmap.layers.StatusRasterInterface#setXMLEntity(com.iver.utiles.XMLEntity)
|
578 |
*/
|
579 |
public void setXMLEntity(XMLEntity xml)throws XMLException { |
580 |
int nPoints = -1; |
581 |
if (xml.contains("raster.geoPoints.nPoints")) { |
582 |
nPoints = xml.getIntProperty("raster.geoPoints.nPoints");
|
583 |
GeoPoint point = null;
|
584 |
Point2D pixel = new Point2D.Double(), map = new Point2D.Double(); |
585 |
if(nPoints > 0){ |
586 |
|
587 |
for(int i = 0;i<nPoints;i++){ |
588 |
|
589 |
if (xml.contains("raster.geoPoint."+i+".pixelX") && xml.contains("raster.geoPoint."+i+".pixelY")) |
590 |
pixel.setLocation(xml.getDoubleProperty("raster.geoPoint."+i+".pixelX"), xml.getDoubleProperty("raster.geoPoint."+i+".pixelY")); |
591 |
|
592 |
if (xml.contains("raster.geoPoint."+i+".mapX") && xml.contains("raster.geoPoint."+i+".mapY")) |
593 |
map.setLocation(xml.getDoubleProperty("raster.geoPoint."+i+".mapX"), xml.getDoubleProperty("raster.geoPoint."+i+".mapY")); |
594 |
|
595 |
point = this.addPoint(pixel, map);
|
596 |
|
597 |
if (xml.contains("raster.geoPoint."+i+".active")) |
598 |
point.active = xml.getBooleanProperty("raster.geoPoint."+i+".active"); |
599 |
|
600 |
point.leftCenterPoint = new Point2D.Double(); |
601 |
if (xml.contains("raster.geoPoint."+i+".leftCenterX") && xml.contains("raster.geoPoint."+i+".leftCenterY")) |
602 |
point.leftCenterPoint.setLocation(xml.getDoubleProperty("raster.geoPoint."+i+".leftCenterX"), xml.getDoubleProperty("raster.geoPoint."+i+".leftCenterY")); |
603 |
|
604 |
point.rightCenterPoint = new Point2D.Double(); |
605 |
if (xml.contains("raster.geoPoint."+i+".rightCenterX") && xml.contains("raster.geoPoint."+i+".rightCenterY")) |
606 |
point.rightCenterPoint.setLocation(xml.getDoubleProperty("raster.geoPoint."+i+".rightCenterX"), xml.getDoubleProperty("raster.geoPoint."+i+".rightCenterY")); |
607 |
|
608 |
point.leftViewPort = new ViewPort(null); |
609 |
point.rightViewPort = new ViewPort(null); |
610 |
|
611 |
double x = 0D, y = 0D, w = 0D, h = 0D; |
612 |
int width = 0, height = 0; |
613 |
Rectangle2D r = new Rectangle2D.Double(); |
614 |
if (xml.contains("raster.geoPoint."+i+".leftViewPort.proj")) |
615 |
point.leftViewPort.setProjection(CRSFactory.getCRS(xml.getStringProperty("raster.geoPoint."+i+".leftViewPort.proj"))); |
616 |
if (xml.contains("raster.geoPoint."+i+".leftViewPort.x")) |
617 |
x = xml.getDoubleProperty("raster.geoPoint."+i+".leftViewPort.x"); |
618 |
if (xml.contains("raster.geoPoint."+i+".leftViewPort.y")) |
619 |
y = xml.getDoubleProperty("raster.geoPoint."+i+".leftViewPort.y"); |
620 |
if (xml.contains("raster.geoPoint."+i+".leftViewPort.w")) |
621 |
w = xml.getDoubleProperty("raster.geoPoint."+i+".leftViewPort.w"); |
622 |
if (xml.contains("raster.geoPoint."+i+".leftViewPort.h")) |
623 |
h = xml.getDoubleProperty("raster.geoPoint."+i+".leftViewPort.h"); |
624 |
r.setRect(x, y, w, h); |
625 |
point.leftViewPort.setExtent(r); |
626 |
if (xml.contains("raster.geoPoint."+i+".leftViewPort.imgWidth")) |
627 |
width = xml.getIntProperty("raster.geoPoint."+i+".leftViewPort.imgWidth"); |
628 |
if (xml.contains("raster.geoPoint."+i+".leftViewPort.imgHeight")) |
629 |
height = xml.getIntProperty("raster.geoPoint."+i+".leftViewPort.imgHeight"); |
630 |
point.leftViewPort.setImageSize(new Dimension(width, height)); |
631 |
|
632 |
r = new Rectangle2D.Double(); |
633 |
if (xml.contains("raster.geoPoint."+i+".rightViewPort.proj")) |
634 |
point.rightViewPort.setProjection(CRSFactory.getCRS(xml.getStringProperty("raster.geoPoint."+i+".rightViewPort.proj"))); |
635 |
if (xml.contains("raster.geoPoint."+i+".rightViewPort.x")) |
636 |
x = xml.getDoubleProperty("raster.geoPoint."+i+".rightViewPort.x"); |
637 |
if (xml.contains("raster.geoPoint."+i+".rightViewPort.y")) |
638 |
y = xml.getDoubleProperty("raster.geoPoint."+i+".rightViewPort.y"); |
639 |
if (xml.contains("raster.geoPoint."+i+".rightViewPort.w")) |
640 |
w = xml.getDoubleProperty("raster.geoPoint."+i+".rightViewPort.w"); |
641 |
if (xml.contains("raster.geoPoint."+i+".rightViewPort.h")) |
642 |
h = xml.getDoubleProperty("raster.geoPoint."+i+".rightViewPort.h"); |
643 |
r.setRect(x, y, w, h); |
644 |
point.rightViewPort.setExtent(r); |
645 |
if (xml.contains("raster.geoPoint."+i+".rightViewPort.imgWidth")) |
646 |
width = xml.getIntProperty("raster.geoPoint."+i+".rightViewPort.imgWidth"); |
647 |
if (xml.contains("raster.geoPoint."+i+".rightViewPort.imgHeight")) |
648 |
height = xml.getIntProperty("raster.geoPoint."+i+".rightViewPort.imgHeight"); |
649 |
point.rightViewPort.setImageSize(new Dimension(width, height)); |
650 |
|
651 |
} |
652 |
} |
653 |
} |
654 |
} |
655 |
|
656 |
/* (non-Javadoc)
|
657 |
* @see com.iver.cit.gvsig.fmap.layers.StatusRasterInterface#getXMLEntity(com.iver.utiles.XMLEntity)
|
658 |
*/
|
659 |
public void getXMLEntity(XMLEntity xml) throws XMLException { |
660 |
xml.putProperty("raster.geoPoints.nPoints", getCountPoints());
|
661 |
for(int i=0;i<this.getCountPoints();i++){ |
662 |
xml.putProperty("raster.geoPoint."+i+".pixelX", getPoint(i).pixelPoint.getX()); |
663 |
xml.putProperty("raster.geoPoint."+i+".pixelY", getPoint(i).pixelPoint.getY()); |
664 |
xml.putProperty("raster.geoPoint."+i+".mapX", getPoint(i).mapPoint.getX()); |
665 |
xml.putProperty("raster.geoPoint."+i+".mapY", getPoint(i).mapPoint.getX()); |
666 |
|
667 |
xml.putProperty("raster.geoPoint."+i+".active", getPoint(i).active); |
668 |
|
669 |
xml.putProperty("raster.geoPoint."+i+".leftCenterX", getPoint(i).leftCenterPoint.getX()); |
670 |
xml.putProperty("raster.geoPoint."+i+".leftCenterY", getPoint(i).leftCenterPoint.getY()); |
671 |
xml.putProperty("raster.geoPoint."+i+".rightCenterX", getPoint(i).rightCenterPoint.getX()); |
672 |
xml.putProperty("raster.geoPoint."+i+".rightCenterY", getPoint(i).rightCenterPoint.getY()); |
673 |
|
674 |
xml.putProperty("raster.geoPoint."+i+".leftViewPort.proj", getPoint(i).leftViewPort.getProjection().getAbrev()); |
675 |
xml.putProperty("raster.geoPoint."+i+".leftViewPort.x", getPoint(i).leftViewPort.getExtent().getX()); |
676 |
xml.putProperty("raster.geoPoint."+i+".leftViewPort.y", getPoint(i).leftViewPort.getExtent().getY()); |
677 |
xml.putProperty("raster.geoPoint."+i+".leftViewPort.w", getPoint(i).leftViewPort.getExtent().getWidth()); |
678 |
xml.putProperty("raster.geoPoint."+i+".leftViewPort.h", getPoint(i).leftViewPort.getExtent().getHeight()); |
679 |
xml.putProperty("raster.geoPoint."+i+".leftViewPort.imgWidth", getPoint(i).leftViewPort.getImageWidth()); |
680 |
xml.putProperty("raster.geoPoint."+i+".leftViewPort.imgHeight", getPoint(i).leftViewPort.getImageHeight()); |
681 |
|
682 |
xml.putProperty("raster.geoPoint."+i+".rightViewPort.proj", getPoint(i).rightViewPort.getProjection().getAbrev()); |
683 |
xml.putProperty("raster.geoPoint."+i+".rightViewPort.x", getPoint(i).rightViewPort.getExtent().getX()); |
684 |
xml.putProperty("raster.geoPoint."+i+".rightViewPort.y", getPoint(i).rightViewPort.getExtent().getY()); |
685 |
xml.putProperty("raster.geoPoint."+i+".rightViewPort.w", getPoint(i).rightViewPort.getExtent().getWidth()); |
686 |
xml.putProperty("raster.geoPoint."+i+".rightViewPort.h", getPoint(i).rightViewPort.getExtent().getHeight()); |
687 |
xml.putProperty("raster.geoPoint."+i+".rightViewPort.imgWidth", getPoint(i).rightViewPort.getImageWidth()); |
688 |
xml.putProperty("raster.geoPoint."+i+".rightViewPort.imgHeight", getPoint(i).rightViewPort.getImageHeight()); |
689 |
} |
690 |
} |
691 |
//**********************End Methods********************************
|
692 |
|
693 |
//**********************Setters & Getters**************************
|
694 |
/**
|
695 |
* Asigna el viewPort de la mini imagen de la derecha en
|
696 |
* el punto de la posici?n que se le pasa por par?metro
|
697 |
* @param pos Posici?n del punto
|
698 |
* @param vp ViewPort asignado
|
699 |
*/
|
700 |
public void setRightViewPort(int pos, ViewPort vp){ |
701 |
getPoint(pos).rightViewPort = vp; |
702 |
} |
703 |
/**
|
704 |
* @return Returns the showNumber.
|
705 |
*/
|
706 |
public boolean isShowNumber() { |
707 |
return showNumber;
|
708 |
} |
709 |
|
710 |
/**
|
711 |
* @param showNumber The showNumber to set.
|
712 |
*/
|
713 |
public void setShowNumber(boolean showNumber) { |
714 |
this.showNumber = showNumber;
|
715 |
} |
716 |
|
717 |
/**
|
718 |
* Asigna el punto central de la mini imagen de la izquierda
|
719 |
* en el punto de la posici?n que se le pasa por par?metro
|
720 |
* @param pos Posici?n del punto
|
721 |
* @param p Punto asignado
|
722 |
*/
|
723 |
public void setLeftCenterPoint(int pos, Point2D p){ |
724 |
try{
|
725 |
getPoint(pos).leftCenterPoint = p; |
726 |
}catch(NullPointerException ex){ |
727 |
//Si getPoint devuelve null es que hemos intentado acceder a una posici?n que no
|
728 |
//existe por lo que no asignamos ningun valor.
|
729 |
} |
730 |
} |
731 |
|
732 |
/**
|
733 |
* Asigna el punto central de la mini imagen de la derecha
|
734 |
* en el punto de la posici?n que se le pasa por par?metro
|
735 |
* @param pos Posici?n del punto
|
736 |
* @param p Punto asignado
|
737 |
*/
|
738 |
public void setRightCenterPoint(int pos, Point2D p){ |
739 |
try{
|
740 |
getPoint(pos).rightCenterPoint = p; |
741 |
}catch(NullPointerException ex){ |
742 |
//Si getPoint devuelve null es que hemos intentado acceder a una posici?n que no
|
743 |
//existe por lo que no asignamos ningun valor.
|
744 |
} |
745 |
} |
746 |
|
747 |
/**
|
748 |
* Asigna el viewPort de la mini imagen de la izquierda en
|
749 |
* el punto de la posici?n que se le pasa por par?metro
|
750 |
* @param pos Posici?n del punto
|
751 |
* @param vp ViewPort asignado
|
752 |
*/
|
753 |
public void setLeftViewPort(int pos, ViewPort vp){ |
754 |
try{
|
755 |
getPoint(pos).leftViewPort = vp; |
756 |
}catch(NullPointerException ex){ |
757 |
//Si getPoint devuelve null es que hemos intentado acceder a una posici?n que no
|
758 |
//existe por lo que no asignamos ningun valor.
|
759 |
} |
760 |
} |
761 |
|
762 |
/**
|
763 |
* Asigna el zoom al punto de una posici?n. Este zoom es el que corresponde
|
764 |
* a la miniimagen de la izquierda, es decir la que tiene las coordenadas en pixeles.
|
765 |
* @param pos Posici?n del punto a asignar el zoom
|
766 |
* @param zoom Zoom a asignar.
|
767 |
*/
|
768 |
public void setZoomLeft(int pos, double zoom){ |
769 |
try{
|
770 |
getPoint(pos).zoomLeft = zoom; |
771 |
}catch(NullPointerException ex){ |
772 |
//Si getPoint devuelve null es que hemos intentado acceder a una posici?n que no
|
773 |
//existe por lo que no asignamos ningun valor.
|
774 |
} |
775 |
} |
776 |
|
777 |
/**
|
778 |
* Asigna el zoom al punto de una posici?n. Este zoom es el que corresponde
|
779 |
* a la miniimagen de la derecha, es decir la que tiene las coordenadas relativas
|
780 |
* al mundo real.
|
781 |
* @param pos Posici?n del punto a asignar el zoom
|
782 |
* @param zoom Zoom a asignar.
|
783 |
*/
|
784 |
public void setZoomRight(int pos, double zoom){ |
785 |
try{
|
786 |
getPoint(pos).zoomRight = zoom; |
787 |
}catch(NullPointerException ex){ |
788 |
//Si getPoint devuelve null es que hemos intentado acceder a una posici?n que no
|
789 |
//existe por lo que no asignamos ningun valor.
|
790 |
} |
791 |
} |
792 |
|
793 |
/**
|
794 |
* Obtiene el zoom de un punto y posici?n. Este zoom es el que corresponde
|
795 |
* a la miniimagen de la izquierda, es decir la que tiene las coordenadas en pixeles.
|
796 |
* @param pos Posici?n del punto a asignar el zoom
|
797 |
* @return Zoom a asignado.
|
798 |
*/
|
799 |
public double getZoomLeft(int pos){ |
800 |
try{
|
801 |
return getPoint(pos).zoomLeft;
|
802 |
}catch(NullPointerException ex){ |
803 |
//Si getPoint devuelve null es que hemos intentado acceder a una posici?n que no
|
804 |
//existe por lo que devolvemos un zoom de 1.0.
|
805 |
return 1.0; |
806 |
} |
807 |
} |
808 |
|
809 |
/**
|
810 |
* Obtiene el zoom de un punto y posici?n. Este zoom es el que corresponde
|
811 |
* a la miniimagen de la derecha, es decir la que tiene las coordenadas relativas
|
812 |
* al mundo real.
|
813 |
* @param pos Posici?n del punto a asignar el zoom
|
814 |
* @return Zoom a asignado.
|
815 |
*/
|
816 |
public double getZoomRight(int pos){ |
817 |
try{
|
818 |
return getPoint(pos).zoomRight;
|
819 |
}catch(NullPointerException ex){ |
820 |
//Si getPoint devuelve null es que hemos intentado acceder a una posici?n que no
|
821 |
//existe por lo que devolvemos un zoom de 1.0.
|
822 |
return 1.0; |
823 |
} |
824 |
} |
825 |
|
826 |
/**
|
827 |
* Devuelve el n?mero de puntos de la lista
|
828 |
* @return entero que representa el n?mero de puntos
|
829 |
*/
|
830 |
public int getCountPoints(){ |
831 |
if(pointList != null) |
832 |
return pointList.size();
|
833 |
else
|
834 |
return 0; |
835 |
} |
836 |
|
837 |
/**
|
838 |
* Devuelve el n?mero de puntos de la lista que est?n activos
|
839 |
* @return entero que representa el n?mero de puntos
|
840 |
*/
|
841 |
public int getCountActivePoints(){ |
842 |
int activePoints = 0; |
843 |
if(pointList != null){ |
844 |
for(int i = 0; i< pointList.size(); i++) |
845 |
if(getPoint(i).active)
|
846 |
activePoints ++; |
847 |
return activePoints;
|
848 |
}else
|
849 |
return 0; |
850 |
} |
851 |
|
852 |
/**
|
853 |
* Activa o desactiva el punto de una posici?n de la lista
|
854 |
* @param n N?mero de punto
|
855 |
* @param active true activo, false desactivo
|
856 |
*/
|
857 |
public void setPointActive(int n, boolean active){ |
858 |
if(n < 0 || n >= this.length()) |
859 |
return;
|
860 |
((GeoPoint)pointList.get(n)).active = active; |
861 |
} |
862 |
|
863 |
/**
|
864 |
* Dice si un punto de la lista est? activo o no
|
865 |
* @param n Posici?n del punto
|
866 |
* @return true si est? activo y false si no lo est?.
|
867 |
*/
|
868 |
public boolean isPointActive(int n){ |
869 |
if(n < 0 || n >= this.length()) |
870 |
return false; |
871 |
return ((GeoPoint)pointList.get(n)).active;
|
872 |
} |
873 |
|
874 |
/**
|
875 |
* Obtiene el extent de la capa
|
876 |
* @return extent en Rectangle2D.
|
877 |
*/
|
878 |
public Rectangle2D getFullExtent()throws DriverException { |
879 |
View theView = (View) PluginServices.getMDIManager().getActiveWindow(); |
880 |
return theView.getMapControl().getMapContext().getViewPort().getExtent();
|
881 |
} |
882 |
|
883 |
/**
|
884 |
* @return Returns the lastTool.
|
885 |
*/
|
886 |
public String getLastTool() { |
887 |
return lastTool;
|
888 |
} |
889 |
|
890 |
/**
|
891 |
* @param lastTool The lastTool to set.
|
892 |
*/
|
893 |
public void setLastTool(String lastTool) { |
894 |
this.lastTool = lastTool;
|
895 |
} |
896 |
|
897 |
/**
|
898 |
*Asigna el extent para las mini imagenes. Estas deben ser recuperadas cuando se selecciona
|
899 |
*un punto
|
900 |
*/
|
901 |
public void setMiniExtent(int nPoint, Point2D centerPoint, ViewPort vp, boolean isRight){ |
902 |
ViewPort viewPortBlock = new ViewPort(vp.getProjection());
|
903 |
viewPortBlock.setExtent(vp.getExtent()); |
904 |
viewPortBlock.setImageSize(vp.getImageSize()); |
905 |
viewPortBlock.refreshExtent(); |
906 |
|
907 |
if(isRight){
|
908 |
((GeoPoint)pointList.get(nPoint)).rightCenterPoint = (Point2D)centerPoint.clone();
|
909 |
((GeoPoint)pointList.get(nPoint)).rightViewPort = viewPortBlock; |
910 |
}else{
|
911 |
((GeoPoint)pointList.get(nPoint)).leftCenterPoint = (Point2D)centerPoint;
|
912 |
((GeoPoint)pointList.get(nPoint)).leftViewPort = viewPortBlock; |
913 |
} |
914 |
} |
915 |
|
916 |
/**
|
917 |
* Obtiene el extent de la mini imagen
|
918 |
* @param nPoint Punto de la lista
|
919 |
* @return
|
920 |
*/
|
921 |
public ViewPort getMiniExtent(int nPoint, boolean isRight){ |
922 |
if(isRight)
|
923 |
return ((GeoPoint)pointList.get(nPoint)).rightViewPort;
|
924 |
else
|
925 |
return ((GeoPoint)pointList.get(nPoint)).leftViewPort;
|
926 |
} |
927 |
|
928 |
/**
|
929 |
* Obtiene el punto central de la mini imagen
|
930 |
* @param nPoint Punto de la lista
|
931 |
* @return
|
932 |
*/
|
933 |
public Point2D getCenterPoint(int nPoint, boolean isRight){ |
934 |
if(isRight)
|
935 |
return ((GeoPoint)pointList.get(nPoint)).rightCenterPoint;
|
936 |
else
|
937 |
return ((GeoPoint)pointList.get(nPoint)).leftCenterPoint;
|
938 |
} |
939 |
|
940 |
/**
|
941 |
* Obtiene le ?ltimo punto de la lista
|
942 |
* @return El ?ltimo punto georreferenciado de la lista
|
943 |
*/
|
944 |
public GeoPoint getLastPoint(){
|
945 |
return (GeoPoint)pointList.get(pointList.size());
|
946 |
} |
947 |
|
948 |
/**
|
949 |
* Obtiene el array de puntos
|
950 |
* @return
|
951 |
*/
|
952 |
public ArrayList getListPoint(){ |
953 |
return pointList;
|
954 |
} |
955 |
|
956 |
/**
|
957 |
* Obtiene el gestor de puntos
|
958 |
* @return PointManager
|
959 |
*/
|
960 |
public PointManager getPointManager() {
|
961 |
return pointManager;
|
962 |
} |
963 |
|
964 |
/**
|
965 |
* Asigna el gestor de puntos
|
966 |
* @param PointManager
|
967 |
*/
|
968 |
public void setPointManager(PointManager pointManager) { |
969 |
this.pointManager = pointManager;
|
970 |
} |
971 |
|
972 |
/**
|
973 |
* Obtiene la capa de la imagen a georreferenciar
|
974 |
* @return FLyrGeoRaster
|
975 |
*/
|
976 |
public FLyrGeoRaster getLyrGeoRaster() {
|
977 |
return lyrGeoRaster;
|
978 |
} |
979 |
|
980 |
/**
|
981 |
* Asigna la capa de la imagen a georreferenciar
|
982 |
* @param flyGeoRaster
|
983 |
*/
|
984 |
public void setLyrGeoRaster(FLyrGeoRaster lyGeoRaster){ |
985 |
this.lyrGeoRaster = lyGeoRaster;
|
986 |
if(geoPointPersistence == null) |
987 |
geoPointPersistence = new GeoPointPersistence(this); |
988 |
} |
989 |
|
990 |
/**
|
991 |
* Asigna el flag de visibilidad a true o false. Si est? a true la capa
|
992 |
* es visible normalmente y si est? a false no se mostrar?
|
993 |
* @param visible flag de visibilidad
|
994 |
*/
|
995 |
public void setVisible(boolean visible){ |
996 |
this.lyrVisible = visible;
|
997 |
} |
998 |
|
999 |
/**
|
1000 |
* Obtiene el flag de visibilidad true o false. Si est? a true la capa
|
1001 |
* es visible normalmente y si est? a false no se muestra
|
1002 |
* @return flag de visibilidad
|
1003 |
*/
|
1004 |
public boolean isVisible(){ |
1005 |
return this.lyrVisible; |
1006 |
} |
1007 |
|
1008 |
/**
|
1009 |
* Asigna el flag de visibilidad a true o false. Si est? a true la capa
|
1010 |
* es visible normalmente y si est? a false no se mostrar?. Este flag solo
|
1011 |
* afecta a la vista de gvSIG. Las mini-imagenes seguiran mostrandose.
|
1012 |
* @param visible flag de visibilidad
|
1013 |
*/
|
1014 |
public void setHideViewOnly(boolean hideViewOnly){ |
1015 |
lyrHideViewOnly = hideViewOnly; |
1016 |
} |
1017 |
|
1018 |
/**
|
1019 |
* Obtiene el flag de visibilidad true o false. Si est? a true la capa
|
1020 |
* es visible normalmente y si est? a false no se muestra. Este flag solo
|
1021 |
* afecta a la vista de gvSIG. Las mini-imagenes seguiran mostrandose.
|
1022 |
* @return flag de visibilidad
|
1023 |
*/
|
1024 |
public boolean isHideViewOnly(){ |
1025 |
return lyrHideViewOnly;
|
1026 |
} |
1027 |
|
1028 |
/**
|
1029 |
* Obtiene la lista de puntos transformados. La lista de puntos transformada es la lista de puntos
|
1030 |
* a la que se le ha aplicado la transformaci?n af?n en base a las muestras tomadas.
|
1031 |
* Esta lista de puntos transformados hay que mantenerla actualizada cada vez que se hace un
|
1032 |
* update de un punto ya se usa para calcular los errores.
|
1033 |
* @return Lista de puntos transformada.
|
1034 |
*/
|
1035 |
public Point2D[] getTransformPointList() { |
1036 |
return transformPointList;
|
1037 |
} |
1038 |
|
1039 |
/**
|
1040 |
* Asigna la lista de puntos transformada. La lista de puntos transformada es la lista de puntos
|
1041 |
* a la que se le ha aplicado la transformaci?n af?n en base a las muestras tomadas.
|
1042 |
* Esta lista de puntos transformados hay que mantenerla actualizada cada vez que se hace un
|
1043 |
* update de un punto ya se usa para calcular los errores.
|
1044 |
* @param transformPointList Lista de puntos transformada.
|
1045 |
*/
|
1046 |
public void setTransformPointList(Point2D[] transformPointList) { |
1047 |
this.transformPointList = transformPointList;
|
1048 |
} |
1049 |
|
1050 |
/**
|
1051 |
* Asigna el objeto que gestiona la persistencia
|
1052 |
*/
|
1053 |
public void setPersistence(IPersistence geoPointPersistence) { |
1054 |
if(this.geoPointPersistence == null) |
1055 |
this.geoPointPersistence = geoPointPersistence;
|
1056 |
} |
1057 |
|
1058 |
/**
|
1059 |
* Obtiene el valor del flag que dice si se dibuja la cruz azul
|
1060 |
* @return
|
1061 |
*/
|
1062 |
public boolean isWithoutBlue() { |
1063 |
return withoutBlue;
|
1064 |
} |
1065 |
|
1066 |
/**
|
1067 |
* Asigna valor al flag que dice si se dibuja la cruz azul. Ser? true si no queremos
|
1068 |
* dibujarla y false si queremos.
|
1069 |
* @param withoutBlue
|
1070 |
*/
|
1071 |
public void setWithoutBlue(boolean withoutBlue) { |
1072 |
this.withoutBlue = withoutBlue;
|
1073 |
} |
1074 |
|
1075 |
/**
|
1076 |
* Obtiene el valor del flag que dice si se dibuja la cruz roja
|
1077 |
* @return
|
1078 |
*/
|
1079 |
public boolean isWithoutRed() { |
1080 |
return withoutRed;
|
1081 |
} |
1082 |
|
1083 |
/**
|
1084 |
* Asigna valor al flag que dice si se dibuja la cruz roja. Ser? true si no queremos
|
1085 |
* dibujarla y false si queremos.
|
1086 |
* @param withoutRed
|
1087 |
*/
|
1088 |
public void setWithoutRed(boolean withoutRed) { |
1089 |
this.withoutRed = withoutRed;
|
1090 |
} |
1091 |
//**********************End Setters & Getters*********************
|
1092 |
} |