// Mark the outside trapezoids surrounding the polygon private void markOutside(Trapezoid t) { if (t.top == boundingBox.top || t.bottom == boundingBox.bottom) { t.trimNeighbors(); } }
// Recursively trim outside neighbors public void trimNeighbors() { if (inside) { inside = false; if (upperLeft != null) { upperLeft.trimNeighbors(); } if (lowerLeft != null) { lowerLeft.trimNeighbors(); } if (upperRight != null) { upperRight.trimNeighbors(); } if (lowerRight != null) { lowerRight.trimNeighbors(); } } }