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
  • Constructor Details

    • ALcdCrossCountryHeightProviderDistanceFunction

      public ALcdCrossCountryHeightProviderDistanceFunction(ILcdHeightProvider aHeightProvider)
      Constructs a new ALcdCrossCountryHeightProviderDistanceFunction based on aHeightProvider. The distances will be computed in the ALcdCrossCountryHeightProviderDistanceFunction.ComputationMode.SIMPLE mode.
      Parameters:
      aHeightProvider - the ILcdHeightProvider the distance function is based on
    • ALcdCrossCountryHeightProviderDistanceFunction

      public ALcdCrossCountryHeightProviderDistanceFunction(ILcdHeightProvider aHeightProvider, double aSampleInterval)
      Constructs a new ALcdCrossCountryHeightProviderDistanceFunction based on aHeightProvider. The distances will be computed in the ALcdCrossCountryHeightProviderDistanceFunction.ComputationMode.FIXED_INTERVAL mode.
      Parameters:
      aHeightProvider - the ILcdHeightProvider the distance function is based on
      aSampleInterval - 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 is null
    • getSampleInterval

      public double getSampleInterval()
      Returns the sample interval used in the ALcdCrossCountryHeightProviderDistanceFunction.ComputationMode.FIXED_INTERVAL mode. This interval is the maximum distance between two consequent samples when computing a distance.
      Returns:
      the sample interval in the FIXED_INTERVAL mode
    • setSampleInterval

      public void setSampleInterval(double aSampleInterval)
      Sets the sample interval in the FIXED_INTERVAL mode.
      Parameters:
      aSampleInterval - the new sample interval in the FIXED_INTERVAL mode
      See Also:
    • getHeightProvider

      public ILcdHeightProvider getHeightProvider()
      Returns the ILcdHeightProvider on which this distance function is based.
      Returns:
      the ILcdHeightProvider on 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 point
      aStartValue - the height at the start point
      aEndPoint - the end point
      aEndValue - the height at the end point
      Returns:
      the distance between aStartPoint and aEndPoint
    • computeDistance

      public double computeDistance(ILcdPoint aStartPoint, ILcdPoint aEndPoint)
      This method will call the computeDistance(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:
      computeDistance in interface ILcdCrossCountryDistanceFunction
      Parameters:
      aStartPoint - the start point.
      aEndPoint - the end point.
      Returns:
      the distance from aStartPoint to aEndPoint.
    • getBounds

      public ILcdBounds getBounds()
      Returns the bounds of the ILcdHeightProvider on which this distance function is based.
      Specified by:
      getBounds in interface ILcdCrossCountryDistanceFunction
      Returns:
      the bounds in which this function can compute distances.