Revision 575 org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/operation/CurveSplitLineOperation.java
CurveSplitLineOperation.java | ||
---|---|---|
25 | 25 |
package org.gvsig.vectorediting.lib.prov.splitline.operation; |
26 | 26 |
|
27 | 27 |
import org.gvsig.fmap.geom.Geometry; |
28 |
import org.gvsig.fmap.geom.GeometryException; |
|
28 | 29 |
import org.gvsig.fmap.geom.GeometryLocator; |
29 | 30 |
import org.gvsig.fmap.geom.GeometryManager; |
30 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
31 | 31 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
32 | 32 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
33 | 33 |
import org.gvsig.fmap.geom.primitive.Curve; |
34 |
import org.gvsig.fmap.geom.primitive.Line; |
|
34 | 35 |
import org.gvsig.fmap.geom.primitive.Point; |
35 | 36 |
import org.gvsig.tools.locator.LocatorException; |
36 | 37 |
|
... | ... | |
42 | 43 |
public class CurveSplitLineOperation implements SplitLineOperation { |
43 | 44 |
|
44 | 45 |
public Curve[] split(Geometry geometry, Point projectedPoint) |
45 |
throws CreateGeometryException, LocatorException,
|
|
46 |
GeometryOperationNotSupportedException, GeometryOperationException { |
|
47 |
|
|
46 |
throws LocatorException, |
|
47 |
GeometryOperationNotSupportedException, GeometryOperationException, GeometryException {
|
|
48 |
|
|
48 | 49 |
Curve lineToSplit = (Curve) geometry; |
50 |
if(!(lineToSplit instanceof Line)){ |
|
51 |
lineToSplit = (Curve) lineToSplit.toLines().getPrimitiveAt(0); |
|
52 |
} |
|
49 | 53 |
|
50 | 54 |
int subtype = geometry.getGeometryType().getSubType(); |
51 | 55 |
|
... | ... | |
79 | 83 |
} |
80 | 84 |
|
81 | 85 |
return new Curve[] { splittedLine1, splittedLine2 }; |
82 |
|
|
83 |
|
|
86 |
|
|
87 |
|
|
84 | 88 |
} |
85 | 89 |
|
86 | 90 |
} |
Also available in: Unified diff