public class TLcdEarthGXYElevationRasterPainter extends TLcdEarthGXYSinglevaluedRasterPainter
ILcdGXYPainter
can paint the elevation data of ILcdEarthTileSet
instances in a 2D view.
This painter has been replaced by TLcdGXYImagePainter
. Please consider using it
instead of this one.
ILcdEarthTileSet
that can produce tiles with a TLcdEarthElevationData
as
the tile data. The first such coverage in the tileset will be used (see TLcdEarthGXYRasterPainter.chooseTileSetCoverage(com.luciad.earth.tileset.ILcdEarthTileSet)
).
converted to a short
which is then mapped to a color using the color model
. By default a standard color model is already set.
By default the tile level is chosen such that 4 pixels in the view map to at least one value, if
possible. This avoids most pixelation effects (e.g. that individual pixels are visible). To achieve
this a tile level is chosen with a higher pixel density
than the
view. This behavior can be changed by either setting the quality
or by overriding the TLcdEarthGXYRasterPainter.chooseTileSetLevel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, com.luciad.shape.ILcdBounds)
method.
If some tiles are not available, the tiles at lower levels will be used automatically to avoid
gaps.
If required this painter will warp the elevation data between different coordinate systems,
otherwise it will just paint their linearly scaled images.
The bounds of the tile set will be painted instead of the tiles if the pixel density of the least
detailed level is too high
. There is no limit on the pixel
density by default so the bounds of a tile set will never be painted unless the start resolution
factor is set to a lower value. Typically this is fine for tile sets that cover the entire world
but it may be necessary to lower the start resolution factor if there are multiple smaller tile
sets in a view.
ALcdEarthGXYPainter.isAsynchronousTileRequestAllowed()
and ALcdEarthGXYPainter.isRepaintViewWhenTileAvailable()
should be
set to true
(default).
TLcdEarthGXYRasterPainter.setCacheSize(int)
). Other tiles will also be cached if there is enough
memory (see TLcdEarthGXYRasterPainter.isSoftCachingEnabled()
). Tiles that reside in either of these caches will
be updated automatically every minute (see TLcdEarthGXYRasterPainter.getUpdateInterval()
). You can use the
TLcdEarthGXYRasterPainter.updateTiles(com.luciad.view.gxy.ILcdGXYView)
method to update all tiles that are
currently cached immediately.
TLcdGXYAsynchronousPaintQueue.setInterruptPainting(boolean)
)TLcdEarthGXYRasterPainter
,
Serialized FormdefaultCreationFillStyle, defaultCreationLineStyle, defaultFillStyle, defaultLineStyle, fWorkBounds
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
Constructor and Description |
---|
TLcdEarthGXYElevationRasterPainter()
Creates a new earth 2D elevation raster painter with the default cache size.
|
TLcdEarthGXYElevationRasterPainter(int aCacheSize)
Creates a new earth 2D elevation raster painter with the given cache size.
|
Modifier and Type | Method and Description |
---|---|
protected TLcdEarthTileFormat |
chooseTileFormat(ILcdEarthTileSet aTileSet,
ILcdEarthTileSetCoverage aCoverage)
Chooses a tile format from the given tileset and coverage to be used for producing tiles.
|
protected short |
convertToShort(double aElevation)
Converts a native elevation value to a short.
|
protected ILcdTile |
createRasterTile(ALcdEarthTile aTile)
Creates an
ILcdTile corresponding to the specified ALcdEarthTile . |
protected boolean |
isValidCoverage(ILcdEarthTileSetCoverage aCoverage)
Returns whether the given coverage can be drawn by this painter.
|
getDefaultValue, getEmptyTile, getValueRange, getValueToShortOffset, getValueToShortScale, setDefaultValue, setQuality, setValueRange, setValueToShortOffset, setValueToShortScale
addStatusListener, chooseTileSetCoverage, chooseTileSetLevel, clearCache, clearCache, clone, configureBaseTileSet, createAsynchronousTileSet, getBoundsFillStyle, getBoundsLineStyle, getBrightness, getCacheSize, getColorModel, getContrast, getDisplayName, getOversamplingRate, getPaintCache, getPixelDensity, getQuality, getRequestFormat, getRGBImageFilter, getStartResolutionFactor, getTileContext, getTileSet, getTransparency, getUpdateInterval, getWarpBlockSize, isAllowOutdatedTiles, isAutoIncreaseCacheSize, isPaintBoundsFill, isPaintBoundsOutline, isParentTileRequestAllowed, isSoftCachingEnabled, paint, releaseHardReferencedCache, releaseHardReferencedCache, removeStatusListener, setAllowOutdatedTiles, setAsynchronousTileRequestAllowed, setAutoIncreaseCacheSize, setBoundsFillStyle, setBoundsLineStyle, setBrightness, setCacheSize, setColorModel, setContrast, setExceptionHandler, setObject, setOversamplingRate, setPaintBoundsFill, setPaintBoundsOutline, setPaintCache, setParentTileRequestAllowed, setRepaintViewWhenTileAvailable, setRGBImageFilter, setSoftCachingEnabled, setStartResolutionFactor, setTransparency, setUpdateInterval, setWarpBlockSize, updateTiles, updateTiles
boundsSFCT, getExceptionHandler, getObject, getTileSet, getTileSetCoverage, isAsynchronousTileRequestAllowed, isRepaintViewWhenTileAvailable, isTouched
addPropertyChangeListener, anchorPointSFCT, firePropertyChangeEvent, firePropertyChangeEvent, getCursor, getGXYPainter, isTraceOn, removePropertyChangeListener, setClassTraceOn, setDisplayName, setTraceOn, snapTarget, supportSnap
public TLcdEarthGXYElevationRasterPainter(int aCacheSize)
aCacheSize
- The maximum number of entries in the cache.TLcdEarthGXYRasterPainter.getCacheSize()
public TLcdEarthGXYElevationRasterPainter()
protected boolean isValidCoverage(ILcdEarthTileSetCoverage aCoverage)
createRasterTile(com.luciad.earth.tileset.ALcdEarthTile)
.
The default implementation returns true
if the coverage is a raster coverage
and the tiles set supports a format with TLcdEarthElevationData
as format class and no format name with the specified coverage.isValidCoverage
in class TLcdEarthGXYSinglevaluedRasterPainter
aCoverage
- the candidate coveragetrue
if the given coverage can be paintedILcdEarthTileSet.isFormatSupported(com.luciad.earth.tileset.ILcdEarthTileSetCoverage,
com.luciad.earth.tileset.TLcdEarthTileFormat)
protected TLcdEarthTileFormat chooseTileFormat(ILcdEarthTileSet aTileSet, ILcdEarthTileSetCoverage aCoverage)
createRasterTile(com.luciad.earth.tileset.ALcdEarthTile)
.
The default implementation returns a format with TLcdEarthElevationData
as format class and no format name.chooseTileFormat
in class TLcdEarthGXYSinglevaluedRasterPainter
aTileSet
- the tileset whose tiles are being paintedaCoverage
- the coverage whose tiles are being painted.protected ILcdTile createRasterTile(ALcdEarthTile aTile)
ILcdTile
corresponding to the specified ALcdEarthTile
. The resulting raster tile is used in order to draw the
output of a tileset using TLcdRasterPainter
.
The default implementation can only create a tile for tiles with a TLcdEarthElevationData
as tile data. Each elevation in this
data is converted to a shorted using convertToShort(double)
.createRasterTile
in class TLcdEarthGXYSinglevaluedRasterPainter
aTile
- the tile to convert into a raster tileprotected short convertToShort(double aElevation)
convertToShort
in class TLcdEarthGXYSinglevaluedRasterPainter
aElevation
- An elevation valueTLcdEarthGXYSinglevaluedRasterPainter.getValueToShortOffset()
,
TLcdEarthGXYSinglevaluedRasterPainter.getValueToShortScale()