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/surface/filledspline/FilledSpline3DM.java
FilledSpline3DM.java | ||
---|---|---|
23 | 23 |
package org.gvsig.fmap.geom.jts.primitive.surface.filledspline; |
24 | 24 |
|
25 | 25 |
import com.vividsolutions.jts.geom.Coordinate; |
26 |
import com.vividsolutions.jts.geom.CoordinateSequence; |
|
26 | 27 |
|
27 | 28 |
import org.cresques.cts.ICoordTrans; |
28 | 29 |
|
29 | 30 |
import org.gvsig.fmap.geom.Geometry; |
31 |
import org.gvsig.fmap.geom.jts.mgeom.MCoordinate; |
|
30 | 32 |
import org.gvsig.fmap.geom.jts.primitive.curve.spline.BaseSpline3DM; |
31 | 33 |
import org.gvsig.fmap.geom.jts.primitive.curve.spline.Spline3DM; |
32 | 34 |
import org.gvsig.fmap.geom.jts.primitive.surface.split.SurfaceSplitOperation; |
35 |
import org.gvsig.fmap.geom.jts.util.ArrayListCoordinateSequence; |
|
33 | 36 |
import org.gvsig.fmap.geom.jts.util.JTSUtils; |
34 | 37 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
35 | 38 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
... | ... | |
66 | 69 |
closePrimitive(); |
67 | 70 |
} |
68 | 71 |
|
72 |
public FilledSpline3DM(ArrayListCoordinateSequence coordinates) { |
|
73 |
super(Geometry.TYPES.FILLEDSPLINE, coordinates); |
|
74 |
closePrimitive(); |
|
75 |
} |
|
76 |
|
|
69 | 77 |
/* (non-Javadoc) |
70 | 78 |
* @see org.gvsig.fmap.geom.primitive.Surface#setSurfaceAppearance(org.gvsig.fmap.geom.primitive.SurfaceAppearance) |
71 | 79 |
*/ |
... | ... | |
207 | 215 |
SurfaceSplitOperation op = new SurfaceSplitOperation(); |
208 | 216 |
return op.split(this, splitter); |
209 | 217 |
} |
218 |
|
|
219 |
@Override |
|
220 |
public Geometry force2D() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
221 |
ArrayListCoordinateSequence coordinates2D = new ArrayListCoordinateSequence(coordinates.size()); |
|
222 |
for (Coordinate coordinate : this.coordinates) { |
|
223 |
coordinates2D.add(new Coordinate( |
|
224 |
coordinate.x, |
|
225 |
coordinate.y |
|
226 |
)); |
|
227 |
} |
|
228 |
FilledSpline2D s = new FilledSpline2D(coordinates2D); |
|
229 |
s.setProjection(this.getProjection()); |
|
230 |
return s; |
|
231 |
} |
|
232 |
|
|
233 |
@Override |
|
234 |
public Geometry force2DM() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
235 |
ArrayListCoordinateSequence coordinates2DM = new ArrayListCoordinateSequence(coordinates.size()); |
|
236 |
for (Coordinate coordinate : this.coordinates) { |
|
237 |
coordinates2DM.add(MCoordinate.create2dWithMeasure( |
|
238 |
coordinate.x, |
|
239 |
coordinate.y, |
|
240 |
(coordinate instanceof MCoordinate)?coordinate.getOrdinate(CoordinateSequence.M):0 |
|
241 |
)); |
|
242 |
} |
|
243 |
FilledSpline2DM s = new FilledSpline2DM(coordinates2DM); |
|
244 |
s.setProjection(this.getProjection()); |
|
245 |
return s; |
|
246 |
} |
|
247 |
|
|
248 |
@Override |
|
249 |
public Geometry force3D() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
250 |
ArrayListCoordinateSequence coordinates3D = new ArrayListCoordinateSequence(coordinates.size()); |
|
251 |
for (Coordinate coordinate : this.coordinates) { |
|
252 |
coordinates3D.add(new Coordinate( |
|
253 |
coordinate.x, |
|
254 |
coordinate.y, |
|
255 |
coordinate.z |
|
256 |
)); |
|
257 |
} |
|
258 |
FilledSpline3D s = new FilledSpline3D(coordinates3D); |
|
259 |
s.setProjection(this.getProjection()); |
|
260 |
return s; |
|
261 |
} |
|
262 |
|
|
263 |
@Override |
|
264 |
public Geometry force3DM() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
265 |
Geometry geom = this.cloneGeometry(); |
|
266 |
return geom; |
|
267 |
} |
|
268 |
|
|
210 | 269 |
} |
Also available in: Unified diff