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

History | View | Annotate | Download (4.17 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
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
34
 *
35
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
36
 *
37
 * This program is free software; you can redistribute it and/or
38
 * modify it under the terms of the GNU General Public License
39
 * as published by the Free Software Foundation; either version 2
40
 * of the License, or (at your option) any later version.
41
 *
42
 * This program is distributed in the hope that it will be useful,
43
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
44
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
45
 * GNU General Public License for more details.
46
 *
47
 * You should have received a copy of the GNU General Public License
48
 * along with this program; if not, write to the Free Software
49
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
50
 *
51
 * For more information, contact:
52
 *
53
 *  Generalitat Valenciana
54
 *   Conselleria d'Infraestructures i Transport
55
 *   Av. Blasco Ib??ez, 50
56
 *   46010 VALENCIA
57
 *   SPAIN
58
 *
59
 *      +34 963862235
60
 *   gvsig@gva.es
61
 *      www.gvsig.gva.es
62
 *
63
 *    or
64
 *
65
 *   IVER T.I. S.A
66
 *   Salamanca 50
67
 *   46005 Valencia
68
 *   Spain
69
 *
70
 *   +34 963163400
71
 *   dac@iver.es
72
 */
73
/* CVS MESSAGES:
74
 *
75
 * $Id: FMultiPolygon2D.java,v 1.2 2008/03/25 08:47:41 cvs Exp $
76
 * $Log: FMultiPolygon2D.java,v $
77
 * Revision 1.2  2008/03/25 08:47:41  cvs
78
 * Visitors removed
79
 *
80
 * Revision 1.1  2008/03/12 08:46:20  cvs
81
 * *** empty log message ***
82
 *
83
 *
84
 */
85
/**
86
 * @author Jorge Piera Llodr? (jorge.piera@iver.es)
87
 */
88
public class MultiSurface2D extends BaseMultiPrimitive implements MultiSurface {
89
        private static final long serialVersionUID = 625054010696136925L;
90

    
91
        /**
92
         * The constructor with the GeometryType like and argument 
93
         * is used by the {@link GeometryType}{@link #create()}
94
         * to create the geometry
95
         * @param type
96
         * The geometry type
97
         */
98
        public MultiSurface2D(GeometryType geomType) {
99
                super(geomType);                
100
        }
101
        
102
        MultiSurface2D(GeometryType geomType, String id, IProjection projection) {
103
                super(geomType, id, projection);
104
        }
105

    
106
        MultiSurface2D(GeometryType geomType, String id, IProjection projection,
107
                        Surface2D[] polygons) {
108
                super(geomType, id, projection, polygons);
109
        }
110

    
111
        /*
112
         * (non-Javadoc)
113
         * 
114
         * @see com.iver.cit.gvsig.fmap.core.FGeometryCollection#cloneGeometry()
115
         */
116
        public Geometry cloneGeometry() {
117
                MultiSurface2D auxSurface = new MultiSurface2D(geometryType, id, projection);
118
                for (int i = 0; i < getPrimitivesNumber(); i++) {
119
                        auxSurface.addSurface((Surface)((Surface) geometries.get(i)).cloneGeometry());
120
                }
121
                return auxSurface;
122
        }        
123

    
124
        /* (non-Javadoc)
125
         * @see org.gvsig.fmap.geom.aggregate.MultiSurface#addSurface(org.gvsig.fmap.geom.primitive.Surface)
126
         */
127
        public void addSurface(Surface surface) {
128
                addPrimitive(surface);                
129
        }
130

    
131
        /* (non-Javadoc)
132
         * @see org.gvsig.fmap.geom.aggregate.MultiSurface#getSurfaceAt(int)
133
         */
134
        public Surface getSurfaceAt(int index) {
135
                return (Surface)getPrimitiveAt(index);
136
        }
137

    
138
}