Class Etopo5Renderer

java.lang.Object
edu.cnu.mdi.mapping.render.Etopo5Renderer

public class Etopo5Renderer extends Object
Renders ETOPO5 terrain and bathymetry using the active map projection.

The renderer samples the visible screen area rather than projecting the complete ETOPO5 grid. Each screen block is converted back to geographic coordinates, sampled from the ETOPO5 data set, and filled with an elevation or bathymetry color.

The renderer owns display settings such as opacity and sampling step but does not own an MDI layer. A MapView2D may place this renderer on any ordinary Layer.

  • Field Details

    • DEFAULT_OPACITY

      public static final float DEFAULT_OPACITY
      Default terrain opacity.
      See Also:
    • DEFAULT_STEP

      public static final int DEFAULT_STEP
      Default screen-space sampling step in pixels.
      See Also:
  • Constructor Details

    • Etopo5Renderer

      public Etopo5Renderer(Etopo5Loader loader)
      Creates an ETOPO5 renderer.
      Parameters:
      loader - loaded ETOPO5 data; must not be null
  • Method Details

    • render

      public void render(Graphics2D g2, IContainer container, IMapProjection projection)
      Renders the visible portion of the ETOPO5 data.
      Parameters:
      g2 - graphics context
      container - map container
      projection - active map projection
    • getElevation

      public double getElevation(double latitudeDeg, double longitudeDeg)
      Returns interpolated elevation or bathymetry.
      Parameters:
      latitudeDeg - latitude in degrees
      longitudeDeg - longitude in degrees
      Returns:
      elevation in metres, or NaN if unavailable or either coordinate is non-finite
    • getOpacity

      public float getOpacity()
      Returns the terrain opacity.
      Returns:
      opacity in the range [0, 1]
    • setOpacity

      public void setOpacity(double opacity)
      Sets the terrain opacity.
      Parameters:
      opacity - opacity in the range [0, 1]
    • getStep

      public int getStep()
      Returns the screen-space sampling step.
      Returns:
      step in pixels
    • setStep

      public void setStep(int step)
      Sets the screen-space sampling step.

      Smaller values produce smoother terrain but require more projection and elevation calculations.

      Parameters:
      step - step in pixels; must be positive