public class TLcdEarthTexturedTerrainTileSet extends Object implements ILcdEarthTileSet
TLcdEarthTexturedTerrainTileVertexArray
objects. These tiles can be visualized as a 3D terrain.
Coverage | Comments | Supported format |
---|---|---|
texture | This coverage can be specified in the constructor and contains the texture or image data of the terrain. | BufferedImage orTLcdEarthTextureData |
elevation | This coverage can be specified in the constructor and contains the elevation data of the terrain. The elevation data can be used to generate the terrain geometry on-the-fly. | TLcdEarthElevationData |
geometry | This coverage can be specified in the constructor and contains the geometry of the terrain. | TLcdEarthTerrainTileVertexArray |
textured geometry | This coverage combines the texture and geometry data into textured geometry tiles (that is terrain tiles). | TLcdEarthTexturedTerrainTileVertexArray |
textured geometry coverage
and either the geometry tile or image tile is missing this tile set will try to produce the
missing image/geometry tile by falling back to a lower level. This fall back is only supported
for geometry tiles if they are elevation-based (that is no geometry tile set was specified in the
constructor). The fallback behavior can be disabled by setting setFallbackForTerrainTiles(boolean)
to false
. The advantage of using the fall back is that the texture and geometry/elevation
tile sets do not need to contain the same set of tiles. As a result less data may need to be
stored and retrieved.
The resolution of the textured geometry tiles can differ from the resolution of the tiles in the
texture coverage. The difference can be changed through the setTerrainTextureResolution(int)
method. By default the terrain texture resolution is set to 128
.
Constructor and Description |
---|
TLcdEarthTexturedTerrainTileSet(ILcdEarthTileSet aGeometrySet,
ILcdEarthRasterTileSetCoverage aGeometryTileSetCoverage,
ILcdEarthTileSet aTextureSet,
ILcdEarthRasterTileSetCoverage aTextureTileSetCoverage)
Constructs a new
TLcdEarthTextureTerrainTileSet with the specified geometry and
texture data. |
TLcdEarthTexturedTerrainTileSet(ILcdEarthTileSet aGeometrySet,
ILcdEarthRasterTileSetCoverage aGeometryTileSetCoverage,
ILcdEarthTileSet aElevationSet,
ILcdEarthRasterTileSetCoverage aElevationTileSetCoverage,
ILcdEarthTileSet aTextureSet,
ILcdEarthRasterTileSetCoverage aTextureTileSetCoverage)
Constructs a new
TLcdEarthTextureTerrainTileSet with the specified geometry and
texture data. |
TLcdEarthTexturedTerrainTileSet(ILcdEarthTileSet aGeometrySet,
ILcdEarthRasterTileSetCoverage aGeometryTileSetCoverage,
ILcdEarthTileSet aElevationSet,
ILcdEarthRasterTileSetCoverage aElevationTileSetCoverage,
ILcdEarthTileSet aTextureSet,
ILcdEarthRasterTileSetCoverage aTextureTileSetCoverage,
ILcdGeoReference aModelReference)
Constructs a new
TLcdEarthTextureTerrainTileSet with the specified geometry and
texture data. |
TLcdEarthTexturedTerrainTileSet(ILcdEarthTileSet aGeometrySet,
ILcdEarthRasterTileSetCoverage aGeometryTileSetCoverage,
ILcdEarthTileSet aTextureSet,
ILcdEarthRasterTileSetCoverage aTextureTileSetCoverage,
ILcdGeoReference aModelReference)
Constructs a new
TLcdEarthTextureTerrainTileSet with the specified geometry and
texture data. |
Modifier and Type | Method and Description |
---|---|
void |
cancelTile(int aLevel,
long aTileX,
long aTileY,
ILcdEarthTileSetCoverage aCoverage,
ILcdGeoReference aGeoReference,
TLcdEarthTileFormat aFormat,
ILcdEarthTileSetCallback aCallback,
Object aContext)
Cancels any pending tile requests for the given parameters.
|
void |
clearCache()
Clears the internal cache.
|
boolean |
containsTile(ILcdEarthTileSetCoverage aCoverage,
int aLevel,
long aX,
long aY,
Object aContext)
Returns true if the repository contains the specified tile.
|
boolean |
containsTileSetCoverage(String aCoverageName)
Returns true if the repository contains a coverage with the specified name.
|
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.
|
ILcdEarthRasterTileSetCoverage |
getElevationCoverage()
Returns the coverage with the elevations.
|
ILcdEarthRasterTileSetCoverage |
getGeometryCoverage()
Returns the coverage with the geometry.
|
int |
getLevelCount()
Returns the number of available detail levels.
|
int |
getTerrainTextureResolution()
Returns the resolution of the terrain textures.
|
ILcdEarthRasterTileSetCoverage |
getTextureCoverage()
Returns the coverage with the textures.
|
ILcdEarthTileSetCoverage |
getTexturedGeometryCoverage()
Returns the coverage with the textured geometry.
|
long |
getTileColumnCount(int aLevel)
Returns the number of columns in the tile grid at the given level.
|
long |
getTileLifeTime()
Returns the maximum time for which a cached tile can be reused.
|
long |
getTileRowCount(int aLevel)
Returns the number of rows in the tile grid at the given level.
|
ILcdEarthTileSetCoverage |
getTileSetCoverage(int aIndex)
Returns the coverage at the specified index.
|
ILcdEarthTileSetCoverage |
getTileSetCoverage(String aCoverageName)
Returns the tileset coverage with the specified name.
|
int |
getTileSetCoverageCount()
Returns the number of coverages this tileset contains.
|
boolean |
isFallbackForTerrainTiles()
Returns whether this tile set will try to produce a missing geometry or texture tile needed for
producing a terrain tile (that is a tile in the
textured
geometry coverage ) by falling back to a lower level if the other tile is available (that is no
fall back will occur if both the geometry and texture tile are not available). |
boolean |
isFormatSupported(ILcdEarthTileSetCoverage aCoverage,
TLcdEarthTileFormat aFormat)
Returns true if the tileset can produce tiles for the given coverage in the given format.
|
boolean |
isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage,
ILcdGeoReference aGeoReference)
Returns true if the tileset can produce tiles for the given coverage in the given reference
system.
|
ALcdEarthTile |
produceTile(ILcdEarthTileSetCoverage aCoverage,
int aLevel,
long aX,
long aY,
ILcdGeoReference aGeoReference,
TLcdEarthTileFormat aFormat,
Object aContext)
Gets a tile from the repository.
|
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 |
setFallbackForTerrainTiles(boolean aFallbackForTerrainTiles)
Sets whether this tile set should try to fall back to a lower level for terrain tiles.
|
void |
setTerrainTextureResolution(int aTextureResolution)
Sets the resolution of the terrain textures.
|
void |
setTileLifeTime(long aTime)
Sets the maximum time for which a tile can be reused.
|
void |
updateCache()
Updates the internal cache.
|
ALcdEarthTile |
updateTile(ALcdEarthTile aEarthTile,
Object aContext)
Returns an updated version of the specified tile.
|
void |
updateTile(ALcdEarthTile aTile,
TLcdEarthTileOperationMode aMode,
ILcdEarthTileSetCallback aCallback,
Object aContext)
Produces an updated version of the given tile, if necessary.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public TLcdEarthTexturedTerrainTileSet(ILcdEarthTileSet aGeometrySet, ILcdEarthRasterTileSetCoverage aGeometryTileSetCoverage, ILcdEarthTileSet aTextureSet, ILcdEarthRasterTileSetCoverage aTextureTileSetCoverage)
TLcdEarthTextureTerrainTileSet
with the specified geometry and
texture data. The tileset reference is assumed to be geodetic.
The geometry and texture tileset should have the same tile grid structure (that is bounds, level
count, #rows and #columns).aGeometrySet
- the tileset that can be used to generate the geometry data.aGeometryTileSetCoverage
- the coverage in aGeometrySet
that contains
geometry data.aTextureSet
- the tileset that can be used to generate the texture data.aTextureTileSetCoverage
- the coverage in aTextureSet
that contains texture
data.IllegalArgumentException
- if the geometry or texture tileset/coverage are not compatible
or unsupported.public TLcdEarthTexturedTerrainTileSet(ILcdEarthTileSet aGeometrySet, ILcdEarthRasterTileSetCoverage aGeometryTileSetCoverage, ILcdEarthTileSet aTextureSet, ILcdEarthRasterTileSetCoverage aTextureTileSetCoverage, ILcdGeoReference aModelReference)
TLcdEarthTextureTerrainTileSet
with the specified geometry and
texture data.
The geometry and texture tileset should have the same tile grid structure (that is bounds, level
count, #rows and #columns).aGeometrySet
- the tileset that can be used to generate the geometry data.aGeometryTileSetCoverage
- the coverage in aGeometrySet
that contains
geometry data.aTextureSet
- the tileset that can be used to generate the texture data.aTextureTileSetCoverage
- the coverage in aTextureSet
that contains texture
data.aModelReference
- the reference of the tileset.IllegalArgumentException
- if the geometry or texture tileset/coverage are not compatible
or unsupported.public TLcdEarthTexturedTerrainTileSet(ILcdEarthTileSet aGeometrySet, ILcdEarthRasterTileSetCoverage aGeometryTileSetCoverage, ILcdEarthTileSet aElevationSet, ILcdEarthRasterTileSetCoverage aElevationTileSetCoverage, ILcdEarthTileSet aTextureSet, ILcdEarthRasterTileSetCoverage aTextureTileSetCoverage)
TLcdEarthTextureTerrainTileSet
with the specified geometry and
texture data. The tileset reference is assumed to be geodetic.
The geometry and texture tileset should have the same tile grid structure (that is bounds, level
count, #rows and #columns). If either the tileset for geometry or elevation data is
null
the tileset for the other data will be used to generate it on-the-fly.aGeometrySet
- the tileset that can be used to generate the geometry data.aGeometryTileSetCoverage
- the coverage in aGeometrySet
that contains
geometry data.aElevationSet
- the tileset that can be used to generate the elevation data or
null
.aElevationTileSetCoverage
- the coverage in aElevationSet
that contains
elevation data or null
.aTextureSet
- the tileset that can be used to generate the texture data.aTextureTileSetCoverage
- the coverage in aTextureSet
that contains texture
data.IllegalArgumentException
- if the geometry, elevation or texture tileset/coverage are not
compatible/unsupported or if both the geometry and elevation
tilesets are null
public TLcdEarthTexturedTerrainTileSet(ILcdEarthTileSet aGeometrySet, ILcdEarthRasterTileSetCoverage aGeometryTileSetCoverage, ILcdEarthTileSet aElevationSet, ILcdEarthRasterTileSetCoverage aElevationTileSetCoverage, ILcdEarthTileSet aTextureSet, ILcdEarthRasterTileSetCoverage aTextureTileSetCoverage, ILcdGeoReference aModelReference)
TLcdEarthTextureTerrainTileSet
with the specified geometry and
texture data.
The geometry, elevation and texture tileset should have the same tile grid structure (that is
bounds, level count, #rows and #columns). If either the tileset for geometry or elevation data
is null
the tileset for the other data will be used to generate it on-the-fly.aGeometrySet
- the tileset that can be used to generate the geometry data or
null
.aGeometryTileSetCoverage
- the coverage in aGeometrySet
that contains
geometry data or null
.aElevationSet
- the tileset that can be used to generate the elevation data or
null
.aElevationTileSetCoverage
- the coverage in aElevationSet
that contains
elevation data or null
.aTextureSet
- the tileset that can be used to generate the texture data.aTextureTileSetCoverage
- the coverage in aTextureSet
that contains texture
data.aModelReference
- the reference of the tileset.IllegalArgumentException
- if the geometry, elevation or texture tileset/coverage are not
compatible/unsupported or if both the geometry and elevation
tilesets are null
public void setTerrainTextureResolution(int aTextureResolution)
aTextureResolution
- the desired resolution in pixelspublic int getTerrainTextureResolution()
setTerrainTextureResolution(int)
public long getTileLifeTime()
clearCache()
public void setTileLifeTime(long aTime)
aTime
- the time in millisecondsgetTileLifeTime()
public void clearCache()
getTileLifeTime()
public void updateCache()
clearCache()
,
getTileLifeTime()
public boolean isFallbackForTerrainTiles()
textured
geometry coverage
) by falling back to a lower level if the other tile is available (that is no
fall back will occur if both the geometry and texture tile are not available). This fall back
is only supported for geometry tiles if they are elevation-based (that is no geometry tile set was
specified in the constructor).
This is enabled by default.true
if this tile set will try to fall back to a lower level for terrain
tilespublic void setFallbackForTerrainTiles(boolean aFallbackForTerrainTiles)
aFallbackForTerrainTiles
- whether this tile set should try to fall back to a lower level
for terrain tilesisFallbackForTerrainTiles()
public ILcdEarthTileSetCoverage getTexturedGeometryCoverage()
public ILcdEarthRasterTileSetCoverage getElevationCoverage()
public ILcdEarthRasterTileSetCoverage getGeometryCoverage()
public ILcdEarthRasterTileSetCoverage getTextureCoverage()
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
.
produceTile
in interface ILcdEarthTileSet
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 void cancelTile(int aLevel, long aTileX, long aTileY, ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, ILcdEarthTileSetCallback aCallback, Object aContext)
ILcdEarthTileSet
cancelTile()
is called, the tileset is no longer required
to invoke the ILcdEarthTileSetCallback
for the tile in question.
The tileset is not obligated to honor the cancelTile()
request, but if cancelTile()
is not called, then it
is required to invoke the ILcdEarthTileSetCallback
at some
point.cancelTile
in interface ILcdEarthTileSet
aLevel
- the level from which the tile is requestedaTileX
- the column index of the requested tileaTileY
- the row index of the requested tileaCoverage
- the coverage from which the tile is requestedaGeoReference
- the reference system in which the tile is requestedaFormat
- the format in which the tile is requestedaCallback
- would be invoked when the tile would have been available to be usedaContext
- application-specific data to be used by the tileset, if anypublic void dispose()
ILcdEarthTileSet
dispose
in interface ILcdEarthTileSet
dispose
in interface ILcdDisposable
public ILcdBounds getBounds()
ILcdEarthTileSet
getBounds
in interface ILcdEarthTileSet
getBounds
in interface ILcdBounded
ILcdBounded.getBounds()
public int getLevelCount()
ILcdEarthTileSet
getLevelCount
in interface ILcdEarthTileSet
public long getTileRowCount(int aLevel)
ILcdEarthTileSet
getTileRowCount
in interface ILcdEarthTileSet
aLevel
- the level to be queriedpublic long getTileColumnCount(int aLevel)
ILcdEarthTileSet
getTileColumnCount
in interface ILcdEarthTileSet
aLevel
- the level to be queriedpublic int getTileSetCoverageCount()
ILcdEarthTileSet
getTileSetCoverageCount
in interface ILcdEarthTileSet
public ILcdEarthTileSetCoverage getTileSetCoverage(int aIndex)
ILcdEarthTileSet
getTileSetCoverage
in interface ILcdEarthTileSet
aIndex
- the index of the coverage to returnILcdEarthTileSetCoverage
public boolean containsTileSetCoverage(String aCoverageName)
ILcdEarthTileSet
containsTileSetCoverage
in interface ILcdEarthTileSet
aCoverageName
- the name of the coverage to look forpublic ILcdEarthTileSetCoverage getTileSetCoverage(String aCoverageName)
ILcdEarthTileSet
getTileSetCoverage
in interface ILcdEarthTileSet
aCoverageName
- the name of the coverage to look forpublic void updateTile(ALcdEarthTile aTile, TLcdEarthTileOperationMode aMode, ILcdEarthTileSetCallback aCallback, Object aContext)
ILcdEarthTileSet
updateTile
in interface ILcdEarthTileSet
aTile
- tile to checkaMode
- 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 ALcdEarthTile updateTile(ALcdEarthTile aEarthTile, Object aContext) throws IOException
ILcdEarthTileSet
updateTile
in interface ILcdEarthTileSet
aEarthTile
- the tile to checkaContext
- application-specific data to be used by the tileset, if anyIOException
- if the tile cannot be updatedpublic ALcdEarthTile produceTile(ILcdEarthTileSetCoverage aCoverage, int aLevel, long aX, long aY, ILcdGeoReference aGeoReference, TLcdEarthTileFormat aFormat, Object aContext)
ILcdEarthTileSet
produceTile
in interface ILcdEarthTileSet
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 tileaGeoReference
- the georeference of the requested tileaFormat
- the format of the requested tileaContext
- 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
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 boolean isGeoReferenceSupported(ILcdEarthTileSetCoverage aCoverage, ILcdGeoReference aGeoReference)
ILcdEarthTileSet
This method must always return true for the native reference of the
coverage. If it returns true for any other georeference, then the tileset
must be able to handle the georeference in question in its
produceTile()
method.
isGeoReferenceSupported
in interface ILcdEarthTileSet
aCoverage
- the coverage to check foraGeoReference
- the reference to check forpublic boolean isFormatSupported(ILcdEarthTileSetCoverage aCoverage, TLcdEarthTileFormat aFormat)
ILcdEarthTileSet
This method must always return true for the native format of the
coverage. If it returns true for any other format, then the tileset
must be able to handle the format in question in its
produceTile()
method.
isFormatSupported
in interface ILcdEarthTileSet
aCoverage
- the coverage to check foraFormat
- the format to check for