@Override public boolean equals(Object o) { if (!(o instanceof dXYdZSolid)) return false; dXYdZSolid other = (dXYdZSolid) o; if (!super.equals(other) || surfacePoints.length != other.surfacePoints.length ) { return false; } for (int i = 0; i < surfacePoints.length; i++) { if (!surfacePoints[i].equals(other.surfacePoints[i])) return false; } return true; }
@Override public int hashCode() { int result = super.hashCode(); for (final GeoPoint p : surfacePoints) { result = 31 * result + p.hashCode(); } return result; }
@Override public abstract boolean isWithin(final double x, final double y, final double z);
/** Determine the relationship between a shape and this area's * edgepoints. *@param path is the shape. *@return the relationship. */ protected int isAreaInsideShape(final GeoShape path) { final GeoPoint[] edgePoints = getEdgePoints(); if (edgePoints.length == 0) { return NO_EDGEPOINTS; } boolean foundOutside = false; boolean foundInside = false; for (final GeoPoint p : edgePoints) { if (path.isWithin(p)) { foundInside = true; } else { foundOutside = true; } if (foundInside && foundOutside) { return SOME_INSIDE; } } if (!foundInside && !foundOutside) return NONE_INSIDE; if (foundInside && !foundOutside) return ALL_INSIDE; if (foundOutside && !foundInside) return NONE_INSIDE; return SOME_INSIDE; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (isOnSurface?1:0); if (isOnSurface) { result = 31 * result + thePoint.hashCode(); } return result; }
@Override public boolean equals(Object o) { if (!(o instanceof dXdYdZSolid)) return false; dXdYdZSolid other = (dXdYdZSolid) o; if (!super.equals(other) || other.isOnSurface != isOnSurface) { return false; } if (isOnSurface) { return other.thePoint.equals(thePoint); } return true; }
/** Determine the relationship between this area and the provided * shape's edgepoints. *@param path is the shape. *@return the relationship. */ protected int isShapeInsideArea(final GeoShape path) { final GeoPoint[] pathPoints = path.getEdgePoints(); if (pathPoints.length == 0) return NO_EDGEPOINTS; boolean foundOutside = false; boolean foundInside = false; for (final GeoPoint p : pathPoints) { if (isWithin(p)) { foundInside = true; } else { foundOutside = true; } if (foundInside && foundOutside) { return SOME_INSIDE; } } if (!foundInside && !foundOutside) return NONE_INSIDE; if (foundInside && !foundOutside) return ALL_INSIDE; if (foundOutside && !foundInside) return NONE_INSIDE; return SOME_INSIDE; }
@Override public int hashCode() { int result = super.hashCode(); for (final GeoPoint p : surfacePoints) { result = 31 * result + p.hashCode(); } return result; }
@Override public boolean equals(Object o) { if (!(o instanceof XdYdZSolid)) return false; XdYdZSolid other = (XdYdZSolid) o; if (!super.equals(other) || surfacePoints.length != other.surfacePoints.length ) { return false; } for (int i = 0; i < surfacePoints.length; i++) { if (!surfacePoints[i].equals(other.surfacePoints[i])) return false; } return true; }
@Override public int hashCode() { int result = super.hashCode(); for (final GeoPoint p : surfacePoints) { result = 31 * result + p.hashCode(); } return result; }
@Override public boolean equals(Object o) { if (!(o instanceof dXdYZSolid)) return false; dXdYZSolid other = (dXdYZSolid) o; if (!super.equals(other) || surfacePoints.length != other.surfacePoints.length ) { return false; } for (int i = 0; i < surfacePoints.length; i++) { if (!surfacePoints[i].equals(other.surfacePoints[i])) return false; } return true; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + minXPlane.hashCode(); result = 31 * result + maxXPlane.hashCode(); result = 31 * result + minYPlane.hashCode(); result = 31 * result + maxYPlane.hashCode(); result = 31 * result + zPlane.hashCode(); return result; }
@Override public boolean equals(Object o) { if (!(o instanceof XdYZSolid)) return false; XdYZSolid other = (XdYZSolid) o; if (!super.equals(other)) { return false; } return other.minXPlane.equals(minXPlane) && other.maxXPlane.equals(maxXPlane) && other.yPlane.equals(yPlane) && other.minZPlane.equals(minZPlane) && other.maxZPlane.equals(maxZPlane); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + minXPlane.hashCode(); result = 31 * result + maxXPlane.hashCode(); result = 31 * result + yPlane.hashCode(); result = 31 * result + minZPlane.hashCode(); result = 31 * result + maxZPlane.hashCode(); return result; }
@Override public boolean equals(Object o) { if (!(o instanceof XYdZSolid)) return false; XYdZSolid other = (XYdZSolid) o; if (!super.equals(other)) { return false; } return other.minXPlane.equals(minXPlane) && other.maxXPlane.equals(maxXPlane) && other.minYPlane.equals(minYPlane) && other.maxYPlane.equals(maxYPlane) && other.zPlane.equals(zPlane); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + xPlane.hashCode(); result = 31 * result + minYPlane.hashCode(); result = 31 * result + maxYPlane.hashCode(); result = 31 * result + minZPlane.hashCode(); result = 31 * result + maxZPlane.hashCode(); return result; }
@Override public boolean equals(Object o) { if (!(o instanceof dXYZSolid)) return false; dXYZSolid other = (dXYZSolid) o; if (!super.equals(other)) { return false; } return other.xPlane.equals(xPlane) && other.minYPlane.equals(minYPlane) && other.maxYPlane.equals(maxYPlane) && other.minZPlane.equals(minZPlane) && other.maxZPlane.equals(maxZPlane); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (isWholeWorld?1:0); if (!isWholeWorld) { result = 31 * result + minXPlane.hashCode(); result = 31 * result + maxXPlane.hashCode(); result = 31 * result + minYPlane.hashCode(); result = 31 * result + maxYPlane.hashCode(); result = 31 * result + minZPlane.hashCode(); result = 31 * result + maxZPlane.hashCode(); } return result; }
@Override public boolean equals(Object o) { if (!(o instanceof StandardXYZSolid)) return false; StandardXYZSolid other = (StandardXYZSolid) o; if (!super.equals(other) || other.isWholeWorld != isWholeWorld) { return false; } if (!isWholeWorld) { return other.minXPlane.equals(minXPlane) && other.maxXPlane.equals(maxXPlane) && other.minYPlane.equals(minYPlane) && other.maxYPlane.equals(maxYPlane) && other.minZPlane.equals(minZPlane) && other.maxZPlane.equals(maxZPlane); } return true; }