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 / MultiSurface2D.java @ 40596

History | View | Annotate | Download (2.72 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.MultiSurface;
29
import org.gvsig.fmap.geom.primitive.Surface;
30
import org.gvsig.fmap.geom.primitive.impl.Surface2D;
31
import org.gvsig.fmap.geom.type.GeometryType;
32

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

    
54
        MultiSurface2D(GeometryType geomType, String id, IProjection projection,
55
                        Surface2D[] polygons) {
56
                super(geomType, id, projection, polygons);
57
        }
58

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

    
72
        /* (non-Javadoc)
73
         * @see org.gvsig.fmap.geom.aggregate.MultiSurface#addSurface(org.gvsig.fmap.geom.primitive.Surface)
74
         */
75
        public void addSurface(Surface surface) {
76
                addPrimitive(surface);                
77
        }
78

    
79
        /* (non-Javadoc)
80
         * @see org.gvsig.fmap.geom.aggregate.MultiSurface#getSurfaceAt(int)
81
         */
82
        public Surface getSurfaceAt(int index) {
83
                return (Surface)getPrimitiveAt(index);
84
        }
85

    
86
}