Revision 47432 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.jts/src/main/java/org/gvsig/fmap/geom/jts/aggregate/AbstractMultiPoint.java

View differences:

AbstractMultiPoint.java
27 27
import java.awt.geom.PathIterator;
28 28
import java.util.Collections;
29 29
import java.util.Iterator;
30

  
31 30
import org.gvsig.fmap.geom.Geometry;
32 31
import org.gvsig.fmap.geom.aggregate.MultiPoint;
33 32
import org.gvsig.fmap.geom.jts.gputils.DefaultGeneralPathX;
......
83 82
    }
84 83

  
85 84
    @Override
85
    public Geometry force2DM() throws GeometryOperationNotSupportedException, GeometryOperationException {
86
        MultiPoint2DM other = new MultiPoint2DM();
87
        other.setProjection(this.getProjection());
88
        other.ensureCapacity(primitives.size());
89
        for (Primitive primitive : primitives) {
90
            other.addPrimitive(((Point) primitive).force2DM());
91
        }
92
        return other;
93
    }
94

  
95
    @Override
96
    public Geometry force3D() throws GeometryOperationNotSupportedException, GeometryOperationException {
97
        MultiPoint3D other = new MultiPoint3D();
98
        other.setProjection(this.getProjection());
99
        other.ensureCapacity(primitives.size());
100
        for (Primitive primitive : primitives) {
101
            other.addPrimitive(((Point) primitive).force3D());
102
        }
103
        return other;
104
    }
105

  
106
    @Override
107
    public Geometry force3DM() throws GeometryOperationNotSupportedException, GeometryOperationException {
108
        MultiPoint3DM other = new MultiPoint3DM();
109
        other.setProjection(this.getProjection());
110
        other.ensureCapacity(primitives.size());
111
        for (Primitive primitive : primitives) {
112
            other.addPrimitive(((Point) primitive).force3DM());
113
        }
114
        return other;
115
    }
116

  
117

  
118
    @Override
119
    public Geometry forceSubtype(int subtype) throws GeometryOperationNotSupportedException, GeometryOperationException {
120
        switch(subtype){
121
            case Geometry.SUBTYPES.GEOM2D:
122
                return force2D();
123
            case Geometry.SUBTYPES.GEOM2DM:
124
                return force2DM();
125
            case Geometry.SUBTYPES.GEOM3D:
126
                return force3D();
127
            case Geometry.SUBTYPES.GEOM3DM:
128
                return force3DM();
129
        }
130
        return this;
131
    }
132
    
133
    
134

  
135
    @Override
86 136
    public void addPoint(Point point) {
87 137
        point = fixPoint(point);
88 138
        primitives.add(point);

Also available in: Unified diff