Module org.apache.lucene.spatial3d
Package org.apache.lucene.spatial3d.geom
Class GeoDegeneratePath.SegmentEndpoint
- java.lang.Object
-
- org.apache.lucene.spatial3d.geom.BasePlanetObject
-
- org.apache.lucene.spatial3d.geom.GeoBaseBounds
-
- org.apache.lucene.spatial3d.geom.GeoDegeneratePath.SegmentEndpoint
-
- All Implemented Interfaces:
Bounded
,GeoBounds
,Membership
,PlanetObject
,SerializableObject
- Enclosing class:
- GeoDegeneratePath
private static class GeoDegeneratePath.SegmentEndpoint extends GeoBaseBounds
This is precalculated data for segment endpoint. Since the path is degenerate, there are several different cases:- The path consists of a single endpoint. In this case, the degenerate path consists of this one point.
- This is the end of a path. There is a bounding plane passed in which describes the part of the world that is considered to belong to this endpoint.
- Intersection. There are two cutoff planes, one for each end of the intersection.
-
-
Field Summary
Fields Modifier and Type Field Description Membership[]
cutoffPlanes
Pertinent cutoff planes from adjoining segmentsstatic Membership[]
NO_MEMBERSHIP
Null membershipGeoPoint
point
The center point of the endpoint-
Fields inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
planetModel
-
-
Constructor Summary
Constructors Constructor Description SegmentEndpoint(PlanetModel planetModel, GeoPoint point)
Constructor for case (1).SegmentEndpoint(PlanetModel planetModel, GeoPoint point, SidedPlane cutoffPlane)
Constructor for case (2).SegmentEndpoint(PlanetModel planetModel, GeoPoint point, SidedPlane cutoffPlane1, SidedPlane cutoffPlane2)
Constructor for case (3).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
void
getBounds(Bounds bounds)
Get the bounds for a segment endpoint.int
hashCode()
boolean
intersects(GeoShape geoShape)
Determine if this endpoint intersects a 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 endpoint.boolean
isWithinSection(double x, double y, double z)
Check if point is within this section's purview.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.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
getPlanetModel, 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
-
point
public final GeoPoint point
The center point of the endpoint
-
cutoffPlanes
public final Membership[] cutoffPlanes
Pertinent cutoff planes from adjoining segments
-
NO_MEMBERSHIP
public static final Membership[] NO_MEMBERSHIP
Null membership
-
-
Constructor Detail
-
SegmentEndpoint
public SegmentEndpoint(PlanetModel planetModel, GeoPoint point)
Constructor for case (1).- Parameters:
planetModel
- is the planet model.point
- is the center point.
-
SegmentEndpoint
public SegmentEndpoint(PlanetModel planetModel, GeoPoint point, SidedPlane cutoffPlane)
Constructor for case (2). Generate an endpoint, given a single cutoff plane plus upper and lower edge points.- Parameters:
point
- is the center point.cutoffPlane
- is the plane from the adjoining path segment marking the boundary between this endpoint and that segment.
-
SegmentEndpoint
public SegmentEndpoint(PlanetModel planetModel, GeoPoint point, SidedPlane cutoffPlane1, SidedPlane cutoffPlane2)
Constructor for case (3). Generate an endpoint, given two cutoff planes.- Parameters:
planetModel
- is the planet model.point
- is the center.cutoffPlane1
- is one adjoining path segment cutoff plane.cutoffPlane2
- is another adjoining path segment cutoff plane.
-
-
Method Detail
-
isWithin
public boolean isWithin(double x, double y, double z)
Check if point is within this endpoint.- 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)
Check if point is within this section's purview.- Parameters:
x
- is the point xy
- is the point yz
- is the point z- Returns:
- true if this point "belongs" to this section, falso otherwise.
-
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.
-
pathCenterDistance
public double pathCenterDistance(DistanceStyle distanceStyle, double x, double y, double z)
Compute path center 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, or POSITIVE_INFINITY if the point is not within the bounds of the endpoint.
-
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 GeoShape.- Parameters:
geoShape
- is the GeoShape.- Returns:
- true if there is shape intersect 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.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classBasePlanetObject
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBasePlanetObject
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-