public void setTileFactory(TileFactory tileFactory) { this.tileFactory = tileFactory; this.invalidateTiles(); }
public short[] getTileArray(int row, int column) { if (this.texelRow != row || this.texelCol != column) { long key = tileKey(this.tileMatrix, row, column); this.texelRow = row; this.texelCol = column; this.texelArray = this.arrays.get(key); } return this.texelArray; }
@Override protected void doGetHeightGrid(Sector gridSector, int gridWidth, int gridHeight, float[] result) { if (!this.tileMatrixSet.sector.intersects(gridSector)) { return; // no coverage in the specified sector } double targetPixelSpan = gridSector.deltaLatitude() / gridHeight; int targetIdx = this.tileMatrixSet.indexOfMatrixNearest(targetPixelSpan); TileBlock tileBlock = new TileBlock(); for (int idx = targetIdx; idx >= 0; idx--) { this.setEnableRetrieval(idx == targetIdx || idx == 0); // enable retrieval of the target matrix and the first matrix TileMatrix tileMatrix = this.tileMatrixSet.matrix(idx); if (this.fetchTileBlock(gridSector, gridWidth, gridHeight, tileMatrix, tileBlock)) { this.readHeightGrid(gridSector, gridWidth, gridHeight, tileBlock, result); return; } } }
@Override protected void doGetHeightLimits(Sector sector, float[] result) { if (!this.tileMatrixSet.sector.intersects(sector)) { return; // no coverage in the specified sector } double targetPixelSpan = sector.deltaLatitude() / GET_HEIGHT_LIMIT_SAMPLES; int targetIdx = this.tileMatrixSet.indexOfMatrixNearest(targetPixelSpan); TileBlock tileBlock = new TileBlock(); for (int idx = targetIdx; idx >= 0; idx--) { this.setEnableRetrieval(idx == targetIdx || idx == 0); // enable retrieval of the target matrix and the first matrix TileMatrix tileMatrix = this.tileMatrixSet.matrix(idx); if (this.fetchTileBlock(sector, tileMatrix, tileBlock)) { this.scanHeightLimits(sector, tileBlock, result); return; } } }
protected short[] fetchTileArray(TileMatrix tileMatrix, int row, int column) { long key = tileKey(tileMatrix, row, column); ImageSource tileSource = this.coverageSource.get(key); if (tileSource == null) { tileSource = this.tileFactory.createTileSource(tileMatrix, row, column); this.coverageSource.put(key, tileSource, 1); } short[] tileArray = this.coverageCache.get(tileSource); if (tileArray == null && this.isEnableRetrieval()) { this.coverageRetriever.retrieve(tileSource, null, this); } return tileArray; }
protected void invalidateTiles() { this.coverageSource.clear(); this.coverageCache.clear(); this.updateTimestamp(); }
short[] tileArray = this.fetchTileArray(tileMatrix, row, col); if (tileArray != null) { result.rows.put(row, 0);
@Override public void run() { coverageCache.put(finalKey, finalArray, finalArray.length * 2); updateTimestamp(); WorldWind.requestRedraw(); } });
int row = result.rows.keyAt(ridx); int col = result.cols.keyAt(cidx); short[] tileArray = this.fetchTileArray(tileMatrix, row, col); if (tileArray != null) { result.putTileArray(row, col, tileArray);
public void setTileMatrixSet(TileMatrixSet tileMatrixSet) { if (tileMatrixSet == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "TiledSurfaceImage", "setTileMatrixSet", "missingTileMatrixSet")); } this.tileMatrixSet = tileMatrixSet; this.invalidateTiles(); }
public void putTileArray(int row, int column, short[] array) { long key = tileKey(this.tileMatrix, row, column); this.arrays.put(key, array); }