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
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
FieldsModifier and TypeFieldDescriptionfinal Membership[]
Pertinent cutoff planes from adjoining segmentsstatic final Membership[]
Null membershipfinal GeoPoint
The center point of the endpointFields inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
planetModel
-
Constructor Summary
ConstructorsConstructorDescriptionSegmentEndpoint
(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
Modifier and TypeMethodDescriptionboolean
void
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.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 Details
-
point
The center point of the endpoint -
cutoffPlanes
Pertinent cutoff planes from adjoining segments -
NO_MEMBERSHIP
Null membership
-
-
Constructor Details
-
SegmentEndpoint
Constructor for case (1).- Parameters:
planetModel
- is the planet model.point
- is the center point.
-
SegmentEndpoint
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 Details
-
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
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
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
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
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
Determine if this endpoint intersects a GeoShape.- Parameters:
geoShape
- is the GeoShape.- Returns:
- true if there is shape intersect this endpoint.
-
getBounds
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
- Overrides:
equals
in classBasePlanetObject
-
hashCode
public int hashCode()- Overrides:
hashCode
in classBasePlanetObject
-
toString
-