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/primitive/ring/Ring3D.java

View differences:

Ring3D.java
28 28
import com.vividsolutions.jts.geomgraph.Position;
29 29
import com.vividsolutions.jts.operation.buffer.BufferParameters;
30 30
import com.vividsolutions.jts.operation.buffer.OffsetCurveBuilder;
31

  
32 31
import org.cresques.cts.ICoordTrans;
33

  
34 32
import org.gvsig.fmap.geom.Geometry;
35 33
import org.gvsig.fmap.geom.GeometryException;
36 34
import org.gvsig.fmap.geom.aggregate.MultiLine;
37 35
import org.gvsig.fmap.geom.aggregate.MultiPolygon;
38 36
import org.gvsig.fmap.geom.jts.aggregate.MultiLine3D;
39 37
import org.gvsig.fmap.geom.jts.aggregate.MultiPolygon2D;
38
import org.gvsig.fmap.geom.jts.mgeom.MCoordinate;
40 39
import org.gvsig.fmap.geom.jts.primitive.curve.line.BaseLine3D;
41 40
import org.gvsig.fmap.geom.jts.primitive.curve.line.Line3D;
42 41
import org.gvsig.fmap.geom.jts.primitive.surface.polygon.Polygon3D;
42
import org.gvsig.fmap.geom.jts.util.ArrayListCoordinateSequence;
43 43
import org.gvsig.fmap.geom.jts.util.JTSUtils;
44 44
import org.gvsig.fmap.geom.operation.GeometryOperationException;
45 45
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
......
71 71
        closePrimitive();
72 72
    }
73 73

  
74
    public Ring3D(ArrayListCoordinateSequence coordinates) {
75
        super(Geometry.TYPES.RING, coordinates);
76
    }
77

  
74 78
    /* (non-Javadoc)
75 79
     * @see org.gvsig.fmap.geom.Geometry#cloneGeometry()
76 80
     */
......
171 175
          }
172 176
      }
173 177

  
178
    @Override
179
    public Geometry force2D() throws GeometryOperationNotSupportedException, GeometryOperationException {
180
        ArrayListCoordinateSequence coordinates2D = new ArrayListCoordinateSequence(coordinates.size());
181
        for (Coordinate coordinate : this.coordinates) {
182
            coordinates2D.add(new Coordinate(coordinate.x, coordinate.y));
183
        }
184
        Ring2D ring = new Ring2D(coordinates2D);
185
        ring.setProjection(this.getProjection());
186
        return ring;
187
    }
188

  
189
    @Override
190
    public Geometry force2DM() throws GeometryOperationNotSupportedException, GeometryOperationException {
191
        ArrayListCoordinateSequence coordinates2DM = new ArrayListCoordinateSequence(coordinates.size());
192
        for (Coordinate coordinate : this.coordinates) {
193
            coordinates2DM.add(MCoordinate.create2dWithMeasure(coordinate.x, coordinate.y, 0));
194
        }
195
        Ring2DM ring = new Ring2DM(coordinates2DM);
196
        ring.setProjection(this.getProjection());
197
        return ring;
198
    }
199

  
200
    @Override
201
    public Geometry force3D() throws GeometryOperationNotSupportedException, GeometryOperationException {
202
        ArrayListCoordinateSequence coordinates3D = new ArrayListCoordinateSequence(coordinates.size());
203
        for (Coordinate coordinate : this.coordinates) {
204
            coordinates3D.add(new Coordinate(coordinate.x, coordinate.y, 0));
205
        }
206
        Ring3D ring = new Ring3D(coordinates3D);
207
        ring.setProjection(this.getProjection());
208
        return ring;
209
    }
210

  
211
    @Override
212
    public Geometry force3DM() throws GeometryOperationNotSupportedException, GeometryOperationException {
213
        ArrayListCoordinateSequence coordinates3DM = new ArrayListCoordinateSequence(coordinates.size());
214
        for (Coordinate coordinate : this.coordinates) {
215
            coordinates3DM.add(MCoordinate.create3dWithMeasure(coordinate.x, coordinate.y, 0, 0));
216
        }
217
        Ring3DM ring = new Ring3DM(coordinates3DM);
218
        ring.setProjection(this.getProjection());
219
        return ring;
220
    }
221
      
174 222
}

Also available in: Unified diff