public class ContourBuilder extends Object
buildContourLines(double)
or
buildContourLines(double, gov.nasa.worldwind.geom.Sector, double)
. The latter method maps contour line
coordinates to geographic positions by associating the rectangular array with a geographic sector. It is valid to
compute contour lines for a threshold value that is less than the rectangular array's minimum value or greater than
the rectangular array's maximum value, though the result is an empty list of contour lines. The domain of contour
line coordinates is the XY Cartesian space defined by the rectangular array's width and height. X coordinates range
from 0 to width-1, and Y coordinates range from 0 to height-1.Modifier and Type | Class and Description |
---|---|
protected static class |
ContourBuilder.CellInfo |
protected static class |
ContourBuilder.CellKey |
protected static class |
ContourBuilder.Direction |
Modifier and Type | Field and Description |
---|---|
protected List<ContourBuilder.CellKey> |
contourCellList |
protected Map<ContourBuilder.CellKey,ContourBuilder.CellInfo> |
contourCellMap |
protected List<List<double[]>> |
contourList |
protected List<double[]> |
currentContour |
protected static Map<Integer,LinkedHashMap<ContourBuilder.Direction,ContourBuilder.Direction>> |
dirNext |
protected static Map<ContourBuilder.Direction,ContourBuilder.Direction> |
dirRev |
protected int |
height |
protected double[] |
values |
protected int |
width |
Constructor and Description |
---|
ContourBuilder(int width,
int height,
double[] values)
Creates a new ContourBuilder with the specified rectangular array arguments.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addIntersection(ContourBuilder.CellInfo cell,
ContourBuilder.Direction dir) |
protected void |
assembleContourCells(double value) |
List<List<double[]>> |
buildContourLines(double value)
Computes the contour lines at a specified threshold value.
|
List<List<Position>> |
buildContourLines(double value,
Sector sector,
double altitude)
Computes the geographic contour lines at a specified threshold value.
|
protected void |
clearContourCells() |
protected ContourBuilder.CellInfo |
getContourCell(int x,
int y) |
protected ContourBuilder.CellInfo |
nextCell(ContourBuilder.CellInfo cell,
ContourBuilder.Direction dir) |
protected void |
putContourCell(ContourBuilder.CellInfo cell) |
protected void |
traverseContour(ContourBuilder.CellInfo cell,
ContourBuilder.Direction dir) |
protected void |
traverseContourCells() |
protected double |
valueFor(int x,
int y) |
protected List<ContourBuilder.CellKey> contourCellList
protected Map<ContourBuilder.CellKey,ContourBuilder.CellInfo> contourCellMap
protected List<double[]> currentContour
protected static Map<Integer,LinkedHashMap<ContourBuilder.Direction,ContourBuilder.Direction>> dirNext
protected static Map<ContourBuilder.Direction,ContourBuilder.Direction> dirRev
protected int height
protected double[] values
protected int width
public ContourBuilder(int width, int height, double[] values)
width
- the rectangular array width.height
- the rectangular array height.values
- the rectangular array values, as a one-dimensional array. Must contain at least width * height
values. This array is understood to be organized in row-major order, with the first index
indicating the value at the rectangle's upper-left corner.IllegalArgumentException
- if either the width or the height are less than 1, if the array is
null, or if the array length is insufficient for the specified width
and height.protected void addIntersection(ContourBuilder.CellInfo cell, ContourBuilder.Direction dir)
protected void assembleContourCells(double value)
public List<List<double[]>> buildContourLines(double value)
value
- the threshold value (i.e. isovalue) to compute contour lines for.public List<List<Position>> buildContourLines(double value, Sector sector, double altitude)
value
- the threshold value (i.e. isovalue) to compute contour lines for.sector
- the sector to associate with the rectangular array. The array's upper left corner is mapped to
the sector's Northwest corner, and the array's lower right corner is mapped to the sector's
Southeast corner.altitude
- the altitude to assign to the geographic positions.IllegalArgumentException
- if the sector is null.protected void clearContourCells()
protected ContourBuilder.CellInfo getContourCell(int x, int y)
protected ContourBuilder.CellInfo nextCell(ContourBuilder.CellInfo cell, ContourBuilder.Direction dir)
protected void putContourCell(ContourBuilder.CellInfo cell)
protected void traverseContour(ContourBuilder.CellInfo cell, ContourBuilder.Direction dir)
protected void traverseContourCells()
protected double valueFor(int x, int y)