public class ContourBuilder
extends java.lang.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 java.util.List<ContourBuilder.CellKey> |
contourCellList |
protected java.util.Map<ContourBuilder.CellKey,ContourBuilder.CellInfo> |
contourCellMap |
protected java.util.List<java.util.List<double[]>> |
contourList |
protected java.util.List<double[]> |
currentContour |
protected static java.util.Map<java.lang.Integer,java.util.LinkedHashMap<ContourBuilder.Direction,ContourBuilder.Direction>> |
dirNext |
protected static java.util.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) |
java.util.List<java.util.List<double[]>> |
buildContourLines(double value)
Computes the contour lines at a specified threshold value.
|
java.util.List<java.util.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 java.util.List<ContourBuilder.CellKey> contourCellList
protected java.util.Map<ContourBuilder.CellKey,ContourBuilder.CellInfo> contourCellMap
protected java.util.List<java.util.List<double[]>> contourList
protected java.util.List<double[]> currentContour
protected static java.util.Map<java.lang.Integer,java.util.LinkedHashMap<ContourBuilder.Direction,ContourBuilder.Direction>> dirNext
protected static java.util.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.java.lang.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 java.util.List<java.util.List<double[]>> buildContourLines(double value)
value
- the threshold value (i.e. isovalue) to compute contour lines for.public java.util.List<java.util.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.java.lang.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)