geometry.object
Class DistanceMap2D

java.lang.Object
  extended by geometry.object.DistanceMap2D
All Implemented Interfaces:
DistanceMap

public class DistanceMap2D
extends java.lang.Object
implements DistanceMap

A 2-dimensional distance map


Field Summary
private  double[][] distancemap
          distance map, holding distance to the contour from node (x,y) in index [x][y]
 
Constructor Summary
DistanceMap2D()
           
 
Method Summary
 double getAverageDistance()
          Get the average distance from each pixel/voxel in the shape to the contour.
 double getDistance(Index index)
          Get the distance from the specified coordinates to the contour
 java.lang.Object getDistanceMap()
           
 void setDistanceMap(java.lang.Object distancemap)
          set the distance map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

distancemap

private double[][] distancemap
distance map, holding distance to the contour from node (x,y) in index [x][y]

Constructor Detail

DistanceMap2D

public DistanceMap2D()
Method Detail

setDistanceMap

public void setDistanceMap(java.lang.Object distancemap)
Description copied from interface: DistanceMap
set the distance map.

Specified by:
setDistanceMap in interface DistanceMap
Parameters:
distancemap - the distance map to set.

getDistance

public double getDistance(Index index)
Description copied from interface: DistanceMap
Get the distance from the specified coordinates to the contour

Specified by:
getDistance in interface DistanceMap
Parameters:
index - the index to get the distance to the contour for
Returns:
the distance from the specified coordinates to the contour

getAverageDistance

public double getAverageDistance()
Description copied from interface: DistanceMap
Get the average distance from each pixel/voxel in the shape to the contour.

Specified by:
getAverageDistance in interface DistanceMap
Returns:
the average distance from each pixel/voxel to the contour

getDistanceMap

public java.lang.Object getDistanceMap()
Specified by:
getDistanceMap in interface DistanceMap