Revision 44612 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/AbstractMultiLine.java
AbstractMultiLine.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.fmap.geom.jts.aggregate; |
24 | 24 |
|
25 |
import java.awt.Shape; |
|
26 |
import java.awt.geom.AffineTransform; |
|
27 |
import java.awt.geom.PathIterator; |
|
28 |
import java.util.ArrayList; |
|
29 | 25 |
import java.util.Collections; |
30 | 26 |
import java.util.Iterator; |
31 |
import java.util.List; |
|
32 | 27 |
|
33 | 28 |
import com.vividsolutions.jts.geom.LineString; |
34 | 29 |
|
35 | 30 |
import org.gvsig.fmap.geom.Geometry; |
36 |
import org.gvsig.fmap.geom.GeometryException; |
|
37 | 31 |
import org.gvsig.fmap.geom.aggregate.MultiLine; |
38 | 32 |
import org.gvsig.fmap.geom.jts.GeometryJTS; |
39 |
import org.gvsig.fmap.geom.jts.gputils.DefaultGeneralPathX; |
|
40 |
import org.gvsig.fmap.geom.jts.gputils.GeneralPathXIterator; |
|
41 | 33 |
import org.gvsig.fmap.geom.jts.util.JTSUtils; |
42 | 34 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
43 | 35 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
44 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
|
45 | 36 |
import org.gvsig.fmap.geom.primitive.Primitive; |
46 | 37 |
|
47 | 38 |
|
... | ... | |
56 | 47 |
*/ |
57 | 48 |
private static final long serialVersionUID = 3585059833766514177L; |
58 | 49 |
|
59 |
/** |
|
60 |
* @param type |
|
61 |
*/ |
|
62 | 50 |
public AbstractMultiLine(int subtype) { |
63 | 51 |
super(Geometry.TYPES.MULTILINE, subtype); |
64 | 52 |
} |
65 | 53 |
|
66 | 54 |
|
67 |
/* (non-Javadoc) |
|
68 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#getJTS() |
|
69 |
*/ |
|
55 |
@Override |
|
70 | 56 |
public com.vividsolutions.jts.geom.Geometry getJTS() { |
71 | 57 |
LineString[] lineStrings = new LineString[primitives.size()]; |
72 | 58 |
for(int i=0; i<primitives.size(); i++){ |
... | ... | |
75 | 61 |
return JTSUtils.createJTSMultiLineString(lineStrings); |
76 | 62 |
} |
77 | 63 |
|
78 |
/* (non-Javadoc) |
|
79 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#flip() |
|
80 |
*/ |
|
64 |
@Override |
|
65 |
public Geometry force2D() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
66 |
MultiLine2D other = new MultiLine2D(); |
|
67 |
other.setProjection(this.getProjection()); |
|
68 |
other.ensureCapacity(primitives.size()); |
|
69 |
for (Primitive primitive : primitives) { |
|
70 |
other.addPrimitive((Primitive)primitive.force2D()); |
|
71 |
} |
|
72 |
return other; |
|
73 |
} |
|
74 |
|
|
75 |
@Override |
|
81 | 76 |
public void flip() throws GeometryOperationNotSupportedException, GeometryOperationException { |
82 | 77 |
for (Iterator iterator = primitives.iterator(); iterator.hasNext();) { |
83 | 78 |
((GeometryJTS)iterator.next()).flip(); |
Also available in: Unified diff