Statistics
| Revision:

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 @ 40767

History | View | Annotate | Download (2.31 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.fmap.geom.primitive.impl;
25

    
26
import java.awt.geom.Point2D;
27

    
28
import org.cresques.cts.IProjection;
29
import org.gvsig.fmap.geom.primitive.GeneralPathX;
30
import org.gvsig.fmap.geom.primitive.Surface;
31
import org.gvsig.fmap.geom.type.GeometryType;
32

    
33
/**
34
 * @author paco
35
 *
36
 */
37
public class Ellipse2DZ extends Ellipse2D implements Surface {
38
        private static final long serialVersionUID = -6678908069111004754L;
39
        
40
        /**
41
         * The constructor with the GeometryType like and argument 
42
         * is used by the {@link GeometryType}{@link #create()}
43
         * to create the geometry
44
         * @param type
45
         * The geometry type
46
         */
47
        public Ellipse2DZ(GeometryType geometryType) {
48
                super(geometryType);                
49
        }
50
        
51
        /**
52
         * @param id
53
         * @param projection
54
         * @param gpx
55
         * @param i
56
         * @param e
57
         * @param d
58
         */
59
        Ellipse2DZ(GeometryType geometryType, String id, IProjection projection, GeneralPathX gpx,
60
                        Point2D i, Point2D e, double d, double z) {
61
                super(geometryType, id, projection, gpx, i, e, d);                
62
        }
63
        
64
    public double getCoordinateAt(int index, int dimension) {
65
        if (index > gp.getNumCoords()) {
66
            throw new ArrayIndexOutOfBoundsException();
67
        }
68
        double[] coords = gp.getPointAt(index).getCoordinates();
69
        if(dimension < coords.length)
70
                return gp.getPointAt(index).getCoordinateAt(dimension);
71
        return 0D;
72
    }
73
        
74
    public int getDimension() {
75
        return 3;
76
    }
77
}