@Test public void testFindVisibleTiles() { List<TileBounds> visibleTiles = tree.findVisibleTiles(); Assert.assertEquals("incorrect number of visible tiles found in default tree", tileBoundsList.size(), visibleTiles.size()); final TileBounds reacquiredTile = new TileBounds("zzz-1", "1", 1.0, 5.0, 5.0, 25.0, 25.0); tileBoundsList.add(reacquiredTile); tree.addTile(reacquiredTile); visibleTiles = tree.findVisibleTiles(); Assert.assertEquals("incorrect number of visible tiles found in modified tree", (tileBoundsList.size() - 1), visibleTiles.size()); }
public List<TileBounds> findVisibleTiles() { final List<TileBounds> visibleTiles = new ArrayList<>(tileBoundsList.size()); List<TileBounds> intersectingTiles; for (final TileBounds tile : tileBoundsList) { intersectingTiles = findTilesInBox(tile.getMinX(), tile.getMinY(), tile.getMaxX(), tile.getMaxY()); if (! isCompletelyObscured(tile, intersectingTiles)) { visibleTiles.add(tile); } } return visibleTiles; }
TileBoundsRTree { public List<TileBounds> findVisibleTiles() { final List<TileBounds> visibleTiles = new ArrayList<>(tileBoundsList.size()); List<TileBounds> intersectingTiles; for (final TileBounds tile : tileBoundsList) { intersectingTiles = findTilesInBox(tile.getMinX(), tile.getMinY(), tile.getMaxX(), tile.getMaxY()); if (! isCompletelyObscured(tile, intersectingTiles)) { visibleTiles.add(tile); } } return visibleTiles; } }
TileBoundsRTree { public List<TileBounds> findVisibleTiles() { final List<TileBounds> visibleTiles = new ArrayList<>(tileBoundsList.size()); List<TileBounds> intersectingTiles; for (final TileBounds tile : tileBoundsList) { intersectingTiles = findTilesInBox(tile.getMinX(), tile.getMinY(), tile.getMaxX(), tile.getMaxY()); if (! isCompletelyObscured(tile, intersectingTiles)) { visibleTiles.add(tile); } } return visibleTiles; } TileBoundsRTree(final Double z,
                           final List<TileBounds> tileBoundsList); }
TileBoundsRTree { public List<TileBounds> findVisibleTiles() { final List<TileBounds> visibleTiles = new ArrayList<>(tileBoundsList.size()); List<TileBounds> intersectingTiles; for (final TileBounds tile : tileBoundsList) { intersectingTiles = findTilesInBox(tile.getMinX(), tile.getMinY(), tile.getMaxX(), tile.getMaxY()); if (! isCompletelyObscured(tile, intersectingTiles)) { visibleTiles.add(tile); } } return visibleTiles; } TileBoundsRTree(final Double z,
                           final List<TileBounds> tileBoundsList); int size(); List<TileBounds> getTileBoundsList(); void addTile(final TileBounds tileBounds); List<TileBounds> findTilesInBox(final double minX,
                                           final double minY,
                                           final double maxX,
                                           final double maxY); List<TileBounds> findCompletelyObscuredTiles(); List<TileBounds> findVisibleTiles(); List<TileBounds> findTilesNearestToBox(final double minX,
                                                  final double minY,
                                                  final double maxX,
                                                  final double maxY,
                                                  final double maxDistance,
                                                  final int maxCount); Set<OrderedCanvasIdPair> getCircleNeighbors(final List<TileBounds> sourceTileBoundsList,
                                                       final List<TileBoundsRTree> neighborTrees,
                                                       final double neighborRadiusFactor,
                                                       final Double explicitRadius,
                                                       final boolean excludeCornerNeighbors,
                                                       final boolean excludeSameLayerNeighbors,
                                                       final boolean excludeSameSectionNeighbors); static Set<OrderedCanvasIdPair> getDistinctPairs(final TileBounds fromTile,
                                                            final List<TileBounds> toTiles,
                                                            final boolean excludeCornerNeighbors,
                                                            final boolean excludeSameSectionNeighbors,
                                                            final boolean includeRelativePosition); }
TileBoundsRTree { public List<TileBounds> findVisibleTiles() { final List<TileBounds> visibleTiles = new ArrayList<>(tileBoundsList.size()); List<TileBounds> intersectingTiles; for (final TileBounds tile : tileBoundsList) { intersectingTiles = findTilesInBox(tile.getMinX(), tile.getMinY(), tile.getMaxX(), tile.getMaxY()); if (! isCompletelyObscured(tile, intersectingTiles)) { visibleTiles.add(tile); } } return visibleTiles; } TileBoundsRTree(final Double z,
                           final List<TileBounds> tileBoundsList); int size(); List<TileBounds> getTileBoundsList(); void addTile(final TileBounds tileBounds); List<TileBounds> findTilesInBox(final double minX,
                                           final double minY,
                                           final double maxX,
                                           final double maxY); List<TileBounds> findCompletelyObscuredTiles(); List<TileBounds> findVisibleTiles(); List<TileBounds> findTilesNearestToBox(final double minX,
                                                  final double minY,
                                                  final double maxX,
                                                  final double maxY,
                                                  final double maxDistance,
                                                  final int maxCount); Set<OrderedCanvasIdPair> getCircleNeighbors(final List<TileBounds> sourceTileBoundsList,
                                                       final List<TileBoundsRTree> neighborTrees,
                                                       final double neighborRadiusFactor,
                                                       final Double explicitRadius,
                                                       final boolean excludeCornerNeighbors,
                                                       final boolean excludeSameLayerNeighbors,
                                                       final boolean excludeSameSectionNeighbors); static Set<OrderedCanvasIdPair> getDistinctPairs(final TileBounds fromTile,
                                                            final List<TileBounds> toTiles,
                                                            final boolean excludeCornerNeighbors,
                                                            final boolean excludeSameSectionNeighbors,
                                                            final boolean includeRelativePosition);  }