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/ellipticarc/AbstractEllipticArc.java
AbstractEllipticArc.java | ||
---|---|---|
27 | 27 |
import java.awt.geom.Arc2D; |
28 | 28 |
import java.awt.geom.PathIterator; |
29 | 29 |
|
30 |
import org.cresques.cts.CoordTransRuntimeException; |
|
30 | 31 |
import org.cresques.cts.ICoordTrans; |
31 | 32 |
|
32 | 33 |
import org.gvsig.fmap.geom.Geometry; |
... | ... | |
55 | 56 |
*/ |
56 | 57 |
public abstract class AbstractEllipticArc extends AbstractSurface { |
57 | 58 |
|
59 |
/** |
|
60 |
* |
|
61 |
*/ |
|
62 |
private static final long serialVersionUID = 6163269454714321454L; |
|
58 | 63 |
protected Point axis1Start; |
59 | 64 |
protected Point axis1End; |
60 | 65 |
protected double semiAxis2Length; |
... | ... | |
260 | 265 |
// Ser?a incorrecto para las de deformaci?n en cizallamiento |
261 | 266 |
|
262 | 267 |
Point2D aux = new Point2D(JTSUtils.getPointAtYAxisInEllipse(axis1Start, axis1End, semiAxis2Length)); |
268 |
try { |
|
263 | 269 |
axis1Start.reProject(ct); |
264 | 270 |
axis1End.reProject(ct); |
265 | 271 |
aux.reProject(ct); |
272 |
} catch (CoordTransRuntimeException e) { |
|
273 |
//Si ha fallado la reproyecci?n de alguno de los puntos, ponemos todas las coordenadas a 0 |
|
274 |
axis1Start.setX(0); |
|
275 |
axis1Start.setY(0); |
|
276 |
axis1End.setX(0); |
|
277 |
axis1End.setY(0); |
|
278 |
semiAxis2Length = 0; |
|
279 |
} |
|
266 | 280 |
try { |
267 | 281 |
Point2D transformedMiddlePoint = new Point2D(JTSUtils.getMidPoint(axis1Start, axis1End)); |
268 | 282 |
semiAxis2Length = transformedMiddlePoint.distance(aux); |
Also available in: Unified diff