Module org.apache.lucene.spatial3d
Package org.apache.lucene.spatial3d.geom
Class GeoDegeneratePath.PathSegment
- java.lang.Object
-
- org.apache.lucene.spatial3d.geom.BasePlanetObject
-
- org.apache.lucene.spatial3d.geom.GeoBaseBounds
-
- org.apache.lucene.spatial3d.geom.GeoDegeneratePath.PathSegment
-
- All Implemented Interfaces:
Bounded
,GeoBounds
,Membership
,PlanetObject
,SerializableObject
- Enclosing class:
- GeoDegeneratePath
private static class GeoDegeneratePath.PathSegment extends GeoBaseBounds
This is the pre-calculated data for a path segment.
-
-
Field Summary
Fields Modifier and Type Field Description GeoPoint[]
connectingPlanePoints
Notable points for the connecting planeGeoPoint
end
End point of the segmentSidedPlane
endCutoffPlane
Plane going through the center and end point, marking the end edge of the segmentjava.util.Map<DistanceStyle,java.lang.Double>
fullDistanceCache
Place to keep any complete segment distances we've calculated so farPlane
normalizedConnectingPlane
Normalized plane connecting the two points and going through world centerGeoPoint
start
Starting point of the segmentSidedPlane
startCutoffPlane
Plane going through the center and start point, marking the start edge of the segment-
Fields inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
planetModel
-
-
Constructor Summary
Constructors Constructor Description PathSegment(PlanetModel planetModel, GeoPoint start, GeoPoint end, Plane normalizedConnectingPlane)
Construct a path segment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
fullPathDistance(DistanceStyle distanceStyle)
Compute the full distance along this path segment.void
getBounds(Bounds bounds)
Get the bounds for a segment endpoint.boolean
intersects(GeoShape geoShape)
Determine if this endpoint intersects a specified GeoShape.boolean
intersects(Plane p, GeoPoint[] notablePoints, Membership[] bounds)
Determine if this endpoint intersects a specified plane.boolean
isWithin(double x, double y, double z)
Check if point is within this segment.boolean
isWithinSection(double x, double y, double z)
double
nearestPathDistance(DistanceStyle distanceStyle, double x, double y, double z)
Compute nearest path distance (distance from start of segment to center line point adjacent).double
outsideDistance(DistanceStyle distanceStyle, double x, double y, double z)
Compute external distance.double
pathCenterDistance(DistanceStyle distanceStyle, double x, double y, double z)
Compute path center distance (distance from path to current point).double
pathDistance(DistanceStyle distanceStyle, double x, double y, double z)
Compute interior path distance.java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
equals, getPlanetModel, hashCode, write
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.Membership
isWithin
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.PlanetObject
getPlanetModel
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.SerializableObject
write
-
-
-
-
Field Detail
-
start
public final GeoPoint start
Starting point of the segment
-
end
public final GeoPoint end
End point of the segment
-
fullDistanceCache
public final java.util.Map<DistanceStyle,java.lang.Double> fullDistanceCache
Place to keep any complete segment distances we've calculated so far
-
normalizedConnectingPlane
public final Plane normalizedConnectingPlane
Normalized plane connecting the two points and going through world center
-
startCutoffPlane
public final SidedPlane startCutoffPlane
Plane going through the center and start point, marking the start edge of the segment
-
endCutoffPlane
public final SidedPlane endCutoffPlane
Plane going through the center and end point, marking the end edge of the segment
-
connectingPlanePoints
public final GeoPoint[] connectingPlanePoints
Notable points for the connecting plane
-
-
Constructor Detail
-
PathSegment
public PathSegment(PlanetModel planetModel, GeoPoint start, GeoPoint end, Plane normalizedConnectingPlane)
Construct a path segment.- Parameters:
planetModel
- is the planet model.start
- is the starting point.end
- is the ending point.normalizedConnectingPlane
- is the connecting plane.
-
-
Method Detail
-
fullPathDistance
public double fullPathDistance(DistanceStyle distanceStyle)
Compute the full distance along this path segment.- Parameters:
distanceStyle
- is the distance style.- Returns:
- the distance metric, in aggregation form.
-
isWithin
public boolean isWithin(double x, double y, double z)
Check if point is within this segment.- Parameters:
x
- is the point x.y
- is the point y.z
- is the point z.- Returns:
- true of within.
-
isWithinSection
public boolean isWithinSection(double x, double y, double z)
-
pathCenterDistance
public double pathCenterDistance(DistanceStyle distanceStyle, double x, double y, double z)
Compute path center distance (distance from path to current point).- 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 Double.POSITIVE_INFINITY if outside this segment
-
nearestPathDistance
public double nearestPathDistance(DistanceStyle distanceStyle, double x, double y, double z)
Compute nearest path distance (distance from start of segment to center line point adjacent).- 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, in aggregation form, or Double.POSITIVE_INFINITY if outside this segment
-
pathDistance
public double pathDistance(DistanceStyle distanceStyle, double x, double y, double z)
Compute interior path distance.- 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, in aggregation form.
-
outsideDistance
public double outsideDistance(DistanceStyle distanceStyle, double x, double y, double z)
Compute external distance.- 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.
-
intersects
public boolean intersects(Plane p, GeoPoint[] notablePoints, Membership[] bounds)
Determine if this endpoint intersects a specified plane.- Parameters:
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)
Determine if this endpoint intersects a specified GeoShape.- Parameters:
geoShape
- is the GeoShape.- Returns:
- true if there GeoShape intersects this endpoint.
-
getBounds
public void getBounds(Bounds bounds)
Get the bounds for a segment endpoint.- Specified by:
getBounds
in interfaceBounded
- Overrides:
getBounds
in classGeoBaseBounds
- Parameters:
bounds
- are the bounds to be modified.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-