Class TLcdEarthTerrainElevationTileSet
- All Implemented Interfaces:
ILcdEarthTileSet
,ILcdBounded
,ILcdDisposable
,AutoCloseable
ILcdEarthTileSet
that can be used to produce 3D terrain
geometry, elevation data, a lightmap and a normalmap. This tileset uses an
ALcdEarthTerrainElevationProvider
to produce this data.
This tileset can for example be used to generate the terrain geometry on-the-fly.
This tileset is thread-safe for tile reading if the elevation provider
(see getElevationProvider()
) is thread-safe.- Since:
- 8.2
-
Constructor Summary
ConstructorDescriptionTLcdEarthTerrainElevationTileSet
(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, int aLevels, int aTileResolution) Constructs a terrain elevation tile set with the specified settings, default tile layout at level 0 and a geodetic reference.TLcdEarthTerrainElevationTileSet
(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, 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.TLcdEarthTerrainElevationTileSet
(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileResolution) Constructs a terrain elevation tile set with the specified settings and a geodetic reference.TLcdEarthTerrainElevationTileSet
(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, int aLevels, long aLevel0Rows, long aLevel0Columns, int aGeometryTileResolution, int aImageTileResolution) Constructs a terrain elevation tile set with the specified settings and a geodetic reference.TLcdEarthTerrainElevationTileSet
(ILcdBounds aBounds, ALcdEarthTerrainElevationProvider aElevationProvider, int aLevels, long aLevel0Rows, long aLevel0Columns, int aGeometryTileResolution, int aImageTileResolution, ILcdGeoReference aModelReference) Constructs a terrain elevation tile set with the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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 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 elevation provider that is used.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 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
setDefaultElevationValue
(double aValue) Sets the default elevation value.void
setElevationProvider
(ALcdEarthTerrainElevationProvider aElevationProvider) Sets the elevation provider that is used.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
-
TLcdEarthTerrainElevationTileSet
public TLcdEarthTerrainElevationTileSet(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, 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 setaElevationProvider
- the elevation provideraLevels
- the number of tile levelsaTileResolution
- the resolution of the geometry and image tiles
-
TLcdEarthTerrainElevationTileSet
public TLcdEarthTerrainElevationTileSet(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, 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 setaElevationProvider
- the elevation provideraLevels
- the number of tile levelsaGeometryTileResolution
- the resolution of the produced geometry tilesaImageTileResolution
- the resolution of the produced image tiles
-
TLcdEarthTerrainElevationTileSet
public TLcdEarthTerrainElevationTileSet(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, 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 setaElevationProvider
- the elevation provideraLevels
- 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
-
TLcdEarthTerrainElevationTileSet
public TLcdEarthTerrainElevationTileSet(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, 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 setaElevationProvider
- the elevation provideraLevels
- 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
-
TLcdEarthTerrainElevationTileSet
public TLcdEarthTerrainElevationTileSet(ILcdBounds aBounds, ALcdEarthTerrainElevationProvider aElevationProvider, 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 referenceaElevationProvider
- the elevation provideraLevels
- 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
-
-
Method Details
-
getElevationProvider
Returns the elevation provider that is used.- Returns:
- the elevation provider that is used.
-
setElevationProvider
Sets the elevation provider that is used.- Parameters:
aElevationProvider
- the new elevation provider that should be used.
-
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
-