Revision 42283 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/circle/AbstractCircle.java
AbstractCircle.java | ||
---|---|---|
31 | 31 |
import org.gvsig.fmap.geom.Geometry; |
32 | 32 |
import org.gvsig.fmap.geom.handler.Handler; |
33 | 33 |
import org.gvsig.fmap.geom.jts.gputils.DefaultGeneralPathX; |
34 |
import org.gvsig.fmap.geom.jts.primitive.point.Point2D; |
|
34 | 35 |
import org.gvsig.fmap.geom.jts.primitive.point.PointJTS; |
35 | 36 |
import org.gvsig.fmap.geom.jts.primitive.surface.AbstractSurface; |
36 | 37 |
import org.gvsig.fmap.geom.jts.util.UtilFunctions; |
... | ... | |
40 | 41 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
41 | 42 |
import org.gvsig.fmap.geom.primitive.Line; |
42 | 43 |
import org.gvsig.fmap.geom.primitive.Point; |
44 |
import org.gvsig.fmap.geom.primitive.Polygon; |
|
43 | 45 |
import org.gvsig.fmap.geom.primitive.Ring; |
46 |
import org.gvsig.tools.exception.BaseException; |
|
44 | 47 |
|
45 | 48 |
|
46 | 49 |
/** |
... | ... | |
369 | 372 |
} |
370 | 373 |
|
371 | 374 |
/* (non-Javadoc) |
375 |
* @see org.gvsig.fmap.geom.primitive.Surface#addInteriorRing(org.gvsig.fmap.geom.primitive.Polygon) |
|
376 |
*/ |
|
377 |
public void addInteriorRing(Polygon polygon) { |
|
378 |
String message = "Calling unsupported method addInteriorRing of a circle"; |
|
379 |
notifyDeprecated(message); |
|
380 |
throw new UnsupportedOperationException(message); |
|
381 |
} |
|
382 |
/* (non-Javadoc) |
|
372 | 383 |
* @see org.gvsig.fmap.geom.primitive.Surface#removeInteriorRing(int) |
373 | 384 |
*/ |
374 | 385 |
public void removeInteriorRing(int index) { |
... | ... | |
381 | 392 |
* @see org.gvsig.fmap.geom.Geometry#reProject(org.cresques.cts.ICoordTrans) |
382 | 393 |
*/ |
383 | 394 |
public void reProject(ICoordTrans ct) { |
384 |
String message = "Calling deprecated method reProject of a circle"; |
|
385 |
notifyDeprecated(message); |
|
386 |
throw new UnsupportedOperationException(message); |
|
395 |
//FIXME: Esto solo ser?a correcto para transformaciones de traslaci?n, rotaci?n y escala |
|
396 |
// Ser?a incorrecto para las de deformaci?n en cizallamiento |
|
397 |
|
|
398 |
Point2D aux = new Point2D(center.getX(), center.getY()-radious); |
|
399 |
center.reProject(ct); |
|
400 |
aux.reProject(ct); |
|
401 |
try { |
|
402 |
radious = center.distance(aux); |
|
403 |
} catch (BaseException e) { |
|
404 |
throw new UnsupportedOperationException("Error calculating the radius of the transformed circle.", e); |
|
405 |
} |
|
387 | 406 |
} |
388 | 407 |
|
389 | 408 |
/* (non-Javadoc) |
390 | 409 |
* @see org.gvsig.fmap.geom.Geometry#transform(java.awt.geom.AffineTransform) |
391 | 410 |
*/ |
392 | 411 |
public void transform(AffineTransform at) { |
393 |
String message = "Calling deprecated method transform of a circle"; |
|
394 |
notifyDeprecated(message); |
|
395 |
throw new UnsupportedOperationException(message); |
|
412 |
//FIXME: Esto solo ser?a correcto para transformaciones de traslaci?n, rotaci?n y escala |
|
413 |
// Ser?a incorrecto para las de deformaci?n en cizallamiento |
|
414 |
|
|
415 |
Point2D aux = new Point2D(center.getX(), center.getY()-radious); |
|
416 |
center.transform(at); |
|
417 |
aux.transform(at); |
|
418 |
try { |
|
419 |
radious = center.distance(aux); |
|
420 |
} catch (BaseException e) { |
|
421 |
throw new UnsupportedOperationException("Error calculating the radius of the transformed circle.", e); |
|
422 |
} |
|
423 |
|
|
396 | 424 |
} |
397 | 425 |
|
398 | 426 |
/* (non-Javadoc) |
Also available in: Unified diff