org.osm2world.core.terrain.creation
Class TemporaryElevationStorage

Object
  extended by TemporaryElevationStorage

public class TemporaryElevationStorage
extends Object

a data store for elevation information during terrain creation. This is necessary because 2D computations (such as polygon differences and Conforming Delaunay Triangulation) will strip the third dimension from elevation vertices and may also add additional vertices.


Constructor Summary
TemporaryElevationStorage()
           
 
Method Summary
 void addInterpolationLineSegment(LineSegmentXYZ segment)
          adds a line segment for interpolating along.
 void addPolygon(PolygonXZ polyXZ, PolygonXYZ polyXYZ)
          adds all the elevation info for a polygon that needs to be flattened (vertex vectors and line segments along the edges)
 void addVector(VectorXZ vXZ, VectorXYZ vXYZ)
          adds the 3d version of a flattened vector so that the 3d version can later be retrieved.
 PolygonXYZ restoreElevationForPolygon(SimplePolygonXZ polygon)
           
 TriangleXYZ restoreElevationForTriangle(TriangleXZ triangle)
           
 VectorXYZ restoreElevationForVector(VectorXZ vector)
          returns the 3d vector at a position; either by retrieving a previously existing vector or by interpolating along interpolation lines
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemporaryElevationStorage

public TemporaryElevationStorage()
Method Detail

addVector

public void addVector(VectorXZ vXZ,
                      VectorXYZ vXYZ)
adds the 3d version of a flattened vector so that the 3d version can later be retrieved.


addInterpolationLineSegment

public void addInterpolationLineSegment(LineSegmentXYZ segment)
adds a line segment for interpolating along. Note that line segments which have been added earlier will take priority over those which have been added later, so insertion order matters.


addPolygon

public void addPolygon(PolygonXZ polyXZ,
                       PolygonXYZ polyXYZ)
adds all the elevation info for a polygon that needs to be flattened (vertex vectors and line segments along the edges)


restoreElevationForVector

public VectorXYZ restoreElevationForVector(VectorXZ vector)
returns the 3d vector at a position; either by retrieving a previously existing vector or by interpolating along interpolation lines

Returns:
3d vector; null if the vector didn't exist previously and isn't close to any of the interpolation lines

restoreElevationForTriangle

public TriangleXYZ restoreElevationForTriangle(TriangleXZ triangle)

restoreElevationForPolygon

public PolygonXYZ restoreElevationForPolygon(SimplePolygonXZ polygon)