Revision 42385 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/Ellipse2DZ.java
Ellipse2DZ.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.fmap.geom.jts.primitive.surface.ellipse; |
24 | 24 |
|
25 |
import java.awt.geom.AffineTransform; |
|
26 |
|
|
25 | 27 |
import org.gvsig.fmap.geom.Geometry; |
28 |
import org.gvsig.fmap.geom.jts.primitive.point.Point3D; |
|
26 | 29 |
import org.gvsig.fmap.geom.jts.util.ArrayListCoordinateSequence; |
27 | 30 |
import org.gvsig.fmap.geom.jts.util.JTSUtils; |
31 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
|
32 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
|
28 | 33 |
import org.gvsig.fmap.geom.primitive.Ellipse; |
29 | 34 |
import org.gvsig.fmap.geom.primitive.Point; |
30 | 35 |
|
... | ... | |
64 | 69 |
ArrayListCoordinateSequence coordinates = getJTSCoordinates(); |
65 | 70 |
return JTSUtils.createJTSPolygon(coordinates); |
66 | 71 |
} |
72 |
|
|
73 |
|
|
74 |
/* (non-Javadoc) |
|
75 |
* @see org.gvsig.fmap.geom.primitive.Ellipse#getRectangleCorner() |
|
76 |
*/ |
|
77 |
public Point getRectangleCorner() { |
|
78 |
return new Point3D( |
|
79 |
this.getAxis1Start().getX(), |
|
80 |
this.getAxis1Start().getY()-this.getAxis2Dist(), |
|
81 |
((Point3D)this.getAxis1Start()).getZ()); |
|
82 |
} |
|
83 |
|
|
84 |
|
|
85 |
/* (non-Javadoc) |
|
86 |
* @see org.gvsig.fmap.geom.primitive.Ellipse#getRectangleHeight() |
|
87 |
*/ |
|
88 |
public double getRectangleHeight() { |
|
89 |
return this.getAxis2Dist()*2; |
|
90 |
} |
|
91 |
|
|
92 |
|
|
93 |
/* (non-Javadoc) |
|
94 |
* @see org.gvsig.fmap.geom.primitive.Ellipse#getRectangleWidth() |
|
95 |
*/ |
|
96 |
public double getRectangleWidth() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
97 |
return this.getAxis1Start().distance(this.getAxis1End()); |
|
98 |
} |
|
99 |
|
|
100 |
|
|
101 |
/* (non-Javadoc) |
|
102 |
* @see org.gvsig.fmap.geom.primitive.Ellipse#getRectangleRotation() |
|
103 |
*/ |
|
104 |
public AffineTransform getRectangleRotation() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
105 |
return AffineTransform.getRotateInstance(getAxis1Angle(), this.getAxis1Start().getX(), this.getAxis1Start().getY()); |
|
106 |
} |
|
67 | 107 |
} |
Also available in: Unified diff