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 / Arc2DZ.java @ 40435
History | View | Annotate | Download (1.33 KB)
1 | 40435 | jjdelcerro | /**
|
---|---|---|---|
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.Geometry; |
||
10 | import org.gvsig.fmap.geom.primitive.Arc; |
||
11 | import org.gvsig.fmap.geom.primitive.GeneralPathX; |
||
12 | import org.gvsig.fmap.geom.type.GeometryType; |
||
13 | |||
14 | /**
|
||
15 | * @author paco
|
||
16 | *
|
||
17 | */
|
||
18 | public class Arc2DZ extends Arc2D implements Arc { |
||
19 | private static final long serialVersionUID = -4622030261473894548L; |
||
20 | private double z; |
||
21 | |||
22 | /**
|
||
23 | * The constructor with the GeometryType like and argument
|
||
24 | * is used by the {@link GeometryType}{@link #create()}
|
||
25 | * to create the geometry
|
||
26 | * @param type
|
||
27 | * The geometry type
|
||
28 | */
|
||
29 | public Arc2DZ(GeometryType geometryType) {
|
||
30 | super(geometryType);
|
||
31 | } |
||
32 | |||
33 | /**
|
||
34 | * Constructor used in the {@link Geometry#cloneGeometry()} method
|
||
35 | */
|
||
36 | private Arc2DZ(GeometryType geometryType,String id, IProjection projection, GeneralPathX gpx, Point2D i, Point2D c, Point2D e, double z) { |
||
37 | super(geometryType, id, projection, gpx, i, c, e);
|
||
38 | this.z = z;
|
||
39 | } |
||
40 | |||
41 | /* (non-Javadoc)
|
||
42 | * @see org.gvsig.fmap.geom.primitive.Circle2D#setCoordinateAt(int, int, double)
|
||
43 | */
|
||
44 | public void setCoordinateAt(int index, int dimension, double value) { |
||
45 | if (dimension == 2){ |
||
46 | z = value; |
||
47 | }else{
|
||
48 | super.setCoordinateAt(index, dimension, value);
|
||
49 | } |
||
50 | } |
||
51 | |||
52 | public int getDimension() { |
||
53 | return 3; |
||
54 | } |
||
55 | } |