public class TLcdPolylineContourFinder extends Object implements ILcdStatusSource
TLcdLonLatPolylineContourBuilder
or TLcdXYPolylineContourBuilder
with this
contour finder you already get them as polylines.
This contour finder can find contours for two types of values: level values, and special values.
Level values are for example heights or other continuous data. Special values are values that
cannot be sorted from low to high and have special meaning, e.g. "unknown", "visible" or "invisible".
For level values the contours are interpolated, that is, contour lines are created between lower
and higher values. For special values it creates a contour around each area with that exact
value and the concept of lower and higher doesn't exist. Both level values and special values can
be mixed. Special values can only be used if the isSpecialValue
method of the contour
finder is overridden, since its default implementation always returns false, and each value in the
special values array should let this method return true.Constructor and Description |
---|
TLcdPolylineContourFinder()
Constructs a new TLcdPolylineContourFinder.
|
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(ILcdStatusListener aStatusListener)
Starts notifying a listener about the progress of the contour computation.
|
void |
findContours(ILcdContourBuilder aContourBuilder,
ILcdMatrixView aMatrixView,
double[] aContourLevelValues,
double[] aContourSpecialValues)
Computes all contour lines for the specified
aMatrixView at the levels
indicated by aContourLevels . |
double |
getProgress()
Returns the progress value of the calculation.
|
protected boolean |
isSpecialValue(double aValue)
Check whether this value should be treated as a special value.
|
boolean |
isWrapAroundX()
Returns whether the polar mode of the contour finder is enabled.
|
void |
removeStatusListener(ILcdStatusListener aStatusListener)
Terminates notifying a listener of the progress of the contour computation.
|
void |
setWrapAroundX(boolean aWrapAroundX)
Sets the contour finder to polar or cartesian.
|
public TLcdPolylineContourFinder()
protected boolean isSpecialValue(double aValue)
aValue
- The value to check.public boolean isWrapAroundX()
public void setWrapAroundX(boolean aWrapAroundX)
aWrapAroundX
- true to make the contour finder polar, false to make it cartesian.public void removeStatusListener(ILcdStatusListener aStatusListener)
removeStatusListener
in interface ILcdStatusSource
aStatusListener
- will no longer be notified of progress when running a contour
computation.addStatusListener(com.luciad.util.ILcdStatusListener)
public void addStatusListener(ILcdStatusListener aStatusListener)
addStatusListener
in interface ILcdStatusSource
aStatusListener
- will be notified of progress when running a contour computation.removeStatusListener(com.luciad.util.ILcdStatusListener)
public double getProgress()
public void findContours(ILcdContourBuilder aContourBuilder, ILcdMatrixView aMatrixView, double[] aContourLevelValues, double[] aContourSpecialValues)
Computes all contour lines for the specified aMatrixView
at the levels
indicated by aContourLevels
. The specified function (aFunction
) is
applied to each generated contour line (ILcdValuedPolygon
). The method returns the
number of computed contour lines.
The orientation of the polygons gives you information about which side has a higher value. If the polygon is oriented clockwise then the exterior has a higher value than the interior. If the polygon is oriented counter-clockwise, then the exterior of the polygon has a lower value than the interior.
Note that, when the current thread is interrupted, the method will return the intermediate result. This is the number of already computed contour lines.
aContourBuilder
- The function to apply on each generated contour line.aMatrixView
- The input data, it should have more than one column and more than
one row.aContourLevelValues
- Contour levels for intervals. N intervals define N-1 areas. Must
be monotously increasing values. Iso levels should not be special
values.aContourSpecialValues
- Contour levels for special values. N special values define N
areas. These areas are around locations that have exactly this
special value.IllegalArgumentException
- when a height level is in the special value range or a special
level is outside the special value range. All special values should be true for #isSpecialValue(),
while all height levels should be false for #isSpecialValue().