Revision 29097 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/aggregate/impl/MultiSurface2D.java
MultiSurface2D.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import org.cresques.cts.IProjection; |
4 | 4 |
import org.gvsig.fmap.geom.Geometry; |
5 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
6 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
7 | 5 |
import org.gvsig.fmap.geom.aggregate.MultiSurface; |
8 |
import org.gvsig.fmap.geom.primitive.FShape; |
|
9 | 6 |
import org.gvsig.fmap.geom.primitive.Surface; |
10 | 7 |
import org.gvsig.fmap.geom.primitive.impl.Surface2D; |
11 | 8 |
import org.gvsig.fmap.geom.type.GeometryType; |
... | ... | |
66 | 63 |
* @author Jorge Piera Llodr? (jorge.piera@iver.es) |
67 | 64 |
*/ |
68 | 65 |
public class MultiSurface2D extends BaseMultiPrimitive implements MultiSurface { |
66 |
private static final long serialVersionUID = 625054010696136925L; |
|
69 | 67 |
|
70 |
private static final long serialVersionUID = 1L; |
|
71 |
|
|
72 |
private static GeometryType geomType = GeometryLocator.getGeometryManager() |
|
73 |
.registerGeometryType(MultiSurface2D.class, null, TYPES.MULTISURFACE, SUBTYPES.GEOM2D); |
|
74 |
public static int CODE = geomType.getId(); |
|
75 |
|
|
76 | 68 |
/** |
77 |
* Constructor without arguments. It is necessary to create |
|
78 |
* geometries using the {@link GeometryType}{@link #create()} |
|
79 |
* method |
|
69 |
* The constructor with the GeometryType like and argument |
|
70 |
* is used by the {@link GeometryType}{@link #create()} |
|
71 |
* to create the geometry |
|
72 |
* @param type |
|
73 |
* The geometry type |
|
80 | 74 |
*/ |
81 |
public MultiSurface2D() { |
|
82 |
super(); |
|
75 |
public MultiSurface2D(GeometryType geomType) {
|
|
76 |
super(geomType);
|
|
83 | 77 |
} |
84 | 78 |
|
85 |
public MultiSurface2D(String id, IProjection projection) {
|
|
86 |
super(id, projection); |
|
79 |
MultiSurface2D(GeometryType geomType, String id, IProjection projection) {
|
|
80 |
super(geomType, id, projection);
|
|
87 | 81 |
} |
88 | 82 |
|
89 |
public MultiSurface2D(String id, IProjection projection,
|
|
83 |
MultiSurface2D(GeometryType geomType, String id, IProjection projection,
|
|
90 | 84 |
Surface2D[] polygons) { |
91 |
super(id, projection, polygons); |
|
85 |
super(geomType, id, projection, polygons);
|
|
92 | 86 |
} |
93 | 87 |
|
94 | 88 |
/* |
... | ... | |
97 | 91 |
* @see com.iver.cit.gvsig.fmap.core.FGeometryCollection#cloneGeometry() |
98 | 92 |
*/ |
99 | 93 |
public Geometry cloneGeometry() { |
100 |
MultiSurface2D auxSurface = new MultiSurface2D(id, projection); |
|
94 |
MultiSurface2D auxSurface = new MultiSurface2D(geometryType, id, projection);
|
|
101 | 95 |
for (int i = 0; i < getPrimitivesNumber(); i++) { |
102 | 96 |
auxSurface.addSurface((Surface)((Surface) geometries.get(i)).cloneGeometry()); |
103 | 97 |
} |
104 | 98 |
return auxSurface; |
105 |
} |
|
99 |
}
|
|
106 | 100 |
|
107 | 101 |
/* (non-Javadoc) |
108 |
* @see org.gvsig.fmap.geom.primitive.AbstractPrimitive#getGeometryType() |
|
109 |
*/ |
|
110 |
public GeometryType getGeometryType() { |
|
111 |
return geomType; |
|
112 |
} |
|
113 |
|
|
114 |
/* (non-Javadoc) |
|
115 |
* @see org.gvsig.fmap.geom.Geometry#getType() |
|
116 |
*/ |
|
117 |
public int getType() { |
|
118 |
return geomType.getType(); |
|
119 |
} |
|
120 |
|
|
121 |
/* (non-Javadoc) |
|
122 | 102 |
* @see org.gvsig.fmap.geom.aggregate.MultiSurface#addSurface(org.gvsig.fmap.geom.primitive.Surface) |
123 | 103 |
*/ |
124 | 104 |
public void addSurface(Surface surface) { |
Also available in: Unified diff