Class ExtendLineOperationUtils
java.lang.Object
org.gvsig.vectorediting.lib.prov.extendline.operation.ExtendLineOperationUtils
- Author:
- llmarques
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.gvsig.fmap.geom.primitive.PointarcIntersection(org.gvsig.fmap.geom.primitive.Arc arcToBeExtended, String sideToExtend, org.gvsig.fmap.dal.feature.FeatureSelection boundaryObjects) Calculates the nearest intersection point among arc and boundary objects depending on side received as parameter.Strategy: 1- Create a full arc with the same center and radius of arc received by parameter.2- Iterate over boundary objects.3- If some boundary object intersects with full arc, calculates the distance to start point or end point depending on side to be extend.4- Return the nearest intersection point.static org.gvsig.fmap.geom.primitive.PointarcIntersection(org.gvsig.fmap.geom.primitive.Arc arcToBeExtended, String sideToExtend, org.gvsig.fmap.geom.Geometry boundaryObject) Calculates the nearest intersection point among arc and boundary objects depending on side received as parameter.Strategy: 1- Create a full arc with the same center and radius of arc received by parameter.2- Iterate over boundary objects.3- If some boundary object intersects with full arc, calculates the distance to start point or end point depending on side to be extend.4- Return the nearest intersection point.static org.gvsig.fmap.geom.primitive.PointcurveIntersection(org.gvsig.fmap.geom.primitive.Curve line, String sideToExtend, org.gvsig.fmap.dal.feature.FeatureSelection boundaryObjects) Calculates the nearest intersection among curve and boundary objects depending on side received as parameter.static org.gvsig.fmap.geom.primitive.PointcurveIntersection(org.gvsig.fmap.geom.primitive.Curve line, String sideToExtend, org.gvsig.fmap.geom.Geometry boundaryObject) Calculates the nearest intersection among curve and boundary objects depending on side received as parameter.static doublegetAngle(org.gvsig.fmap.geom.primitive.Point start, org.gvsig.fmap.geom.primitive.Point end) static org.gvsig.fmap.geom.primitive.PointgetIntersectionOfProjectedLine(org.gvsig.fmap.geom.primitive.Point initPoint, org.gvsig.fmap.geom.primitive.Point endPoint, org.gvsig.fmap.dal.feature.FeatureSelection boundaryObjects) Gets intersection among the line formed by initPoint and endPoint and boundary objects.If line or its projection does not intersect with any boundary object return null.Strategy: 1- Get module of line to determine if an intersection point already be vertex of line.If the distance between intersection point and start point of line is less than module indicates that intersection point already be curve point.2- Project line with the line parametric equation. 3- Iterate over boundary objects. 4- Check if boundary object does not contains end point of projected line. 5- If projected line intersects with any boundary object, get the nearest intersection point 6- Return it.static org.gvsig.fmap.geom.primitive.PointgetIntersectionOfProjectedLine(org.gvsig.fmap.geom.primitive.Point initPoint, org.gvsig.fmap.geom.primitive.Point endPoint, org.gvsig.fmap.geom.Geometry boundaryObject) Gets intersection among the line formed by initPoint and endPoint and boundary object.If line or its projection does not intersect with boundary object return null.Strategy: 1- Get module of line to determine if an intersection point already be vertex of line.If the distance between intersection point and start point of line is less than module indicates that intersection point already be curve point.2- Project line with the line parametric equation. 3- Check if boundary object does not contains end point of projected line. 5- If projected line intersects with boundary object, get the nearest intersection point 6- Return it.static ExtendLineOperationgetOperation(org.gvsig.fmap.geom.primitive.Primitive geom) static voidregister(ExtendLineOperation operation, int geometryType)
-
Field Details
-
START_SIDE
Use it to indicate start side should be extended- See Also:
-
END_SIDE
Use it to indicate end side should be extended- See Also:
-
-
Constructor Details
-
ExtendLineOperationUtils
public ExtendLineOperationUtils()
-
-
Method Details
-
register
-
getOperation
-
curveIntersection
public static org.gvsig.fmap.geom.primitive.Point curveIntersection(org.gvsig.fmap.geom.primitive.Curve line, String sideToExtend, org.gvsig.fmap.dal.feature.FeatureSelection boundaryObjects) throws org.gvsig.fmap.geom.exception.CreateGeometryException, org.gvsig.fmap.dal.exception.DataException, org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException, org.gvsig.fmap.geom.operation.GeometryOperationException Calculates the nearest intersection among curve and boundary objects depending on side received as parameter.- Parameters:
line- to be extendedsideToExtend- What side will be extend. UseSTART_SIDEandEND_SIDEboundaryObjects- to calculate intersection points.- Returns:
- the nearest intersection point. Return Null if arc does not intersect with any boundary object
- Throws:
org.gvsig.fmap.geom.exception.CreateGeometryExceptionorg.gvsig.fmap.dal.exception.DataExceptionorg.gvsig.fmap.geom.operation.GeometryOperationNotSupportedExceptionorg.gvsig.fmap.geom.operation.GeometryOperationException
-
curveIntersection
public static org.gvsig.fmap.geom.primitive.Point curveIntersection(org.gvsig.fmap.geom.primitive.Curve line, String sideToExtend, org.gvsig.fmap.geom.Geometry boundaryObject) throws org.gvsig.fmap.geom.GeometryException, org.gvsig.fmap.dal.exception.DataException, org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException, org.gvsig.fmap.geom.operation.GeometryOperationException Calculates the nearest intersection among curve and boundary objects depending on side received as parameter.- Parameters:
line- to be extendedsideToExtend- What side will be extend. UseSTART_SIDEandEND_SIDEboundaryObject- to calculate intersection points.- Returns:
- the nearest intersection point. Return Null if arc does not intersect with any boundary object
- Throws:
org.gvsig.fmap.geom.exception.CreateGeometryExceptionorg.gvsig.fmap.dal.exception.DataExceptionorg.gvsig.fmap.geom.operation.GeometryOperationNotSupportedExceptionorg.gvsig.fmap.geom.operation.GeometryOperationExceptionorg.gvsig.fmap.geom.GeometryException
-
arcIntersection
public static org.gvsig.fmap.geom.primitive.Point arcIntersection(org.gvsig.fmap.geom.primitive.Arc arcToBeExtended, String sideToExtend, org.gvsig.fmap.dal.feature.FeatureSelection boundaryObjects) throws org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException, org.gvsig.fmap.geom.operation.GeometryOperationException, org.gvsig.fmap.geom.exception.CreateGeometryException, org.gvsig.fmap.dal.exception.DataException Calculates the nearest intersection point among arc and boundary objects depending on side received as parameter.Strategy: 1- Create a full arc with the same center and radius of arc received by parameter.2- Iterate over boundary objects.3- If some boundary object intersects with full arc, calculates the distance to start point or end point depending on side to be extend.4- Return the nearest intersection point.- Parameters:
arcToBeExtended- Arc to be extendedsideToExtend- What side will be extend. UseSTART_SIDEandEND_SIDEboundaryObjects- to calculate intersection points.- Returns:
- the nearest intersection point. Return Null if arc does not intersect with any boundary object
- Throws:
org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedExceptionorg.gvsig.fmap.geom.operation.GeometryOperationExceptionorg.gvsig.fmap.geom.exception.CreateGeometryExceptionorg.gvsig.fmap.dal.exception.DataException
-
arcIntersection
public static org.gvsig.fmap.geom.primitive.Point arcIntersection(org.gvsig.fmap.geom.primitive.Arc arcToBeExtended, String sideToExtend, org.gvsig.fmap.geom.Geometry boundaryObject) throws org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException, org.gvsig.fmap.geom.operation.GeometryOperationException, org.gvsig.fmap.geom.exception.CreateGeometryException, org.gvsig.fmap.dal.exception.DataException Calculates the nearest intersection point among arc and boundary objects depending on side received as parameter.Strategy: 1- Create a full arc with the same center and radius of arc received by parameter.2- Iterate over boundary objects.3- If some boundary object intersects with full arc, calculates the distance to start point or end point depending on side to be extend.4- Return the nearest intersection point.- Parameters:
arcToBeExtended- Arc to be extendedsideToExtend- What side will be extend. UseSTART_SIDEandEND_SIDEboundaryObject- to calculate intersection points.- Returns:
- the nearest intersection point. Return Null if arc does not intersect with any boundary object
- Throws:
org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedExceptionorg.gvsig.fmap.geom.operation.GeometryOperationExceptionorg.gvsig.fmap.geom.exception.CreateGeometryExceptionorg.gvsig.fmap.dal.exception.DataException
-
getAngle
public static double getAngle(org.gvsig.fmap.geom.primitive.Point start, org.gvsig.fmap.geom.primitive.Point end) throws org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException, org.gvsig.fmap.geom.operation.GeometryOperationException - Throws:
org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedExceptionorg.gvsig.fmap.geom.operation.GeometryOperationException
-
getIntersectionOfProjectedLine
public static org.gvsig.fmap.geom.primitive.Point getIntersectionOfProjectedLine(org.gvsig.fmap.geom.primitive.Point initPoint, org.gvsig.fmap.geom.primitive.Point endPoint, org.gvsig.fmap.dal.feature.FeatureSelection boundaryObjects) throws org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException, org.gvsig.fmap.geom.operation.GeometryOperationException, org.gvsig.fmap.dal.exception.DataException, org.gvsig.fmap.geom.exception.CreateGeometryException Gets intersection among the line formed by initPoint and endPoint and boundary objects.If line or its projection does not intersect with any boundary object return null.Strategy: 1- Get module of line to determine if an intersection point already be vertex of line.If the distance between intersection point and start point of line is less than module indicates that intersection point already be curve point.2- Project line with the line parametric equation. 3- Iterate over boundary objects. 4- Check if boundary object does not contains end point of projected line. 5- If projected line intersects with any boundary object, get the nearest intersection point 6- Return it.- Parameters:
initPoint- of curve to extendendPoint- end point of curve to extendboundaryObjects- to calculate intersection points.- Returns:
- the nearest intersection point. Return Null if arc does not intersect with any boundary object
- Throws:
org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedExceptionorg.gvsig.fmap.geom.operation.GeometryOperationExceptionorg.gvsig.fmap.dal.exception.DataExceptionorg.gvsig.fmap.geom.exception.CreateGeometryException
-
getIntersectionOfProjectedLine
public static org.gvsig.fmap.geom.primitive.Point getIntersectionOfProjectedLine(org.gvsig.fmap.geom.primitive.Point initPoint, org.gvsig.fmap.geom.primitive.Point endPoint, org.gvsig.fmap.geom.Geometry boundaryObject) throws org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException, org.gvsig.fmap.geom.operation.GeometryOperationException, org.gvsig.fmap.dal.exception.DataException, org.gvsig.fmap.geom.GeometryException Gets intersection among the line formed by initPoint and endPoint and boundary object.If line or its projection does not intersect with boundary object return null.Strategy: 1- Get module of line to determine if an intersection point already be vertex of line.If the distance between intersection point and start point of line is less than module indicates that intersection point already be curve point.2- Project line with the line parametric equation. 3- Check if boundary object does not contains end point of projected line. 5- If projected line intersects with boundary object, get the nearest intersection point 6- Return it.- Parameters:
initPoint- of curve to extendendPoint- end point of curve to extendboundaryObject- to calculate intersection points.- Returns:
- the nearest intersection point. Return Null if arc does not intersect with any boundary object
- Throws:
org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedExceptionorg.gvsig.fmap.geom.operation.GeometryOperationExceptionorg.gvsig.fmap.dal.exception.DataExceptionorg.gvsig.fmap.geom.exception.CreateGeometryExceptionorg.gvsig.fmap.geom.GeometryException
-