Class TLcdDefaultVVGridLineOrdinateProvider
- All Implemented Interfaces:
ILcdVVGridLineOrdinateProvider
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:
- The power of 10 closest to the specified range is found. This is the reference_step.
- 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
- Since:
- 8.1
-
Constructor Summary
ConstructorDescriptionConstructs a default grid-line ordinate provider. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getGridLineOrdinates
(double aScale, ILcdInterval aRange, TLcdAltitudeUnit aUnit) Returns an array of altitudes for which a grid-line is needed in the vertical view.getSnappedRange
(double aScale, ILcdInterval aRange, TLcdAltitudeUnit aUnit) Returns the range required by the vertical view to snap to its grid.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.
-
Constructor Details
-
TLcdDefaultVVGridLineOrdinateProvider
public TLcdDefaultVVGridLineOrdinateProvider()Constructs a default grid-line ordinate provider.
-
-
Method Details
-
getSnappedRange
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 interfaceILcdVVGridLineOrdinateProvider
- 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
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 interfaceILcdVVGridLineOrdinateProvider
- 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
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 interfaceILcdVVGridLineOrdinateProvider
- 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.
-