TLcdPolylineContourFinder
or TLcdComplexPolygonContourFinder
.
This class relies on deprecated contour finding algorithms. The output of the new contour finding algorithms
are much more practical to work as they split up contours into two separate, disambiguous, concepts that can be retrieved
individually. TLcdPolylineContourFinder
finds contour lines of equal height, much like this
class, except that it doesn't close the shapes to represent an area. TLcdComplexPolygonContourFinder
finds
complex polygons instead of the simple polygons of this class. This allows them to model interval areas with holes.public class TLcdContourFinder extends Object
ILcdMatrixView
. The contour lines
are not returned, but instead a user-given ILcdFunction
is applied on each generated
ILcdValuedPolygon
.
The generated contours are closed simple polygons. To support open and closed isolines,
use TLcdPolylineContourFinder
. To support areas with holes,
use TLcdComplexPolygonContourFinder
.
Constructor and Description |
---|
TLcdContourFinder()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(ILcdStatusListener aStatusListener)
Deprecated.
Starts notifying a listener about the progress of the contour computation.
|
int |
applyOnAllContours(ILcdFunction aFunction,
ILcdMatrixView aMatrixView,
double[] aContourLevels)
Deprecated.
Computes all contour lines for the specified
aMatrixView at the levels
indicated by aContourLevels . |
int |
applyOnAllContours(ILcdFunction aFunction,
ILcdMatrixView aMatrixView,
int aNumberOfLevels,
boolean aLogInterval,
double aMaxLevel,
double aMinLevel)
Deprecated.
Computes all contour lines for the specified
aMatrixView at a number of
different levels defined by aNumberOfLevels . |
double |
getProgress()
Deprecated.
Returns the progress value of the calculation.
|
boolean |
isAutoClearOn()
Deprecated.
Returns whether the working memory is cleared after each call of applyOnAllContours.
|
boolean |
isCloseEdgesAroundLower()
Deprecated.
Returns whether contour lines that run from edge to edge are closed around the lower side of
the contour or the higher side.
|
boolean |
isOptimizedEdges()
Deprecated.
Returns whether edges are optimized.
|
boolean |
isTimingOn()
Deprecated.
Returns whether timing is on for this instance of
TLcdContourFinder . |
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the standard Java logging
framework directly.
|
protected boolean |
isUseInterpolation(double aLowerValue,
double aHigherValue)
Deprecated.
Returns whether a contour between the specified values should be interpolated or not.
|
void |
removeStatusListener(ILcdStatusListener aStatusListener)
Deprecated.
Terminates notifying a listener of the progress of the contour computation.
|
void |
setAutoClearOn(boolean aAutoClearOn)
Deprecated.
Set autoClearing to aAutoClearOn for this instance of
TLcdContourFinder . |
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the standard Java logging
framework directly.
|
void |
setCloseEdgesAroundLower(boolean aCloseEdgesAroundLower)
Deprecated.
Set whether contour lines that run from edge to edge are closed around the lower side of the
contour or the higher side.
|
void |
setContourFactory(ILcdContourFactory aContourFactory)
Deprecated.
Set the
ILcdContourFactory that needs to be used when generating an
ILcdValuedPolygon . |
void |
setOptimizedEdges(boolean aOptimizedEdges)
Deprecated.
Set the behavior for the algorithm when traversing the edges.
|
void |
setTimingOn(boolean aTimingOn)
Deprecated.
Set timing to aTimingOn for this instance of
TLcdContourFinder . |
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the standard Java logging
framework directly.
|
public boolean isTraceOn()
true
if tracing is enabled for this class.public static void setClassTraceOn(boolean aClassTraceOn)
true
then all
log messages are recorded, otherwise only the informative, warning and error messages are
recorded.aClassTraceOn
- if true then all log messages are recorded, otherwise only the
informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
true
or
false
as argument automatically turns off tracing for all other class instances
for which setTraceOn
has not been called. If the argument is false
then only the informative, warning and error log messages are recorded.aTraceOn
- if true then all log messages are recorded for this instance. If false, then
only the informative, warning and error log messages are recorded.public boolean isTimingOn()
TLcdContourFinder
.TLcdContourFinder
.public void setTimingOn(boolean aTimingOn)
TLcdContourFinder
.aTimingOn
- whether to set timing on for this instance of TLcdContourFinder
.public void removeStatusListener(ILcdStatusListener aStatusListener)
aStatusListener
- will no longer be notified of progress when running a contour
computation.addStatusListener(com.luciad.util.ILcdStatusListener)
public void addStatusListener(ILcdStatusListener aStatusListener)
aStatusListener
- will be notified of progress when running a contour computation.removeStatusListener(ILcdStatusListener)
public boolean isAutoClearOn()
public void setAutoClearOn(boolean aAutoClearOn)
TLcdContourFinder
.aAutoClearOn
- whether to set auto clearing on for this instance of
TLcdContourFinder
.isAutoClearOn()
public void setOptimizedEdges(boolean aOptimizedEdges)
aOptimizedEdges
- when false, all edge points traversed will be included in the contour.
When true, only the traversed corner points will be included. Default is
truepublic boolean isOptimizedEdges()
setOptimizedEdges(boolean)
public void setCloseEdgesAroundLower(boolean aCloseEdgesAroundLower)
aCloseEdgesAroundLower
- The value to be set.isCloseEdgesAroundLower()
public boolean isCloseEdgesAroundLower()
setCloseEdgesAroundLower(boolean)
public double getProgress()
protected boolean isUseInterpolation(double aLowerValue, double aHigherValue)
Returns whether a contour between the specified values should be interpolated or not. The
default implementation returns true
, meaning that all contours will be
interpolated between the specified values.
If this method returns false
,
the contour is not interpolated and will be placed in the middle of the 2 points corresponding
to the specified values.
aLowerValue
- The matrix value on the lower side of the contour.aHigherValue
- The matrix value on the higher side of the contour.public void setContourFactory(ILcdContourFactory aContourFactory)
ILcdContourFactory
that needs to be used when generating an
ILcdValuedPolygon
.aContourFactory
- The ILcdContourFactory
to be set.public int applyOnAllContours(ILcdFunction aFunction, ILcdMatrixView aMatrixView, int aNumberOfLevels, boolean aLogInterval, double aMaxLevel, double aMinLevel)
Computes all contour lines for the specified aMatrixView
at a number of
different levels defined by aNumberOfLevels
. The specified aFunction
is applied to each generated contour line (ILcdValuedPolygon
). The method returns
the number of computed contour lines.
The edge of a polygon indicates a contour line of equal height. The orientation of the returned polygons should be interpreted as follows:
aFunction
- The function to apply on each generated contour line.aMatrixView
- The input matrix which should contain more than one column and more than
one row.aNumberOfLevels
- The number of levels to be computed.aLogInterval
- Indicates whether a logarithmic or a linear subdivision is used. If it
is true
, a logarithmic subdivision is used.aMaxLevel
- The maximum level, only values below this level will be considered when
computing the subdivision.aMinLevel
- The minimum level, only values above this level will be considered when
computing the subdivision.NullPointerException
- when no ILcdContourFactory
was set.public int applyOnAllContours(ILcdFunction aFunction, ILcdMatrixView aMatrixView, double[] aContourLevels)
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.
aFunction
- 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.aContourLevels
- The different levels to compute the contours on.NullPointerException
- when no ILcdContourFactory
was set.