Package com.luciad.network.function
Class ALcdCrossCountryHeightProviderDistanceFunction
java.lang.Object
com.luciad.network.function.ALcdCrossCountryHeightProviderDistanceFunction
- All Implemented Interfaces:
ILcdCrossCountryDistanceFunction
public abstract class ALcdCrossCountryHeightProviderDistanceFunction
extends Object
implements ILcdCrossCountryDistanceFunction
ALcdCrossCountryHeightProviderDistanceFunction is an abstract class which can be
used to implement distance functions that are based on an ILcdHeightProvider and
compute values using only the height values along the line between start and end point.
To use this class only the computeDistance(com.luciad.shape.ILcdPoint, double, com.luciad.shape.ILcdPoint, double) must still be implemented. This method will be called from
the ILcdCrossCountryDistanceFunction.computeDistance(com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint) implementation of this class.- Since:
- 9.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDescribes the mode in which the distances should be computed. -
Constructor Summary
ConstructorsConstructorDescriptionALcdCrossCountryHeightProviderDistanceFunction(ILcdHeightProvider aHeightProvider) Constructs a newALcdCrossCountryHeightProviderDistanceFunctionbased onaHeightProvider.ALcdCrossCountryHeightProviderDistanceFunction(ILcdHeightProvider aHeightProvider, double aSampleInterval) Constructs a newALcdCrossCountryHeightProviderDistanceFunctionbased onaHeightProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract doublecomputeDistance(ILcdPoint aStartPoint, double aStartValue, ILcdPoint aEndPoint, double aEndValue) Computes the distance between 2 points.doublecomputeDistance(ILcdPoint aStartPoint, ILcdPoint aEndPoint) This method will call thecomputeDistance(com.luciad.shape.ILcdPoint, double, com.luciad.shape.ILcdPoint, double)method a number of times, depending on the computation mode, to compute the distance between the specified points.Returns the bounds of theILcdHeightProvideron which this distance function is based.Returns the mode in which the distance computations are performed.Returns theILcdHeightProvideron which this distance function is based.doubleReturns the sample interval used in theALcdCrossCountryHeightProviderDistanceFunction.ComputationMode.FIXED_INTERVALmode.voidSets the mode in which the distance computations are be performed.voidsetSampleInterval(double aSampleInterval) Sets the sample interval in theFIXED_INTERVALmode.
-
Constructor Details
-
ALcdCrossCountryHeightProviderDistanceFunction
Constructs a newALcdCrossCountryHeightProviderDistanceFunctionbased onaHeightProvider. The distances will be computed in theALcdCrossCountryHeightProviderDistanceFunction.ComputationMode.SIMPLEmode.- Parameters:
aHeightProvider- theILcdHeightProviderthe distance function is based on
-
ALcdCrossCountryHeightProviderDistanceFunction
public ALcdCrossCountryHeightProviderDistanceFunction(ILcdHeightProvider aHeightProvider, double aSampleInterval) Constructs a newALcdCrossCountryHeightProviderDistanceFunctionbased onaHeightProvider. The distances will be computed in theALcdCrossCountryHeightProviderDistanceFunction.ComputationMode.FIXED_INTERVALmode.- Parameters:
aHeightProvider- theILcdHeightProviderthe distance function is based onaSampleInterval- the maximum distance between two consequent samples when computing a distance
-
-
Method Details
-
getComputationMode
Returns the mode in which the distance computations are performed.- Returns:
- the mode in which the distance computations are performed
-
setComputationMode
public void setComputationMode(ALcdCrossCountryHeightProviderDistanceFunction.ComputationMode aComputationMode) Sets the mode in which the distance computations are be performed.- Parameters:
aComputationMode- the mode in which the distance computations should be performed- Throws:
NullPointerException- if the specified computation mode isnull
-
getSampleInterval
public double getSampleInterval()Returns the sample interval used in theALcdCrossCountryHeightProviderDistanceFunction.ComputationMode.FIXED_INTERVALmode. This interval is the maximum distance between two consequent samples when computing a distance.- Returns:
- the sample interval in the
FIXED_INTERVALmode
-
setSampleInterval
public void setSampleInterval(double aSampleInterval) Sets the sample interval in theFIXED_INTERVALmode.- Parameters:
aSampleInterval- the new sample interval in theFIXED_INTERVALmode- See Also:
-
getHeightProvider
Returns theILcdHeightProvideron which this distance function is based.- Returns:
- the
ILcdHeightProvideron which this distance function is based
-
computeDistance
protected abstract double computeDistance(ILcdPoint aStartPoint, double aStartValue, ILcdPoint aEndPoint, double aEndValue) Computes the distance between 2 points.- Parameters:
aStartPoint- the start pointaStartValue- the height at the start pointaEndPoint- the end pointaEndValue- the height at the end point- Returns:
- the distance between
aStartPointandaEndPoint
-
computeDistance
This method will call thecomputeDistance(com.luciad.shape.ILcdPoint, double, com.luciad.shape.ILcdPoint, double)method a number of times, depending on the computation mode, to compute the distance between the specified points.- Specified by:
computeDistancein interfaceILcdCrossCountryDistanceFunction- Parameters:
aStartPoint- the start point.aEndPoint- the end point.- Returns:
- the distance from
aStartPointtoaEndPoint.
-
getBounds
Returns the bounds of theILcdHeightProvideron which this distance function is based.- Specified by:
getBoundsin interfaceILcdCrossCountryDistanceFunction- Returns:
- the bounds in which this function can compute distances.
-