Package org.apache.lucene.spatial3d.geom
Class GeoStandardPath.CutoffDualCircleSegmentEndpoint
- java.lang.Object
-
- org.apache.lucene.spatial3d.geom.GeoStandardPath.BaseSegmentEndpoint
-
- org.apache.lucene.spatial3d.geom.GeoStandardPath.CutoffDualCircleSegmentEndpoint
-
- All Implemented Interfaces:
GeoStandardPath.SegmentEndpoint
- Enclosing class:
- GeoStandardPath
private static class GeoStandardPath.CutoffDualCircleSegmentEndpoint extends GeoStandardPath.BaseSegmentEndpoint
Endpoint that's a dual circle with cutoff(s). This SegmentEndpoint is used when we have two adjoining segments that are not colinear, and when we are on a non-spherical world. (1) We construct two circles. Each circle uses the two segment endpoints for one of the two segments, plus the one segment endpoint that is on the other side of the segment's cutoff plane. (2) isWithin() is computed using both circles, using just the portion that is within both segments' cutoff planes. If either matches, the point is included. (3) intersects() is computed using both circles, with similar cutoffs. (4) bounds() uses both circles too.
-
-
Field Summary
Fields Modifier and Type Field Description protected SidedPlanecirclePlane1First circleprotected SidedPlanecirclePlane2Second circleprotected Membership[]cutoffPlanesBoth cutoff planes are included hereprotected GeoPoint[]notablePoints1Notable points for first circleprotected GeoPoint[]notablePoints2Notable points for second circle-
Fields inherited from class org.apache.lucene.spatial3d.geom.GeoStandardPath.BaseSegmentEndpoint
NO_MEMBERSHIP, point
-
-
Constructor Summary
Constructors Constructor Description CutoffDualCircleSegmentEndpoint(GeoPoint point, SidedPlane prevCutoffPlane, SidedPlane nextCutoffPlane, GeoPoint prevURHC, GeoPoint prevLRHC, GeoPoint currentULHC, GeoPoint currentLLHC)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgetBounds(PlanetModel planetModel, Bounds bounds)Get the bounds for a segment endpoint.booleanintersects(GeoShape geoShape)Determine if this endpoint intersects a GeoShape.booleanintersects(PlanetModel planetModel, Plane p, GeoPoint[] notablePoints, Membership[] bounds)Determine if this endpoint intersects a specified plane.booleanisWithin(double x, double y, double z)Check if point is within this endpoint.booleanisWithin(Vector point)Check if point is within this endpoint.doublenearestPathDistance(DistanceStyle distanceStyle, double x, double y, double z)Compute nearest path distance.doublepathCenterDistance(DistanceStyle distanceStyle, double x, double y, double z)Compute path center distance.-
Methods inherited from class org.apache.lucene.spatial3d.geom.GeoStandardPath.BaseSegmentEndpoint
equals, hashCode, outsideDistance, pathDeltaDistance, pathDistance, toString
-
-
-
-
Field Detail
-
circlePlane1
protected final SidedPlane circlePlane1
First circle
-
circlePlane2
protected final SidedPlane circlePlane2
Second circle
-
notablePoints1
protected final GeoPoint[] notablePoints1
Notable points for first circle
-
notablePoints2
protected final GeoPoint[] notablePoints2
Notable points for second circle
-
cutoffPlanes
protected final Membership[] cutoffPlanes
Both cutoff planes are included here
-
-
Constructor Detail
-
CutoffDualCircleSegmentEndpoint
public CutoffDualCircleSegmentEndpoint(GeoPoint point, SidedPlane prevCutoffPlane, SidedPlane nextCutoffPlane, GeoPoint prevURHC, GeoPoint prevLRHC, GeoPoint currentULHC, GeoPoint currentLLHC)
-
-
Method Detail
-
isWithin
public boolean isWithin(Vector point)
Description copied from interface:GeoStandardPath.SegmentEndpointCheck if point is within this endpoint.- Specified by:
isWithinin interfaceGeoStandardPath.SegmentEndpoint- Overrides:
isWithinin classGeoStandardPath.BaseSegmentEndpoint- Parameters:
point- is the point.- Returns:
- true of within.
-
isWithin
public boolean isWithin(double x, double y, double z)Description copied from interface:GeoStandardPath.SegmentEndpointCheck if point is within this endpoint.- Specified by:
isWithinin interfaceGeoStandardPath.SegmentEndpoint- Overrides:
isWithinin classGeoStandardPath.BaseSegmentEndpoint- Parameters:
x- is the point x.y- is the point y.z- is the point z.- Returns:
- true of within.
-
nearestPathDistance
public double nearestPathDistance(DistanceStyle distanceStyle, double x, double y, double z)
Description copied from interface:GeoStandardPath.SegmentEndpointCompute nearest path distance.- Specified by:
nearestPathDistancein interfaceGeoStandardPath.SegmentEndpoint- Overrides:
nearestPathDistancein classGeoStandardPath.BaseSegmentEndpoint- Parameters:
distanceStyle- is the distance style.x- is the point x.y- is the point y.z- is the point z.- Returns:
- the distance metric (always value zero), in aggregation form, or POSITIVE_INFINITY if the point is not within the bounds of the endpoint.
-
pathCenterDistance
public double pathCenterDistance(DistanceStyle distanceStyle, double x, double y, double z)
Description copied from interface:GeoStandardPath.SegmentEndpointCompute path center distance.- Specified by:
pathCenterDistancein interfaceGeoStandardPath.SegmentEndpoint- Overrides:
pathCenterDistancein classGeoStandardPath.BaseSegmentEndpoint- Parameters:
distanceStyle- is the distance style.x- is the point x.y- is the point y.z- is the point z.- Returns:
- the distance metric, or POSITIVE_INFINITY if the point is not within the bounds of the endpoint.
-
intersects
public boolean intersects(PlanetModel planetModel, Plane p, GeoPoint[] notablePoints, Membership[] bounds)
Description copied from interface:GeoStandardPath.SegmentEndpointDetermine if this endpoint intersects a specified plane.- Specified by:
intersectsin interfaceGeoStandardPath.SegmentEndpoint- Overrides:
intersectsin classGeoStandardPath.BaseSegmentEndpoint- Parameters:
planetModel- is the planet model.p- is the plane.notablePoints- are the points associated with the plane.bounds- are any bounds which the intersection must lie within.- Returns:
- true if there is a matching intersection.
-
intersects
public boolean intersects(GeoShape geoShape)
Description copied from interface:GeoStandardPath.SegmentEndpointDetermine if this endpoint intersects a GeoShape.- Specified by:
intersectsin interfaceGeoStandardPath.SegmentEndpoint- Overrides:
intersectsin classGeoStandardPath.BaseSegmentEndpoint- Parameters:
geoShape- is the GeoShape.- Returns:
- true if there is shape intersect this endpoint.
-
getBounds
public void getBounds(PlanetModel planetModel, Bounds bounds)
Description copied from interface:GeoStandardPath.SegmentEndpointGet the bounds for a segment endpoint.- Specified by:
getBoundsin interfaceGeoStandardPath.SegmentEndpoint- Overrides:
getBoundsin classGeoStandardPath.BaseSegmentEndpoint- Parameters:
planetModel- is the planet model.bounds- are the bounds to be modified.
-
-