Search in sources :

Example 1 with TiledGriddedElevationModelLayer

use of com.revolsys.swing.map.layer.elevation.gridded.TiledGriddedElevationModelLayer in project com.revolsys.open by revolsys.

the class TiledMultipleGriddedElevationModelLayerRenderer method renderTile.

@Override
protected void renderTile(final Viewport2D viewport, final Cancellable cancellable, final TiledGriddedElevationModelLayerTile tile) {
    final Graphics2D graphics = viewport.getGraphics();
    if (graphics != null) {
        final GriddedElevationModel elevationModel = tile.getElevationModel();
        if (elevationModel != null) {
            final TiledGriddedElevationModelLayer layer = getLayer();
            final List<RasterizerGriddedElevationModelLayerRenderer> renderers = getRenderers();
            for (final RasterizerGriddedElevationModelLayerRenderer renderer : cancellable.cancellable(renderers)) {
                final long scaleForVisible = (long) viewport.getScaleForVisible();
                if (renderer.isVisible(scaleForVisible)) {
                    renderer.setElevationModel(elevationModel);
                    renderer.render(viewport, cancellable, layer);
                }
            }
        }
    }
}
Also used : TiledGriddedElevationModelLayer(com.revolsys.swing.map.layer.elevation.gridded.TiledGriddedElevationModelLayer) GriddedElevationModel(com.revolsys.elevation.gridded.GriddedElevationModel) Graphics2D(java.awt.Graphics2D)

Example 2 with TiledGriddedElevationModelLayer

use of com.revolsys.swing.map.layer.elevation.gridded.TiledGriddedElevationModelLayer in project com.revolsys.open by revolsys.

the class TiledMultipleGriddedElevationModelLayerRenderer method updateBoundingBox.

public void updateBoundingBox() {
    final TiledGriddedElevationModelLayer layer = getLayer();
    if (layer != null) {
        final BoundingBox boundingBox = layer.getBoundingBox();
        final double minX = boundingBox.getMinX();
        final double minY = boundingBox.getMinY();
        final double maxX = boundingBox.getMaxX();
        final double maxY = boundingBox.getMaxY();
        final BoundingBox newBoundingBox = boundingBox.newBoundingBox(minX, minY, this.minZ, maxX, maxY, this.maxZ);
        layer.setBoundingBox(newBoundingBox);
    }
}
Also used : TiledGriddedElevationModelLayer(com.revolsys.swing.map.layer.elevation.gridded.TiledGriddedElevationModelLayer) BoundingBox(com.revolsys.geometry.model.BoundingBox)

Aggregations

TiledGriddedElevationModelLayer (com.revolsys.swing.map.layer.elevation.gridded.TiledGriddedElevationModelLayer)2 GriddedElevationModel (com.revolsys.elevation.gridded.GriddedElevationModel)1 BoundingBox (com.revolsys.geometry.model.BoundingBox)1 Graphics2D (java.awt.Graphics2D)1