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/FilledSpline3D.java
FilledSpline3D.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.BaseSpline3D; |
31 | 33 |
import org.gvsig.fmap.geom.jts.primitive.surface.split.SurfaceSplitOperation; |
34 |
import org.gvsig.fmap.geom.jts.util.ArrayListCoordinateSequence; |
|
32 | 35 |
import org.gvsig.fmap.geom.jts.util.JTSUtils; |
33 | 36 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
34 | 37 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
... | ... | |
65 | 68 |
closePrimitive(); |
66 | 69 |
} |
67 | 70 |
|
71 |
public FilledSpline3D(ArrayListCoordinateSequence coordinates) { |
|
72 |
super(Geometry.TYPES.FILLEDSPLINE, coordinates); |
|
73 |
closePrimitive(); |
|
74 |
} |
|
75 |
|
|
68 | 76 |
/* (non-Javadoc) |
69 | 77 |
* @see org.gvsig.fmap.geom.primitive.Surface#setSurfaceAppearance(org.gvsig.fmap.geom.primitive.SurfaceAppearance) |
70 | 78 |
*/ |
... | ... | |
203 | 211 |
SurfaceSplitOperation op = new SurfaceSplitOperation(); |
204 | 212 |
return op.split(this, splitter); |
205 | 213 |
} |
214 |
|
|
215 |
@Override |
|
216 |
public Geometry force2D() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
217 |
ArrayListCoordinateSequence coordinates2D = new ArrayListCoordinateSequence(coordinates.size()); |
|
218 |
for (Coordinate coordinate : this.coordinates) { |
|
219 |
coordinates2D.add(new Coordinate( |
|
220 |
coordinate.x, |
|
221 |
coordinate.y |
|
222 |
)); |
|
223 |
} |
|
224 |
FilledSpline2D s = new FilledSpline2D(coordinates2D); |
|
225 |
s.setProjection(this.getProjection()); |
|
226 |
return s; |
|
227 |
} |
|
228 |
|
|
229 |
@Override |
|
230 |
public Geometry force2DM() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
231 |
ArrayListCoordinateSequence coordinates2DM = new ArrayListCoordinateSequence(coordinates.size()); |
|
232 |
for (Coordinate coordinate : this.coordinates) { |
|
233 |
coordinates2DM.add(MCoordinate.create2dWithMeasure( |
|
234 |
coordinate.x, |
|
235 |
coordinate.y, |
|
236 |
0 |
|
237 |
)); |
|
238 |
} |
|
239 |
FilledSpline2DM s = new FilledSpline2DM(coordinates2DM); |
|
240 |
s.setProjection(this.getProjection()); |
|
241 |
return s; |
|
242 |
} |
|
243 |
|
|
244 |
@Override |
|
245 |
public Geometry force3D() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
246 |
Geometry geom = this.cloneGeometry(); |
|
247 |
return geom; |
|
248 |
} |
|
249 |
|
|
250 |
|
|
251 |
|
|
252 |
@Override |
|
253 |
public Geometry force3DM() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
254 |
ArrayListCoordinateSequence coordinates3DM = new ArrayListCoordinateSequence(coordinates.size()); |
|
255 |
for (Coordinate coordinate : this.coordinates) { |
|
256 |
coordinates3DM.add(MCoordinate.create3dWithMeasure( |
|
257 |
coordinate.x, |
|
258 |
coordinate.y, |
|
259 |
coordinate.z, |
|
260 |
0 |
|
261 |
)); |
|
262 |
} |
|
263 |
FilledSpline3DM s = new FilledSpline3DM(coordinates3DM); |
|
264 |
s.setProjection(this.getProjection()); |
|
265 |
return s; |
|
266 |
} |
|
267 |
|
|
206 | 268 |
} |
Also available in: Unified diff