svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.impl / src / main / java / org / gvsig / fmap / geom / primitive / impl / Ellipse2DZ.java @ 40435
History | View | Annotate | Download (1.39 KB)
1 |
/**
|
---|---|
2 |
*
|
3 |
*/
|
4 |
package org.gvsig.fmap.geom.primitive.impl; |
5 |
|
6 |
import java.awt.geom.Point2D; |
7 |
|
8 |
import org.cresques.cts.IProjection; |
9 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
10 |
import org.gvsig.fmap.geom.primitive.Surface; |
11 |
import org.gvsig.fmap.geom.type.GeometryType; |
12 |
|
13 |
/**
|
14 |
* @author paco
|
15 |
*
|
16 |
*/
|
17 |
public class Ellipse2DZ extends Ellipse2D implements Surface { |
18 |
private static final long serialVersionUID = -6678908069111004754L; |
19 |
|
20 |
/**
|
21 |
* The constructor with the GeometryType like and argument
|
22 |
* is used by the {@link GeometryType}{@link #create()}
|
23 |
* to create the geometry
|
24 |
* @param type
|
25 |
* The geometry type
|
26 |
*/
|
27 |
public Ellipse2DZ(GeometryType geometryType) {
|
28 |
super(geometryType);
|
29 |
} |
30 |
|
31 |
/**
|
32 |
* @param id
|
33 |
* @param projection
|
34 |
* @param gpx
|
35 |
* @param i
|
36 |
* @param e
|
37 |
* @param d
|
38 |
*/
|
39 |
Ellipse2DZ(GeometryType geometryType, String id, IProjection projection, GeneralPathX gpx,
|
40 |
Point2D i, Point2D e, double d, double z) { |
41 |
super(geometryType, id, projection, gpx, i, e, d);
|
42 |
} |
43 |
|
44 |
public double getCoordinateAt(int index, int dimension) { |
45 |
if (index > gp.getNumCoords()) {
|
46 |
throw new ArrayIndexOutOfBoundsException(); |
47 |
} |
48 |
double[] coords = gp.getPointAt(index).getCoordinates(); |
49 |
if(dimension < coords.length)
|
50 |
return gp.getPointAt(index).getCoordinateAt(dimension);
|
51 |
return 0D; |
52 |
} |
53 |
|
54 |
public int getDimension() { |
55 |
return 3; |
56 |
} |
57 |
} |