Revision 29097 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/aggregate/impl/BaseMultiPrimitive2D.java
BaseMultiPrimitive2D.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.cresques.cts.IProjection; |
31 | 31 |
import org.gvsig.fmap.geom.Geometry; |
32 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
33 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
34 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
|
35 | 32 |
import org.gvsig.fmap.geom.aggregate.MultiPrimitive; |
36 | 33 |
import org.gvsig.fmap.geom.primitive.Primitive; |
37 | 34 |
import org.gvsig.fmap.geom.type.GeometryType; |
... | ... | |
42 | 39 |
public class BaseMultiPrimitive2D extends BaseMultiPrimitive implements |
43 | 40 |
MultiPrimitive { |
44 | 41 |
|
45 |
// Registramos este tipo de geometrĂa |
|
46 |
private static GeometryType geomType = GeometryLocator.getGeometryManager() |
|
47 |
.registerGeometryType(BaseMultiPrimitive2D.class, null, TYPES.AGGREGATE, SUBTYPES.GEOM2D); |
|
48 |
|
|
49 | 42 |
/** |
50 |
* Constructor without arguments. It is necessary to create |
|
51 |
* geometries using the {@link GeometryType}{@link #create()} |
|
52 |
* method |
|
43 |
* The constructor with the GeometryType like and argument |
|
44 |
* is used by the {@link GeometryType}{@link #create()} |
|
45 |
* to create the geometry |
|
46 |
* @param type |
|
47 |
* The geometry type |
|
53 | 48 |
*/ |
54 |
public BaseMultiPrimitive2D() { |
|
55 |
super(); |
|
49 |
public BaseMultiPrimitive2D(GeometryType geomType) {
|
|
50 |
super(geomType);
|
|
56 | 51 |
} |
57 | 52 |
|
58 | 53 |
/** |
... | ... | |
60 | 55 |
* @param projection |
61 | 56 |
* @param geometries |
62 | 57 |
*/ |
63 |
public BaseMultiPrimitive2D(String id, IProjection projection,
|
|
58 |
BaseMultiPrimitive2D(GeometryType geomType, String id, IProjection projection,
|
|
64 | 59 |
Geometry[] geometries) { |
65 |
super(id, projection, geometries); |
|
60 |
super(geomType, id, projection, geometries);
|
|
66 | 61 |
} |
67 |
|
|
68 |
/** |
|
69 |
* @param geometries |
|
70 |
*/ |
|
71 |
public BaseMultiPrimitive2D(Geometry[] geometries) { |
|
72 |
super(geometries); |
|
73 |
} |
|
74 | 62 |
|
75 | 63 |
/* |
76 | 64 |
* (non-Javadoc) |
... | ... | |
83 | 71 |
aux[i] = (Primitive)((Geometry)geometries.get(i)).cloneGeometry() |
84 | 72 |
.getInternalShape(); |
85 | 73 |
} |
86 |
return new BaseMultiPrimitive2D(id, projection, aux); |
|
87 |
} |
|
88 |
|
|
89 |
/* |
|
90 |
* (non-Javadoc) |
|
91 |
* @see org.gvsig.fmap.geom.primitive.AbstractPrimitive#getGeometryType() |
|
92 |
*/ |
|
93 |
public GeometryType getGeometryType() { |
|
94 |
return geomType; |
|
95 |
} |
|
96 |
|
|
97 |
/* (non-Javadoc) |
|
98 |
* @see org.gvsig.fmap.geom.Geometry#getType() |
|
99 |
*/ |
|
100 |
public int getType() { |
|
101 |
return geomType.getType(); |
|
102 |
} |
|
74 |
return new BaseMultiPrimitive2D(getGeometryType(), id, projection, aux); |
|
75 |
} |
|
103 | 76 |
} |
104 | 77 |
|
Also available in: Unified diff