public class TLcdViewshedMultilevelRaster extends Object implements ILcdMultilevelRaster
ILcdViewshed
.
It typically represents visibility for an area at a fixed height above a
terrain.
![]() |
The above figure illustrates how the raster samples the given viewshed
within given bounds, at a given height above a terrain.
The terrain is represented by an optional height provider (see
setHeightProvider(ILcdHeightProvider)
. The height is a simple
constant that is added (see setTargetHeight(double)
):
The raster samples the viewshed at a given number of levels of detail. Each level of detail has a tile at an increasing resolution. The maximum tile size can be specified in pixels or by means of a step size expressed in raster coordinates (viewshed coordinates). The contents of the tiles are computed on the fly and cached in a given buffer.
Since this class implements ILcdMultilevelRaster
,
it can be painted with a traditional multilevel raster painter like
TLcdMultilevelRasterPainter
.
Constructor and Description |
---|
TLcdViewshedMultilevelRaster(ILcdBounds aBounds,
ILcdViewshed aViewshed,
ILcdModelModelTransformation aRasterToViewshedTransformation,
IndexColorModel aColorModel,
ILcdBuffer aBuffer)
Creates a viewshed raster with default levels of detail.
|
TLcdViewshedMultilevelRaster(ILcdBounds aBounds,
ILcdViewshed aViewshed,
ILcdModelModelTransformation aRasterToViewshedTransformation,
IndexColorModel aColorModel,
ILcdBuffer aBuffer,
int aLevelCount,
int aLevelScaleFactor,
double aStepSize)
Creates a viewshed raster sampled at the given sampling rate.
|
TLcdViewshedMultilevelRaster(ILcdBounds aBounds,
ILcdViewshed aViewshed,
ILcdModelModelTransformation aRasterToViewshedTransformation,
IndexColorModel aColorModel,
ILcdBuffer aBuffer,
int aLevelCount,
int aLevelScaleFactor,
int aTileWidth,
int aTileHeight,
int aSubtileWidth,
int aSubtileHeight)
Creates a viewshed raster with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears the cache.
|
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
ILcdHeightProvider |
getHeightProvider()
Returns the height provider used by this viewshed raster.
|
ILcdModelModelTransformation |
getModelToCartesianTransformation()
Gets the transformation from the model in which this raster resides to the
cartesian reference of the containing viewshed
|
ILcdRaster |
getRaster(int aLevel) |
int |
getRasterCount() |
double |
getTargetHeight()
Returns the height above the terrain at which visibility is sampled.
|
void |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
void |
setHeightProvider(ILcdHeightProvider aHeightProvider)
Sets the height provider for this viewshed raster.
|
void |
setTargetHeight(double aTargetHeight)
Sets the height above the terrain at which visibility should be sampled.
|
public TLcdViewshedMultilevelRaster(ILcdBounds aBounds, ILcdViewshed aViewshed, ILcdModelModelTransformation aRasterToViewshedTransformation, IndexColorModel aColorModel, ILcdBuffer aBuffer)
aBounds
- The bounds of this raster, expressed in its own raster reference.aViewshed
- The viewshed to visualize as a raster.aRasterToViewshedTransformation
- The transformation raster reference to
the reference of the contained viewshed.aColorModel
- The color model of this raster. The size of the specified color map should
not exceed 256. Visibility values are converted to values between 0 and
aColorModel.getMapSize()-1
, from completely invisible to fully
visible. The color map can be null. If it is null, it is up to the painter
to correctly visualize the raster.aBuffer
- The buffer in which viewshed rasters can be cached, for example:
TLcdSharedBuffer.getBufferInstance()
.IllegalArgumentException
- when aColorModel.getMapSize()
is larger than 256.public TLcdViewshedMultilevelRaster(ILcdBounds aBounds, ILcdViewshed aViewshed, ILcdModelModelTransformation aRasterToViewshedTransformation, IndexColorModel aColorModel, ILcdBuffer aBuffer, int aLevelCount, int aLevelScaleFactor, double aStepSize)
aBounds
- The bounds of this raster, expressed in its own raster reference.aViewshed
- The viewshed to visualize as a raster.aRasterToViewshedTransformation
- The transformation raster reference to
the reference of the contained viewshed.aColorModel
- The color model of this raster. The size of the specified color map should
not exceed 256. Visibility values are converted to values between 0 and
aColorModel.getMapSize()-1
, from completely invisible to fully
visible. The color map can be null. If it is null, it is up to the painter
to correctly visualize the raster.aBuffer
- The buffer in which viewshed rasters can be cached, for example:
TLcdSharedBuffer.getBufferInstance()
.aStepSize
- The sample distance of the most detailed raster level,
expressed in raster coordinates (viewshed coordinate).IllegalArgumentException
- when aColorModel.getMapSize()
is larger than 256.public TLcdViewshedMultilevelRaster(ILcdBounds aBounds, ILcdViewshed aViewshed, ILcdModelModelTransformation aRasterToViewshedTransformation, IndexColorModel aColorModel, ILcdBuffer aBuffer, int aLevelCount, int aLevelScaleFactor, int aTileWidth, int aTileHeight, int aSubtileWidth, int aSubtileHeight)
aBounds
- The bounds of this raster, expressed in its own raster reference.aViewshed
- The viewshed to visualize as a raster.aRasterToViewshedTransformation
- The transformation raster reference to
the reference of the contained viewshed.aColorModel
- The color model of this raster. The size of the specified color map should
not exceed 256. Visibility values are converted to values between 0 and
aColorModel.getMapSize()-1
, from completely invisible to fully
visible. The color map can be null. If it is null, it is up to the painter
to correctly visualize the raster.aBuffer
- The buffer in which viewshed rasters can be cached, for example:
TLcdSharedBuffer.getBufferInstance()
.aLevelCount
- The number of levels to be created.aLevelScaleFactor
- The scale factor on both axes between subsequent levels.aTileWidth
- The tile width of the most detailed tile, expressed in pixels.aTileHeight
- The tile height of the most detailed tile, expressed in pixels.aSubtileWidth
- The subtile width of the tiles, expressed in pixels.aSubtileHeight
- The subtile height of the tiles, expressed in pixels.IllegalArgumentException
- when aColorModel.getMapSize()
is larger than 256.public ILcdModelModelTransformation getModelToCartesianTransformation()
ILcdModelModelTransformation
.public void setHeightProvider(ILcdHeightProvider aHeightProvider)
aHeightProvider
- a height provider, or null if no height provider is
needed.setTargetHeight(double)
public ILcdHeightProvider getHeightProvider()
setHeightProvider(com.luciad.util.height.ILcdHeightProvider)
public void setTargetHeight(double aTargetHeight)
public double getTargetHeight()
public int getRasterCount()
getRasterCount
in interface ILcdMultilevelRaster
ILcdRaster
objects in this ILcdMultilevelRaster
.public ILcdRaster getRaster(int aLevel)
getRaster
in interface ILcdMultilevelRaster
ILcdRaster
at level aLevel.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.
If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points)
the return value is unspecified.
It is highly recommended to return an undefined
bounds.
You can create undefined bounds using the default constructors
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public void insertIntoCache(Object aKey, Object aObject)
ILcdCache
insertIntoCache
in interface ILcdCache
aKey
- the key Object that will be used to identify the Object.
The key must therefore be a unique identifier, typically the caller
itself: insertIntoCache(this, ...)
.aObject
- the Object to be cached.public Object getCachedObject(Object aKey)
ILcdCache
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
ILcdCache
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
ILcdCache
clearCache
in interface ILcdCache