Package org.apache.lucene.spatial3d.geom
Class StandardXYZSolid
- java.lang.Object
-
- org.apache.lucene.spatial3d.geom.BasePlanetObject
-
- org.apache.lucene.spatial3d.geom.BaseXYZSolid
-
- org.apache.lucene.spatial3d.geom.StandardXYZSolid
-
- All Implemented Interfaces:
GeoArea,Membership,PlanetObject,SerializableObject,XYZSolid
class StandardXYZSolid extends BaseXYZSolid
3D rectangle, bounded on six sides by X,Y,Z limits
-
-
Field Summary
Fields Modifier and Type Field Description protected GeoPoint[]edgePointsThese are the edge points of the shape, which are defined to be at least one point on each surface area boundary.protected booleanisWholeWorldWhole world?protected doublemaxXMax-Xprotected SidedPlanemaxXPlaneMax-X planeprotected booleanmaxXPlaneIntersectstrue if maxXPlane intersects globeprotected doublemaxYMax-Yprotected SidedPlanemaxYPlaneMax-Y planeprotected booleanmaxYPlaneIntersectstrue if maxYPlane intersects globeprotected doublemaxZMax-Zprotected SidedPlanemaxZPlaneMax-Z planeprotected booleanmaxZPlaneIntersectstrue if maxZPlane intersects globeprotected doubleminXMin-Xprotected SidedPlaneminXPlaneMin-X planeprotected booleanminXPlaneIntersectstrue if minXPlane intersects globeprotected doubleminYMin-Yprotected SidedPlaneminYPlaneMin-Y planeprotected booleanminYPlaneIntersectstrue if minYPlane intersects globeprotected doubleminZMin-Zprotected SidedPlaneminZPlaneMin-Z planeprotected booleanminZPlaneIntersectstrue if minZPlane intersects globeprotected GeoPoint[]notableMaxXPointsNotable points for maxXPlaneprotected GeoPoint[]notableMaxYPointsNotable points for maxYPlaneprotected GeoPoint[]notableMaxZPointsNotable points for maxZPlaneprotected GeoPoint[]notableMinXPointsNotable points for minXPlaneprotected GeoPoint[]notableMinYPointsNotable points for minYPlaneprotected GeoPoint[]notableMinZPointsNotable points for minZPlane-
Fields inherited from class org.apache.lucene.spatial3d.geom.BaseXYZSolid
ALL_INSIDE, EMPTY_POINTS, NO_EDGEPOINTS, NONE_INSIDE, SOME_INSIDE, xUnitVector, xVerticalPlane, yUnitVector, yVerticalPlane, zUnitVector
-
Fields inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
planetModel
-
-
Constructor Summary
Constructors Constructor Description StandardXYZSolid(PlanetModel planetModel, double minX, double maxX, double minY, double maxY, double minZ, double maxZ)Sole constructorStandardXYZSolid(PlanetModel planetModel, java.io.InputStream inputStream)Constructor for deserialization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)protected GeoPoint[]getEdgePoints()Get the edge points for this shape.intgetRelationship(GeoShape path)Find the spatial relationship between a shape and the current geo area.inthashCode()booleanisWithin(double x, double y, double z)Check if a point is within this shape.java.lang.StringtoString()voidwrite(java.io.OutputStream outputStream)Serialize to output stream.-
Methods inherited from class org.apache.lucene.spatial3d.geom.BaseXYZSolid
glueTogether, isAreaInsideShape, isShapeInsideArea, isWithin
-
Methods inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
getPlanetModel
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.PlanetObject
getPlanetModel
-
-
-
-
Field Detail
-
minX
protected final double minX
Min-X
-
maxX
protected final double maxX
Max-X
-
minY
protected final double minY
Min-Y
-
maxY
protected final double maxY
Max-Y
-
minZ
protected final double minZ
Min-Z
-
maxZ
protected final double maxZ
Max-Z
-
isWholeWorld
protected final boolean isWholeWorld
Whole world?
-
minXPlane
protected final SidedPlane minXPlane
Min-X plane
-
maxXPlane
protected final SidedPlane maxXPlane
Max-X plane
-
minYPlane
protected final SidedPlane minYPlane
Min-Y plane
-
maxYPlane
protected final SidedPlane maxYPlane
Max-Y plane
-
minZPlane
protected final SidedPlane minZPlane
Min-Z plane
-
maxZPlane
protected final SidedPlane maxZPlane
Max-Z plane
-
minXPlaneIntersects
protected final boolean minXPlaneIntersects
true if minXPlane intersects globe
-
maxXPlaneIntersects
protected final boolean maxXPlaneIntersects
true if maxXPlane intersects globe
-
minYPlaneIntersects
protected final boolean minYPlaneIntersects
true if minYPlane intersects globe
-
maxYPlaneIntersects
protected final boolean maxYPlaneIntersects
true if maxYPlane intersects globe
-
minZPlaneIntersects
protected final boolean minZPlaneIntersects
true if minZPlane intersects globe
-
maxZPlaneIntersects
protected final boolean maxZPlaneIntersects
true if maxZPlane intersects globe
-
edgePoints
protected final GeoPoint[] edgePoints
These are the edge points of the shape, which are defined to be at least one point on each surface area boundary. In the case of a solid, this includes points which represent the intersection of XYZ bounding planes and the planet, as well as points representing the intersection of single bounding planes with the planet itself.
-
notableMinXPoints
protected final GeoPoint[] notableMinXPoints
Notable points for minXPlane
-
notableMaxXPoints
protected final GeoPoint[] notableMaxXPoints
Notable points for maxXPlane
-
notableMinYPoints
protected final GeoPoint[] notableMinYPoints
Notable points for minYPlane
-
notableMaxYPoints
protected final GeoPoint[] notableMaxYPoints
Notable points for maxYPlane
-
notableMinZPoints
protected final GeoPoint[] notableMinZPoints
Notable points for minZPlane
-
notableMaxZPoints
protected final GeoPoint[] notableMaxZPoints
Notable points for maxZPlane
-
-
Constructor Detail
-
StandardXYZSolid
public StandardXYZSolid(PlanetModel planetModel, double minX, double maxX, double minY, double maxY, double minZ, double maxZ)
Sole constructor- Parameters:
planetModel- is the planet model.minX- is the minimum X value.maxX- is the maximum X value.minY- is the minimum Y value.maxY- is the maximum Y value.minZ- is the minimum Z value.maxZ- is the maximum Z value.
-
StandardXYZSolid
public StandardXYZSolid(PlanetModel planetModel, java.io.InputStream inputStream) throws java.io.IOException
Constructor for deserialization.- Parameters:
planetModel- is the planet model.inputStream- is the input stream.- Throws:
java.io.IOException
-
-
Method Detail
-
write
public void write(java.io.OutputStream outputStream) throws java.io.IOExceptionDescription copied from interface:SerializableObjectSerialize to output stream.- Specified by:
writein interfaceSerializableObject- Overrides:
writein classBasePlanetObject- Parameters:
outputStream- is the output stream to write to.- Throws:
java.io.IOException
-
getEdgePoints
protected GeoPoint[] getEdgePoints()
Description copied from class:BaseXYZSolidGet the edge points for this shape.- Specified by:
getEdgePointsin classBaseXYZSolid- Returns:
- the edge points.
-
isWithin
public boolean isWithin(double x, double y, double z)Description copied from interface:MembershipCheck if a point is within this shape.- Specified by:
isWithinin interfaceMembership- Specified by:
isWithinin classBaseXYZSolid- Parameters:
x- is x coordinate of point to check.y- is y coordinate of point to check.z- is z coordinate of point to check.- Returns:
- true if the point is within this shape
-
getRelationship
public int getRelationship(GeoShape path)
Description copied from interface:GeoAreaFind the spatial relationship between a shape and the current geo area. Note: return value is how the GeoShape relates to the GeoArea, not the other way around. For example, if this GeoArea is entirely within the shape, then CONTAINS should be returned. If the shape is entirely enclosed by this GeoArea, then WITHIN should be returned.It is permissible to return OVERLAPS instead of WITHIN if the shape intersects with the area at even a single point. So, a circle inscribed in a rectangle could return either OVERLAPS or WITHIN, depending on implementation. It is not permissible to return CONTAINS or DISJOINT in this circumstance, however.
Similarly, it is permissible to return OVERLAPS instead of CONTAINS under conditions where the shape consists of multiple independent overlapping subshapes, and the area overlaps one of the subshapes. It is not permissible to return WITHIN or DISJOINT in this circumstance, however.
- Parameters:
path- is the shape to consider.- Returns:
- the relationship, from the perspective of the shape.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classBaseXYZSolid
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBaseXYZSolid
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-