mirror of
https://github.com/apache/lucene.git
synced 2025-02-10 03:55:46 +00:00
Flesh out remaining methods
This commit is contained in:
parent
3a0dbbee5a
commit
f9a4a08ce0
@ -254,8 +254,25 @@ class GeoComplexPolygon extends GeoBasePolygon {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected double outsideDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
|
protected double outsideDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
|
||||||
// MHL
|
double minimumDistance = Double.MAX_VALUE;
|
||||||
return 0.0;
|
for (final Edge shapeStartEdge : shapeStartEdges) {
|
||||||
|
Edge shapeEdge = shapeStartEdge;
|
||||||
|
while (true) {
|
||||||
|
final double newDist = distanceStyle.computeDistance(shapeEdge.startPoint, x, y, z);
|
||||||
|
if (newDist < minimumDistance) {
|
||||||
|
minimumDistance = newDist;
|
||||||
|
}
|
||||||
|
final double newPlaneDist = distanceStyle.computeDistance(planetModel, shapeEdge.plane, x, y, z, shapeEdge.startPlane, shapeEdge.endPlane);
|
||||||
|
if (newPlaneDist < minimumDistance) {
|
||||||
|
minimumDistance = newPlaneDist;
|
||||||
|
}
|
||||||
|
shapeEdge = shapeEdge.next;
|
||||||
|
if (shapeEdge == shapeStartEdge) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return minimumDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1002,19 +1019,19 @@ class GeoComplexPolygon extends GeoBasePolygon {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
// MHL
|
// Way too expensive to do this the hard way, so each complex polygon will be considered unique.
|
||||||
return false;
|
return this == o;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
// MHL
|
// Each complex polygon is considered unique.
|
||||||
return 0;
|
return System.identityHashCode(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "GeoComplexPolygon: {planetmodel=" + planetModel + "}";
|
return "GeoComplexPolygon: {planetmodel=" + planetModel + ", number of shapes="+shapeStartEdges.length+", address="+ Integer.toHexString(hashCode())+"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user