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