Class TLcdDefaultVVGridLineOrdinateProvider

java.lang.Object
com.luciad.view.vertical.TLcdDefaultVVGridLineOrdinateProvider
All Implemented Interfaces:
ILcdVVGridLineOrdinateProvider

public class TLcdDefaultVVGridLineOrdinateProvider extends Object

This class is a default implementation of ILcdVVGridLineOrdinateProvider.

This grid-line ordinate provider uses a computed grid step to provide the ordinate information. This grid step is computed as follows:

  1. The power of 10 closest to the specified range is found. This is the reference_step.
  2. If, for one of the following steps, the pixel separation is larger than the minimum, that step is used to provide the ordinates. If none of the steps are usable, the last step is used anyway.
    • reference_step / 4.0
    • reference_step / 2.0
    • reference_step
    • reference_step * 2.5
    • reference_step * 5.0
    Note that the minimum pixel separation for grid-line ordinates is 30 pixels and for sub grid-line ordinates 5 pixels.

Since:
8.1
  • Constructor Details

    • TLcdDefaultVVGridLineOrdinateProvider

      public TLcdDefaultVVGridLineOrdinateProvider()
      Constructs a default grid-line ordinate provider.
  • Method Details

    • getSnappedRange

      public ILcdInterval getSnappedRange(double aScale, ILcdInterval aRange, TLcdAltitudeUnit aUnit)

      Returns the range required by the vertical view to snap to its grid. This method is used when the vertical view is configured to snap to its grid.

      Note that the method computes a grid step as described in the class documentation.

      Specified by:
      getSnappedRange in interface ILcdVVGridLineOrdinateProvider
      Parameters:
      aScale - The scale of the vertical view grid, defined in pixels per altitude unit.
      aRange - The current range of the vertical view grid.
      aUnit - The altitude unit in which the vertical view grid is defined.
      Returns:
      the range required by the vertical view to snap to its grid.
    • getGridLineOrdinates

      public double[] getGridLineOrdinates(double aScale, ILcdInterval aRange, TLcdAltitudeUnit aUnit)

      Returns an array of altitudes for which a grid-line is needed in the vertical view.

      Note that the method computes a grid step as described in the class documentation.

      Specified by:
      getGridLineOrdinates in interface ILcdVVGridLineOrdinateProvider
      Parameters:
      aScale - The scale of the vertical view grid, defined in pixels per altitude unit.
      aRange - The current range of the vertical view grid.
      aUnit - The altitude unit in which the vertical view grid is defined.
      Returns:
      an array of altitudes for which a grid-line is needed in the vertical view.
    • getSubGridLineOrdinates

      public double[] getSubGridLineOrdinates(double aScale, ILcdInterval aRange, TLcdAltitudeUnit aUnit)

      Returns an array of altitudes for which a sub grid-line is needed in the vertical view.

      Note that the method computes a grid step as described in the class documentation.

      Specified by:
      getSubGridLineOrdinates in interface ILcdVVGridLineOrdinateProvider
      Parameters:
      aScale - The scale of the vertical view grid, defined in pixels per altitude unit.
      aRange - The current range of the vertical view grid.
      aUnit - The altitude unit in which the vertical view grid is defined.
      Returns:
      an array of altitudes for which a sub grid-line is needed in the vertical view.