svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / primitive / Arc2DZ.java @ 26866
History | View | Annotate | Download (1.4 KB)
1 |
/**
|
---|---|
2 |
*
|
3 |
*/
|
4 |
package org.gvsig.fmap.geom.primitive; |
5 |
|
6 |
import java.awt.geom.Point2D; |
7 |
|
8 |
import org.cresques.cts.IProjection; |
9 |
import org.gvsig.fmap.geom.GeometryLocator; |
10 |
import org.gvsig.fmap.geom.type.GeometryType; |
11 |
|
12 |
/**
|
13 |
* @author paco
|
14 |
*
|
15 |
*/
|
16 |
public class Arc2DZ extends Arc2D implements Arc { |
17 |
|
18 |
/**
|
19 |
*
|
20 |
*/
|
21 |
private static final long serialVersionUID = -4622030261473894548L; |
22 |
|
23 |
private static GeometryType geomType = GeometryLocator.getGeometryManager() |
24 |
.registerGeometryType(Arc2DZ.class, null, TYPES.ARC, SUBTYPES.GEOM2DZ);
|
25 |
public static int CODE = geomType.getId(); |
26 |
|
27 |
private double z; |
28 |
|
29 |
/**
|
30 |
* Constructor without arguments. It is necessary to create
|
31 |
* geometries using the {@link GeometryType}{@link #create()}
|
32 |
* method
|
33 |
*/
|
34 |
public Arc2DZ() {
|
35 |
super();
|
36 |
} |
37 |
|
38 |
public Arc2DZ(String id, IProjection projection, GeneralPathX gpx, Point2D i, Point2D c, Point2D e, double z) { |
39 |
super(id, projection, gpx, i, c, e);
|
40 |
this.z = z;
|
41 |
} |
42 |
|
43 |
/**
|
44 |
* Devuelve un Array con los valores de todas las Zs, en este caso con un
|
45 |
* Ășnico vaor de z.
|
46 |
*
|
47 |
* @return Array de Zs.
|
48 |
*/
|
49 |
public double[] getZs() { |
50 |
return new double[] { z }; |
51 |
} |
52 |
|
53 |
/* (non-Javadoc)
|
54 |
* @see org.gvsig.fmap.geom.primitive.Circle2D#setCoordinateAt(int, int, double)
|
55 |
*/
|
56 |
public void setCoordinateAt(int index, int dimension, double value) { |
57 |
if (dimension == 2){ |
58 |
z = value; |
59 |
}else{
|
60 |
throw new UnsupportedOperationException("Use setGeneralPathX"); |
61 |
} |
62 |
} |
63 |
|
64 |
|
65 |
} |