org.osm2world.core.heightmap.data
Class AbstractCellularTerrainElevation

Object
  extended by AbstractCellularTerrainElevation
All Implemented Interfaces:
CellularTerrainElevation, TerrainElevation
Direct Known Subclasses:
EmptyTerrainElevationGrid, FlatTerrainElevation, WaveTerrainElevation

public abstract class AbstractCellularTerrainElevation
extends Object
implements CellularTerrainElevation


Constructor Summary
AbstractCellularTerrainElevation(AxisAlignedBoundingBoxXZ boundary, int numPointsX, int numPointsZ)
           
 
Method Summary
 PolygonXYZ getBoundaryPolygon()
          returns the boundary created from the first and last rows and columns of the grid.
 Iterable<? extends TerrainElevationCell> getCells()
          returns Iterable over cells.
protected abstract  Float getElevation(VectorXZ pos)
           
 TerrainPoint[][] getTerrainPointGrid()
           
 Collection<TerrainPoint> getTerrainPoints()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCellularTerrainElevation

public AbstractCellularTerrainElevation(AxisAlignedBoundingBoxXZ boundary,
                                        int numPointsX,
                                        int numPointsZ)
Method Detail

getTerrainPoints

public Collection<TerrainPoint> getTerrainPoints()
Specified by:
getTerrainPoints in interface TerrainElevation

getTerrainPointGrid

public TerrainPoint[][] getTerrainPointGrid()
Specified by:
getTerrainPointGrid in interface CellularTerrainElevation
Returns:
regular two-dimensional array (not jagged)

getBoundaryPolygon

public PolygonXYZ getBoundaryPolygon()
Description copied from interface: CellularTerrainElevation
returns the boundary created from the first and last rows and columns of the grid. This requires that all TerrainPoints' elevations have already been set to non-null values.

Specified by:
getBoundaryPolygon in interface CellularTerrainElevation

getCells

public Iterable<? extends TerrainElevationCell> getCells()
Description copied from interface: CellularTerrainElevation
returns Iterable over cells. This is a convenience method for operations that need to be performed for all cells. The iterator cannot be used to remove cells.

Specified by:
getCells in interface CellularTerrainElevation

getElevation

protected abstract Float getElevation(VectorXZ pos)