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