Class TLcdEarthTerrainHeightTileSet
- All Implemented Interfaces:
ILcdEarthTileSet
,ILcdBounded
,ILcdDisposable
,AutoCloseable
ILcdEarthTileSet
that can be used to produce 3D terrain
geometry, height data, a lightmap and a normalmap. This tileset uses a list of
ILcdModelHeightProviderFactory
s 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 Summary
ConstructorDescriptionTLcdEarthTerrainHeightTileSet
(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.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.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.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.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.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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the height data of the given layer to this height tileset.boolean
containsLayer
(ILcdLayer aLayer) Checks if this tileset uses the given layer.boolean
containsTile
(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext) Returns true if the repository contains the specified tile.void
dispose()
This method releases all resources held by the repository, such as file locks, threads or server connections.Returns all layers used in this tileset.Returns the bounds of this tile set, expressed in the model reference of the model that contains this tile set.double
Returns the default elevation value.Returns the coverage with the elevations.Returns the coverage with the geometry.Returns the coverage with the lightmap.Returns the coverage with the lightmap.Returns an unmodifiable list ofILcdModelHeightProviderFactory
s.Returns the coverage with the normal map.getTileSetCoverage
(int aIndex) Returns the coverage at the specified index.int
Returns the number of coverages this tileset contains.boolean
isFormatSupported
(ILcdEarthTileSetCoverage aCoverage, TLcdEarthTileFormat aFormat) Returns true only for the coverage's native format.boolean
isGeoReferenceSupported
(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference) Returns true only for the coverage's native georeference.void
produceTile
(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aTileX, long aTileY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext) Produces the requested tile, and invoke the supplied callback when done.void
removeLayer
(ILcdLayer aLayer) Removes the height data of the given layer from this height tileset.void
Sorts the height data of this tileset according to the given list of layers.void
setDefaultElevationValue
(double aValue) Sets the default elevation value.void
setModelHeightProviderFactories
(List<? extends ILcdModelHeightProviderFactory> aFactories) Sets the list ofILcdModelHeightProviderFactory
s.void
setShadingParameters
(double ambientCoefficient, double diffuseCoefficient) Sets the shading parameters for the light map generation.void
setToLightVector
(double vecX, double vecY, double vecZ) Sets the vector to the light to the given vector (in a geocentric reference).Methods inherited from class com.luciad.earth.tileset.ALcdEarthTileSet
cancelTile, containsTileSetCoverage, getLevelCount, getTileBoundsSFCT, getTileColumnCount, getTileRowCount, getTileSetCoverage, produceTile, updateTile, updateTile
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdDisposable
close
-
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 setaFactories
- the list of height provider factories used to create the height dataaMaxCacheSize
- the maximum number of height providers per modelaLevels
- the number of tile levelsaTileResolution
- 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 setaFactories
- the list of height provider factories used to create the height dataaMaxCacheSize
- the maximum number of height providers per modelaLevels
- the number of tile levelsaGeometryTileResolution
- the resolution of the produced geometry tilesaImageTileResolution
- 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 setaFactories
- the list of height provider factories used to create the height dataaMaxCacheSize
- the maximum number of height providers per modelaLevels
- the number of tile levelsaLevel0Rows
- the number of tile rows at level 0aLevel0Columns
- the number of tile columns at level 0aTileResolution
- 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 setaFactories
- the list of height provider factories used to create the height dataaMaxCacheSize
- the maximum number of height providers per modelaLevels
- the number of tile levelsaLevel0Rows
- the number of tile rows at level 0aLevel0Columns
- the number of tile columns at level 0aGeometryTileResolution
- the resolution of the produced geometry tilesaImageTileResolution
- 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 referenceaFactories
- the list of height provider factories used to create the height dataaMaxCacheSize
- the maximum number of height providers per modelaLevels
- the number of tile levelsaLevel0Rows
- the number of tile rows at level 0aLevel0Columns
- the number of tile columns at level 0aGeometryTileResolution
- the resolution of the produced geometry tilesaImageTileResolution
- the resolution of the produced image tilesaModelReference
- 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 referenceaFactories
- the list of height provider factories used to create the height dataaMaxCacheSize
- the maximum number of height providers per modelaLevels
- the number of tile levelsaLevel0Rows
- the number of tile rows at level 0aLevel0Columns
- the number of tile columns at level 0aGeometryTileResolution
- the resolution of the produced geometry tilesaImageTileResolution
- the resolution of the produced image tilesaElevationTileResolution
- the resolution of the produced elevation tilesaModelReference
- the model reference
-
-
Method Details
-
setModelHeightProviderFactories
public void setModelHeightProviderFactories(List<? extends ILcdModelHeightProviderFactory> aFactories) Sets the list ofILcdModelHeightProviderFactory
s.- Parameters:
aFactories
- a list ofILcdModelHeightProviderFactory
s.
-
getModelHeightProviderFactories
Returns an unmodifiable list ofILcdModelHeightProviderFactory
s.- Returns:
- the unmodifiable list of
ILcdModelHeightProviderFactory
s.
-
addLayer
Adds the height data of the given layer to this height tileset.- Parameters:
aLayer
- the layer
-
removeLayer
Removes the height data of the given layer from this height tileset.- Parameters:
aLayer
- the layer
-
reorder
Sorts the height data of this tileset according to the given list of layers.- Parameters:
aOrderedList
- a list of layers
-
containsLayer
Checks if this tileset uses the given layer.- Parameters:
aLayer
- the layer- Returns:
true
if this tileset uses the given layer andfalse
otherwise
-
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
Returns the coverage with the geometry.- Returns:
- the geometry coverage.
-
getElevationTileSetCoverage
Returns the coverage with the elevations.- Returns:
- the elevation coverage.
-
getNormalMapTileSetCoverage
Returns the coverage with the normal map.- Returns:
- the geometry coverage.
-
getLightMapTileSetCoverage
Returns the coverage with the lightmap. The light light intensity values are encoded as grayscale values.- Returns:
- The grayscale lightmap coverage.
-
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 theAlphaComposite.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 is0.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'stileAvailable()
method. If the tile cannot be produced for some reason, the methodtileNotAvailable()
should be called instead.If the tileset supports it and
aMode
isTLcdEarthTileOperationMode.PREFER_ASYNCHRONOUS
, the tile request may be executed asynchronously. However, the callback must be invoked at some point in time, unless thecancelTile()
method is used to cancel the tile request before it is executed. IfaMode
isTLcdEarthTileOperationMode.FORCE_SYNCHRONOUS
, the request must be executed synchronously and the callback must be invoked beforeproduceTile()
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 calltileNotAvailable()
. If the tileset callstileAvailable()
, the geo reference of the resulting tile must be equal toaGeoReference
, 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, useisFormatSupported()
. If the specified format is not supported, the tileset should calltileNotAvailable()
.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 requestedaLevel
- the level from which the tile is requestedaTileX
- the column index of the requested tileaTileY
- the row index of the requested tileaGeoReference
- the reference system in which the tile should be returnedaFormat
- the desired format of the tile's dataaMode
- controls the synchronous or asynchronous behaviour of the tilesetaCallback
- will be invoked when the tile is available to be usedaContext
- 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 interfaceILcdEarthTileSet
- Overrides:
containsTile
in classALcdEarthTileSet
- Parameters:
aCoverage
- the coverage from which to query a tileaLevel
- the detail level for which to query a tileaX
- the column index at which to query a tileaY
- the row index at which to query a tileaContext
- 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 interfaceILcdDisposable
- Specified by:
dispose
in interfaceILcdEarthTileSet
- Overrides:
dispose
in classALcdEarthTileSet
-
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
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 interfaceILcdEarthTileSet
- Overrides:
isGeoReferenceSupported
in classALcdEarthTileSet
- Parameters:
aCoverage
- the coverage to check foraGeoReference
- the reference to check for- Returns:
- true if the given coverage can be queried with the given reference
-
isFormatSupported
Description copied from class:ALcdEarthTileSet
Returns true only for the coverage's native format.- Specified by:
isFormatSupported
in interfaceILcdEarthTileSet
- Overrides:
isFormatSupported
in classALcdEarthTileSet
- Parameters:
aCoverage
- the coverage to check foraFormat
- the format to check for- Returns:
- true if the given coverage can be queried with the given format
-