@Override protected Iterator<Cell> createCellIteratorToIndex(Shape shape, int detailLevel, Iterator<Cell> reuse) { if (shape instanceof Point || !pruneLeafyBranches) return super.createCellIteratorToIndex(shape, detailLevel, reuse); List<Cell> cells = new ArrayList<>(4096); recursiveTraverseAndPrune(grid.getWorldCell(), shape, detailLevel, cells); return cells.iterator(); }
@Override protected Iterator<Cell> createCellIteratorToIndex(Shape shape, int detailLevel, Iterator<Cell> reuse) { if (!pruneLeafyBranches || isGridAlignedShape(shape)) return super.createCellIteratorToIndex(shape, detailLevel, reuse); List<Cell> cells = new ArrayList<>(4096); recursiveTraverseAndPrune(grid.getWorldCell(), shape, detailLevel, cells); return cells.iterator(); }
while (subCells.hasNext()) { Cell subCell = subCells.next(); if (recursiveTraverseAndPrune(subCell, shape, detailLevel, result)) leaves++;
while (subCells.hasNext()) { Cell subCell = subCells.next(); if (recursiveTraverseAndPrune(subCell, shape, detailLevel, result)) leaves++;