Package worldBuilder

Class TopoMap


  • public class TopoMap
    extends java.lang.Object
    a class to render a set of mesh points as a traditional topographic map image.
    • Constructor Summary

      Constructors 
      Constructor Description
      TopoMap​(Map map)
      instantiate a (topographic lines) height map renderer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void paint​(java.awt.Graphics g, int width, int height, int cellWidth)
      Render current mesh as a topographic map
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TopoMap

        public TopoMap​(Map map)
        instantiate a (topographic lines) height map renderer
        Parameters:
        map - to be rendered
    • Method Detail

      • paint

        public void paint​(java.awt.Graphics g,
                          int width,
                          int height,
                          int cellWidth)
        Render current mesh as a topographic map
        Parameters:
        g - Graphics context
        width - of the display map
        height - of the display map
        cellWidth - - pixels per cell This method uses the Marching Squares algorithm. for each topo line construct an over/under 2D bitmap march through the bitmap, summing neighbors use sum of neighbors to select an image