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 / aggregate / impl / MultiCurve2DZ.java @ 40596

History | View | Annotate | Download (2.65 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.aggregate.impl;
25

    
26
import org.cresques.cts.IProjection;
27
import org.gvsig.fmap.geom.Geometry;
28
import org.gvsig.fmap.geom.aggregate.MultiCurve;
29
import org.gvsig.fmap.geom.primitive.Curve;
30
import org.gvsig.fmap.geom.primitive.impl.Curve2DZ;
31
import org.gvsig.fmap.geom.type.GeometryType;
32

    
33
/**
34
 * @author Jorge Piera Llodr? (jorge.piera@iver.es)
35
 */
36
public class MultiCurve2DZ extends BaseMultiPrimitive implements MultiCurve {
37
        private static final long serialVersionUID = 3079910108112255174L;
38

    
39
        /**
40
         * The constructor with the GeometryType like and argument 
41
         * is used by the {@link GeometryType}{@link #create()}
42
         * to create the geometry
43
         * @param type
44
         * The geometry type
45
         */
46
        public MultiCurve2DZ(GeometryType geomType) {
47
                super(geomType);
48
        }
49

    
50
        MultiCurve2DZ(GeometryType geomType, String id, IProjection projection) {
51
                super(geomType, id, projection);
52
        }
53

    
54
        MultiCurve2DZ(GeometryType geomType, String id, IProjection projection, Curve2DZ[] lines) {
55
                super(geomType, id, projection, lines);
56
        }
57

    
58
        /*
59
         * (non-Javadoc)
60
         *
61
         * @see com.iver.cit.gvsig.fmap.core.FGeometryCollection#cloneGeometry()
62
         */
63
        public Geometry cloneGeometry() {
64
                MultiCurve2DZ auxCurve = new MultiCurve2DZ(geometryType, id, projection);
65
                for (int i = 0; i < getPrimitivesNumber(); i++) {
66
                        auxCurve.addCurve((Curve)((Curve) geometries.get(i)).cloneGeometry());
67
                }
68
                return auxCurve;
69
        }
70
        
71
        /* (non-Javadoc)
72
         * @see org.gvsig.fmap.geom.aggregate.MultiCurve#addCurve(org.gvsig.fmap.geom.primitive.Curve)
73
         */
74
        public void addCurve(Curve curve) {
75
                addPrimitive(curve);
76
        }
77

    
78
        /* (non-Javadoc)
79
         * @see org.gvsig.fmap.geom.aggregate.MultiCurve#getCurveAt(int)
80
         */
81
        public Curve getCurveAt(int index) {
82
                return (Curve)getPrimitiveAt(index);
83
        }
84
}