Class TLcdEarthTerrainHeightTileSet

java.lang.Object
com.luciad.earth.tileset.ALcdEarthTileSet
com.luciad.earth.tileset.terrain.TLcdEarthTerrainHeightTileSet
All Implemented Interfaces:
ILcdEarthTileSet, ILcdBounded, ILcdDisposable, AutoCloseable

public class TLcdEarthTerrainHeightTileSet extends ALcdEarthTileSet
An ILcdEarthTileSet that can be used to produce 3D terrain geometry, height data, a lightmap and a normalmap. This tileset uses a list of ILcdModelHeightProviderFactorys to produce this data.

This tileset can for example be used to generate the terrain geometry on-the-fly.

This class is thread-safe.

Since:
9.1
  • Constructor Details

    • TLcdEarthTerrainHeightTileSet

      public TLcdEarthTerrainHeightTileSet(ILcdBounds aLonLatBounds, List<ILcdModelHeightProviderFactory> aFactories, int aMaxCacheSize, int aLevels, int aTileResolution)
      Constructs a terrain elevation tile set with the specified settings, default tile layout at level 0 and a geodetic reference.
      Parameters:
      aLonLatBounds - the geodetic bounds of the tile set
      aFactories - the list of height provider factories used to create the height data
      aMaxCacheSize - the maximum number of height providers per model
      aLevels - the number of tile levels
      aTileResolution - the resolution of the geometry and image tiles
    • TLcdEarthTerrainHeightTileSet

      public TLcdEarthTerrainHeightTileSet(ILcdBounds aLonLatBounds, List<? extends ILcdModelHeightProviderFactory> aFactories, int aMaxCacheSize, int aLevels, int aGeometryTileResolution, int aImageTileResolution)
      Constructs a terrain elevation tile set with the specified settings, default tile layout at level 0 and a geodetic reference.
      Parameters:
      aLonLatBounds - the geodetic bounds of the tile set
      aFactories - the list of height provider factories used to create the height data
      aMaxCacheSize - the maximum number of height providers per model
      aLevels - the number of tile levels
      aGeometryTileResolution - the resolution of the produced geometry tiles
      aImageTileResolution - the resolution of the produced image tiles
    • TLcdEarthTerrainHeightTileSet

      public TLcdEarthTerrainHeightTileSet(ILcdBounds aLonLatBounds, List<? extends ILcdModelHeightProviderFactory> aFactories, int aMaxCacheSize, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileResolution)
      Constructs a terrain elevation tile set with the specified settings and a geodetic reference.
      Parameters:
      aLonLatBounds - the geodetic bounds of the tile set
      aFactories - the list of height provider factories used to create the height data
      aMaxCacheSize - the maximum number of height providers per model
      aLevels - the number of tile levels
      aLevel0Rows - the number of tile rows at level 0
      aLevel0Columns - the number of tile columns at level 0
      aTileResolution - the resolution of the geometry and image tiles
    • TLcdEarthTerrainHeightTileSet

      public TLcdEarthTerrainHeightTileSet(ILcdBounds aLonLatBounds, List<? extends ILcdModelHeightProviderFactory> aFactories, int aMaxCacheSize, int aLevels, long aLevel0Rows, long aLevel0Columns, int aGeometryTileResolution, int aImageTileResolution)
      Constructs a terrain elevation tile set with the specified settings and a geodetic reference.
      Parameters:
      aLonLatBounds - the geodetic bounds of the tile set
      aFactories - the list of height provider factories used to create the height data
      aMaxCacheSize - the maximum number of height providers per model
      aLevels - the number of tile levels
      aLevel0Rows - the number of tile rows at level 0
      aLevel0Columns - the number of tile columns at level 0
      aGeometryTileResolution - the resolution of the produced geometry tiles
      aImageTileResolution - the resolution of the produced image tiles
    • TLcdEarthTerrainHeightTileSet

      public TLcdEarthTerrainHeightTileSet(ILcdBounds aBounds, List<? extends ILcdModelHeightProviderFactory> aFactories, int aMaxCacheSize, int aLevels, long aLevel0Rows, long aLevel0Columns, int aGeometryTileResolution, int aImageTileResolution, ILcdGeoReference aModelReference)
      Constructs a terrain elevation tile set with the specified settings.
      Parameters:
      aBounds - the bounds of the tile set in the model reference
      aFactories - the list of height provider factories used to create the height data
      aMaxCacheSize - the maximum number of height providers per model
      aLevels - the number of tile levels
      aLevel0Rows - the number of tile rows at level 0
      aLevel0Columns - the number of tile columns at level 0
      aGeometryTileResolution - the resolution of the produced geometry tiles
      aImageTileResolution - the resolution of the produced image tiles
      aModelReference - the model reference
    • TLcdEarthTerrainHeightTileSet

      public TLcdEarthTerrainHeightTileSet(ILcdBounds aBounds, List<ILcdModelHeightProviderFactory> aFactories, int aMaxCacheSize, int aLevels, long aLevel0Rows, long aLevel0Columns, int aGeometryTileResolution, int aImageTileResolution, int aElevationTileResolution, ILcdGeoReference aModelReference)
      Constructs a terrain elevation tile set with the specified settings.
      Parameters:
      aBounds - the bounds of the tile set in the model reference
      aFactories - the list of height provider factories used to create the height data
      aMaxCacheSize - the maximum number of height providers per model
      aLevels - the number of tile levels
      aLevel0Rows - the number of tile rows at level 0
      aLevel0Columns - the number of tile columns at level 0
      aGeometryTileResolution - the resolution of the produced geometry tiles
      aImageTileResolution - the resolution of the produced image tiles
      aElevationTileResolution - the resolution of the produced elevation tiles
      aModelReference - the model reference
  • Method Details

    • setModelHeightProviderFactories

      public void setModelHeightProviderFactories(List<? extends ILcdModelHeightProviderFactory> aFactories)
      Sets the list of ILcdModelHeightProviderFactorys.
      Parameters:
      aFactories - a list of ILcdModelHeightProviderFactorys.
    • getModelHeightProviderFactories

      public List<ILcdModelHeightProviderFactory> getModelHeightProviderFactories()
      Returns an unmodifiable list of ILcdModelHeightProviderFactorys.
      Returns:
      the unmodifiable list of ILcdModelHeightProviderFactorys.
    • addLayer

      public void addLayer(ILcdLayer aLayer)
      Adds the height data of the given layer to this height tileset.
      Parameters:
      aLayer - the layer
    • removeLayer

      public void removeLayer(ILcdLayer aLayer)
      Removes the height data of the given layer from this height tileset.
      Parameters:
      aLayer - the layer
    • reorder

      public void reorder(List<ILcdLayer> aOrderedList)
      Sorts the height data of this tileset according to the given list of layers.
      Parameters:
      aOrderedList - a list of layers
    • containsLayer

      public boolean containsLayer(ILcdLayer aLayer)
      Checks if this tileset uses the given layer.
      Parameters:
      aLayer - the layer
      Returns:
      true if this tileset uses the given layer and false otherwise
    • getAllLayers

      public List<ILcdLayer> getAllLayers()
      Returns all layers used in this tileset. The returned list is unmodifiable. When this list is returned, it reflects the current state of the object.
      Returns:
      a list of all layers used in this tileset. When no layers are used, an empty list is returned
    • getGeometryTileSetCoverage

      public ILcdEarthRasterTileSetCoverage getGeometryTileSetCoverage()
      Returns the coverage with the geometry.
      Returns:
      the geometry coverage.
    • getElevationTileSetCoverage

      public ILcdEarthRasterTileSetCoverage getElevationTileSetCoverage()
      Returns the coverage with the elevations.
      Returns:
      the elevation coverage.
    • getNormalMapTileSetCoverage

      public ILcdEarthRasterTileSetCoverage getNormalMapTileSetCoverage()
      Returns the coverage with the normal map.
      Returns:
      the geometry coverage.
    • getLightMapTileSetCoverage

      public ILcdEarthRasterTileSetCoverage getLightMapTileSetCoverage()
      Returns the coverage with the lightmap. The light light intensity values are encoded as grayscale values.
      Returns:
      The grayscale lightmap coverage.
    • getInvAlphaLightMapTileSetCoverage

      public ILcdEarthRasterTileSetCoverage getInvAlphaLightMapTileSetCoverage()
      Returns the coverage with the lightmap. The inverted light intensity values are encoded in the alpha channel. This allows baking the lightmap with a texture by simply using the AlphaComposite.SRC_ATOP composite mode.
      Returns:
      The inverted alpha lightmap coverage.
    • setToLightVector

      public void setToLightVector(double vecX, double vecY, double vecZ)
      Sets the vector to the light to the given vector (in a geocentric reference). The given vector does not need to be normalized.
      Parameters:
      vecX - The x component of the direction.
      vecY - The y component of the direction.
      vecZ - The z component of the direction.
    • setShadingParameters

      public void setShadingParameters(double ambientCoefficient, double diffuseCoefficient)
      Sets the shading parameters for the light map generation.
      Parameters:
      ambientCoefficient - The ambient reflection.
      diffuseCoefficient - The diffuse reflection
    • getDefaultElevationValue

      public double getDefaultElevationValue()
      Returns the default elevation value. This value will be used when no elevation information is available.

      This is similar to a transparency value for images. The default value is 0.0.

      Returns:
      the default value elevation value
    • setDefaultElevationValue

      public void setDefaultElevationValue(double aValue)
      Sets the default elevation value. This value will be used when no elevation information is available.
      Parameters:
      aValue - the value to set as default elevation value
      See Also:
    • produceTile

      public void produceTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aTileX, long aTileY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext)
      Description copied from interface: ILcdEarthTileSet
      Produces the requested tile, and invoke the supplied callback when done. The resulting tile is passed to the call back's tileAvailable() method. If the tile cannot be produced for some reason, the method tileNotAvailable() should be called instead.

      If the tileset supports it and aMode is TLcdEarthTileOperationMode.PREFER_ASYNCHRONOUS, the tile request may be executed asynchronously. However, the callback must be invoked at some point in time, unless the cancelTile() method is used to cancel the tile request before it is executed. If aMode is TLcdEarthTileOperationMode.FORCE_SYNCHRONOUS, the request must be executed synchronously and the callback must be invoked before produceTile() returns.

      Tiles may be requested in reference systems other than the native geo reference of the underlying data, provided that the isGeoReferenceSupported() method returns true for the requested reference. If this is not the case, the tileset should call tileNotAvailable(). If the tileset calls tileAvailable(), the geo reference of the resulting tile must be equal to aGeoReference, and the tile's bounds must likewise be expressed in this reference.

      Similarly, tiles may be requested in different data formats, as described by TLcdEarthTileFormat. The format determines the type of the data object that will be contained in the requested tile. To check if a format is supported, use isFormatSupported(). If the specified format is not supported, the tileset should call tileNotAvailable().

      The context parameter may be used to pass application-specific data into the tileset. If it is not needed, its value may be null.

      Parameters:
      aCoverage - the coverage from which the tile is requested
      aLevel - the level from which the tile is requested
      aTileX - the column index of the requested tile
      aTileY - the row index of the requested tile
      aGeoReference - the reference system in which the tile should be returned
      aFormat - the desired format of the tile's data
      aMode - controls the synchronous or asynchronous behaviour of the tileset
      aCallback - will be invoked when the tile is available to be used
      aContext - application-specific data to be used by the tileset, if any
    • containsTile

      public boolean containsTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext)
      Description copied from interface: ILcdEarthTileSet
      Returns true if the repository contains the specified tile.
      Specified by:
      containsTile in interface ILcdEarthTileSet
      Overrides:
      containsTile in class ALcdEarthTileSet
      Parameters:
      aCoverage - the coverage from which to query a tile
      aLevel - the detail level for which to query a tile
      aX - the column index at which to query a tile
      aY - the row index at which to query a tile
      aContext - application-specific data to be used by the tileset, if any
      Returns:
      true if the repository contains the requested tile
    • dispose

      public void dispose()
      Description copied from interface: ILcdEarthTileSet
      This method releases all resources held by the repository, such as file locks, threads or server connections.
      Specified by:
      dispose in interface ILcdDisposable
      Specified by:
      dispose in interface ILcdEarthTileSet
      Overrides:
      dispose in class ALcdEarthTileSet
    • getBounds

      public ILcdBounds getBounds()
      Description copied from interface: ILcdEarthTileSet
      Returns the bounds of this tile set, expressed in the model reference of the model that contains this tile set.
      Returns:
      the bounds of this tile set
      See Also:
    • getTileSetCoverageCount

      public int getTileSetCoverageCount()
      Description copied from interface: ILcdEarthTileSet
      Returns the number of coverages this tileset contains.
      Returns:
      the number of coverages this tileset contains
    • getTileSetCoverage

      public ILcdEarthTileSetCoverage getTileSetCoverage(int aIndex)
      Description copied from interface: ILcdEarthTileSet
      Returns the coverage at the specified index.
      Parameters:
      aIndex - the index of the coverage to return
      Returns:
      the requested ILcdEarthTileSetCoverage
    • isGeoReferenceSupported

      public boolean isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference)
      Description copied from class: ALcdEarthTileSet
      Returns true only for the coverage's native georeference.
      Specified by:
      isGeoReferenceSupported in interface ILcdEarthTileSet
      Overrides:
      isGeoReferenceSupported in class ALcdEarthTileSet
      Parameters:
      aCoverage - the coverage to check for
      aGeoReference - the reference to check for
      Returns:
      true if the given coverage can be queried with the given reference
    • isFormatSupported

      public boolean isFormatSupported(ILcdEarthTileSetCoverage aCoverage, TLcdEarthTileFormat aFormat)
      Description copied from class: ALcdEarthTileSet
      Returns true only for the coverage's native format.
      Specified by:
      isFormatSupported in interface ILcdEarthTileSet
      Overrides:
      isFormatSupported in class ALcdEarthTileSet
      Parameters:
      aCoverage - the coverage to check for
      aFormat - the format to check for
      Returns:
      true if the given coverage can be queried with the given format