Revision 29097 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/aggregate/impl/MultiCurve2DZ.java
MultiCurve2DZ.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 | 5 |
import org.gvsig.fmap.geom.aggregate.MultiCurve; |
7 | 6 |
import org.gvsig.fmap.geom.primitive.Curve; |
8 | 7 |
import org.gvsig.fmap.geom.primitive.impl.Curve2DZ; |
... | ... | |
64 | 63 |
* @author Jorge Piera Llodr? (jorge.piera@iver.es) |
65 | 64 |
*/ |
66 | 65 |
public class MultiCurve2DZ extends BaseMultiPrimitive implements MultiCurve { |
66 |
private static final long serialVersionUID = 3079910108112255174L; |
|
67 | 67 |
|
68 |
private static final long serialVersionUID = 1L; |
|
69 |
|
|
70 |
private static GeometryType geomType = GeometryLocator.getGeometryManager() |
|
71 |
.registerGeometryType(MultiCurve2DZ.class, null, TYPES.MULTICURVE, |
|
72 |
SUBTYPES.GEOM2DZ); |
|
73 |
public static int CODE = geomType.getId(); |
|
74 |
|
|
75 | 68 |
/** |
76 |
* Constructor without arguments. It is necessary to create |
|
77 |
* geometries using the {@link GeometryType}{@link #create()} |
|
78 |
* 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 |
|
79 | 74 |
*/ |
80 |
public MultiCurve2DZ() { |
|
81 |
super(); |
|
75 |
public MultiCurve2DZ(GeometryType geomType) {
|
|
76 |
super(geomType);
|
|
82 | 77 |
} |
83 | 78 |
|
84 |
public MultiCurve2DZ(String id, IProjection projection) {
|
|
85 |
super(id, projection); |
|
79 |
MultiCurve2DZ(GeometryType geomType, String id, IProjection projection) {
|
|
80 |
super(geomType, id, projection);
|
|
86 | 81 |
} |
87 | 82 |
|
88 |
public MultiCurve2DZ(String id, IProjection projection, Curve2DZ[] lines) {
|
|
89 |
super(id, projection, lines); |
|
83 |
MultiCurve2DZ(GeometryType geomType, String id, IProjection projection, Curve2DZ[] lines) {
|
|
84 |
super(geomType, id, projection, lines);
|
|
90 | 85 |
} |
91 | 86 |
|
92 | 87 |
/* |
... | ... | |
95 | 90 |
* @see com.iver.cit.gvsig.fmap.core.FGeometryCollection#cloneGeometry() |
96 | 91 |
*/ |
97 | 92 |
public Geometry cloneGeometry() { |
98 |
MultiCurve2DZ auxCurve = new MultiCurve2DZ(id, projection); |
|
93 |
MultiCurve2DZ auxCurve = new MultiCurve2DZ(geometryType, id, projection);
|
|
99 | 94 |
for (int i = 0; i < getPrimitivesNumber(); i++) { |
100 | 95 |
auxCurve.addCurve((Curve)((Curve) geometries.get(i)).cloneGeometry()); |
101 | 96 |
} |
102 | 97 |
return auxCurve; |
103 | 98 |
} |
104 |
|
|
99 |
|
|
105 | 100 |
/* (non-Javadoc) |
106 |
* @see org.gvsig.fmap.geom.primitive.AbstractPrimitive#getGeometryType() |
|
107 |
*/ |
|
108 |
public GeometryType getGeometryType() { |
|
109 |
return geomType; |
|
110 |
} |
|
111 |
|
|
112 |
/* (non-Javadoc) |
|
113 |
* @see org.gvsig.fmap.geom.Geometry#getType() |
|
114 |
*/ |
|
115 |
public int getType() { |
|
116 |
return geomType.getType(); |
|
117 |
} |
|
118 |
|
|
119 |
/* (non-Javadoc) |
|
120 | 101 |
* @see org.gvsig.fmap.geom.aggregate.MultiCurve#addCurve(org.gvsig.fmap.geom.primitive.Curve) |
121 | 102 |
*/ |
122 | 103 |
public void addCurve(Curve curve) { |
Also available in: Unified diff