Search in sources :

Example 1 with GriddedElevationModelZRange

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

the class RasterizerGriddedElevationModelLayerRenderer method setRasterizer.

public void setRasterizer(final GriddedElevationModelRasterizer rasterizer) {
    if (rasterizer != null) {
        this.rasterizer = rasterizer;
        final String iconName = rasterizer.getIconName();
        setIcon(iconName);
        final LayerRenderer<?> parent = getParent();
        if (parent instanceof GriddedElevationModelZRange) {
            final GriddedElevationModelZRange zRange = (GriddedElevationModelZRange) parent;
            if (!Double.isFinite(rasterizer.getMinZ())) {
                final double minZ = zRange.getMinZ();
                rasterizer.setMinZ(minZ);
            }
            if (!Double.isFinite(rasterizer.getMaxZ())) {
                final double maxZ = zRange.getMaxZ();
                rasterizer.setMaxZ(maxZ);
            }
        }
        final GriddedElevationModel elevationModel = getElevationModel();
        if (elevationModel == null) {
            rasterizer.updateValues();
        } else {
            rasterizer.setElevationModel(elevationModel);
        }
    }
    this.redraw = true;
}
Also used : GriddedElevationModel(com.revolsys.elevation.gridded.GriddedElevationModel) GriddedElevationModelZRange(com.revolsys.swing.map.layer.elevation.gridded.GriddedElevationModelZRange)

Aggregations

GriddedElevationModel (com.revolsys.elevation.gridded.GriddedElevationModel)1 GriddedElevationModelZRange (com.revolsys.swing.map.layer.elevation.gridded.GriddedElevationModelZRange)1