Revision 42464 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.jts/src/main/java/org/gvsig/fmap/geom/jts/primitive/surface/ellipse/AbstractEllipse.java
AbstractEllipse.java | ||
---|---|---|
26 | 26 |
import java.awt.geom.AffineTransform; |
27 | 27 |
import java.awt.geom.PathIterator; |
28 | 28 |
|
29 |
import org.cresques.cts.CoordTransRuntimeException; |
|
29 | 30 |
import org.cresques.cts.ICoordTrans; |
30 | 31 |
|
31 | 32 |
import org.gvsig.fmap.geom.Geometry; |
... | ... | |
257 | 258 |
* @see org.gvsig.fmap.geom.Geometry#reProject(org.cresques.cts.ICoordTrans) |
258 | 259 |
*/ |
259 | 260 |
public void reProject(ICoordTrans ct) { |
260 |
//FIXME: Esto solo ser?a correcto para transformaciones de traslaci?n, rotaci?n y escala |
|
261 |
// FIXME: Esto solo ser?a correcto para transformaciones de traslaci?n, |
|
262 |
// rotaci?n y escala |
|
261 | 263 |
// Ser?a incorrecto para las de deformaci?n en cizallamiento |
262 | 264 |
|
263 | 265 |
Point2D aux = new Point2D(JTSUtils.getPointAtYAxisInEllipse(init, end, ydist)); |
264 |
init.reProject(ct); |
|
265 |
end.reProject(ct); |
|
266 |
aux.reProject(ct); |
|
267 | 266 |
try { |
267 |
init.reProject(ct); |
|
268 |
end.reProject(ct); |
|
269 |
aux.reProject(ct); |
|
270 |
} catch (CoordTransRuntimeException e) { |
|
271 |
//Si no se ha podido reproyectar alguno de los puntos, les asignamos 0 a todas las coordenadas |
|
272 |
init.setX(0); |
|
273 |
init.setY(0); |
|
274 |
end.setX(0); |
|
275 |
end.setY(0); |
|
276 |
ydist = 0; |
|
277 |
} |
|
278 |
try { |
|
268 | 279 |
Point2D transformedMiddlePoint = new Point2D(JTSUtils.getMidPoint(init, end)); |
269 | 280 |
ydist = transformedMiddlePoint.distance(aux); |
270 | 281 |
} catch (BaseException e) { |
Also available in: Unified diff