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 / MultiCurve2D.java @ 41396

History | View | Annotate | Download (2.79 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.Primitive;
31
import org.gvsig.fmap.geom.primitive.impl.Curve2D;
32
import org.gvsig.fmap.geom.type.GeometryType;
33

    
34
/**
35
 * @author Jorge Piera Llodr? (jorge.piera@iver.es)
36
 */
37
public class MultiCurve2D extends BaseMultiPrimitive implements MultiCurve {
38
        private static final long serialVersionUID = -5279820875142516144L;
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 MultiCurve2D(GeometryType geomType) {
48
                super(geomType);                
49
        }
50
        
51
        MultiCurve2D(GeometryType geomType, String id, IProjection projection) {
52
                super(geomType, id, projection);
53
        }
54

    
55
        MultiCurve2D(GeometryType geomType, String id, IProjection projection, Curve2D[] lines) {
56
                super(geomType, id, projection, lines);
57
        }
58

    
59
        /*
60
         * (non-Javadoc)
61
         * 
62
         * @see com.iver.cit.gvsig.fmap.core.FGeometryCollection#cloneGeometry()
63
         */
64
        public Geometry cloneGeometry() {
65
                MultiCurve2D auxCurve = new MultiCurve2D(geometryType, id, projection);
66
                for (int i = 0; i < getPrimitivesNumber(); i++) {
67
                        auxCurve.addCurve((Curve)((Curve) geometries.get(i)).cloneGeometry());
68
                }
69
                return auxCurve;
70
        }
71

    
72
        /* (non-Javadoc)
73
         * @see org.gvsig.fmap.geom.aggregate.MultiCurve#addCurve(org.gvsig.fmap.geom.primitive.Curve)
74
         */
75
        public void addCurve(Curve curve) {
76
                geometries.add(curve);
77
        }
78

    
79
        public void addPrimitive(Primitive primitive) {
80
                addCurve((Curve)primitive);
81
        }
82

    
83
        /* (non-Javadoc)
84
         * @see org.gvsig.fmap.geom.aggregate.MultiCurve#getCurveAt(int)
85
         */
86
        public Curve getCurveAt(int index) {
87
                return (Curve)getPrimitiveAt(index);
88
        }
89
}