public class TLcdEarthTerrainElevationTileSet extends ALcdEarthTileSet
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.Constructor and Description |
---|
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.
|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
ILcdBounds |
getBounds()
Returns the bounds of this tile set, expressed in the model reference of the model that
contains this tile set.
|
double |
getDefaultElevationValue()
Returns the default elevation value.
|
ALcdEarthTerrainElevationProvider |
getElevationProvider()
Returns the elevation provider that is used.
|
ILcdEarthRasterTileSetCoverage |
getElevationTileSetCoverage()
Returns the coverage with the elevations.
|
ILcdEarthRasterTileSetCoverage |
getGeometryTileSetCoverage()
Returns the coverage with the geometry.
|
ILcdEarthRasterTileSetCoverage |
getInvAlphaLightMapTileSetCoverage()
Returns the coverage with the lightmap.
|
ILcdEarthRasterTileSetCoverage |
getLightMapTileSetCoverage()
Returns the coverage with the lightmap.
|
ILcdEarthRasterTileSetCoverage |
getNormalMapTileSetCoverage()
Returns the coverage with the normal map.
|
ILcdEarthTileSetCoverage |
getTileSetCoverage(int aIndex)
Returns the coverage at the specified index.
|
int |
getTileSetCoverageCount()
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).
|
cancelTile, containsTileSetCoverage, getLevelCount, getTileBoundsSFCT, getTileColumnCount, getTileRowCount, getTileSetCoverage, produceTile, updateTile, updateTile
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public TLcdEarthTerrainElevationTileSet(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, int aLevels, int aTileResolution)
aLonLatBounds
- the geodetic bounds of the tile setaElevationProvider
- the elevation provideraLevels
- the number of tile levelsaTileResolution
- the resolution of the geometry and image tilespublic TLcdEarthTerrainElevationTileSet(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, int aLevels, int aGeometryTileResolution, int aImageTileResolution)
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 tilespublic TLcdEarthTerrainElevationTileSet(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, int aLevels, long aLevel0Rows, long aLevel0Columns, int aTileResolution)
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 tilespublic TLcdEarthTerrainElevationTileSet(ILcdBounds aLonLatBounds, ALcdEarthTerrainElevationProvider aElevationProvider, int aLevels, long aLevel0Rows, long aLevel0Columns, int aGeometryTileResolution, int aImageTileResolution)
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 tilespublic TLcdEarthTerrainElevationTileSet(ILcdBounds aBounds, ALcdEarthTerrainElevationProvider aElevationProvider, int aLevels, long aLevel0Rows, long aLevel0Columns, int aGeometryTileResolution, int aImageTileResolution, ILcdGeoReference aModelReference)
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 referencepublic ALcdEarthTerrainElevationProvider getElevationProvider()
public void setElevationProvider(ALcdEarthTerrainElevationProvider aElevationProvider)
aElevationProvider
- the new elevation provider that should be used.public ILcdEarthRasterTileSetCoverage getGeometryTileSetCoverage()
public ILcdEarthRasterTileSetCoverage getElevationTileSetCoverage()
public ILcdEarthRasterTileSetCoverage getNormalMapTileSetCoverage()
public ILcdEarthRasterTileSetCoverage getLightMapTileSetCoverage()
public ILcdEarthRasterTileSetCoverage getInvAlphaLightMapTileSetCoverage()
AlphaComposite.SRC_ATOP
composite mode.public void setToLightVector(double vecX, double vecY, double vecZ)
vecX
- The x component of the direction.vecY
- The y component of the direction.vecZ
- The z component of the direction.public void setShadingParameters(double ambientCoefficient, double diffuseCoefficient)
ambientCoefficient
- The ambient reflection.diffuseCoefficient
- The diffuse reflectionpublic double getDefaultElevationValue()
0.0
.public void setDefaultElevationValue(double aValue)
aValue
- the value to set as default elevation valuegetDefaultElevationValue()
public void produceTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aTileX, long aTileY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext)
ILcdEarthTileSet
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
.
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 anypublic boolean containsTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, Object aContext)
ILcdEarthTileSet
containsTile
in interface ILcdEarthTileSet
containsTile
in class ALcdEarthTileSet
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 anypublic void dispose()
ILcdEarthTileSet
dispose
in interface ILcdEarthTileSet
dispose
in interface ILcdDisposable
dispose
in class ALcdEarthTileSet
public ILcdBounds getBounds()
ILcdEarthTileSet
ILcdBounded.getBounds()
public int getTileSetCoverageCount()
ILcdEarthTileSet
public ILcdEarthTileSetCoverage getTileSetCoverage(int aIndex)
ILcdEarthTileSet
aIndex
- the index of the coverage to returnILcdEarthTileSetCoverage
public boolean isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference)
ALcdEarthTileSet
isGeoReferenceSupported
in interface ILcdEarthTileSet
isGeoReferenceSupported
in class ALcdEarthTileSet
aCoverage
- the coverage to check foraGeoReference
- the reference to check forpublic boolean isFormatSupported(ILcdEarthTileSetCoverage aCoverage, TLcdEarthTileFormat aFormat)
ALcdEarthTileSet
isFormatSupported
in interface ILcdEarthTileSet
isFormatSupported
in class ALcdEarthTileSet
aCoverage
- the coverage to check foraFormat
- the format to check for