public class TLspRasterLayer extends ALspLayer implements ILspEditableStyledLayer
ILspView
.
The following object types and models are supported:
ALcdImage
or has-an-image
objects and an ILcdImageModelDescriptor
ILcdRaster
objects and a TLcdRasterModelDescriptor
ILcdMultilevelRaster
objects and a TLcdMultilevelRasterModelDescriptor
ILcdEarthTileSet
objects, provided they have a coverage
of type
IMAGE
,
ELEVATION
, or
MULTIVALUED
and an ILcdEarthModelDescriptor
geometry
of one of the
supported types.
By default, color data is visualized using the image's own color model.
Elevation data is visualized with a DTED color mapping.
The level switch factor applies to multi-leveled data.
By default, multi-level images uses a level switch factor of 0.3.
For multi-level image mosaics, the default depends on the mosaic tile size.
A mosaic tile size of 256x256 or larger results in a level switch factor of 0.3.
For smaller mosaic tile sizes, the level switch factor is reduced correspondingly.
By reducing the level switch, we aim for an equal amount of tiles needed to fill a view.
To compensate for pixelation effects due to a reduced level switch factor, linear interpolation is enabled by
default.
The visualization of the raster data can be configured by setting a styler
.
The styler can submit the following styles:
TLspRasterStyle
instance: mandatory, this controls the visualization of the raster valuesTLspImageProcessingStyle
instance: an image processing operator chain applied to the rasterTLspLineStyle
instance: this controls the style of the outline of the bounds of
the rasterTLspFillStyle
instance: this controls the style of the fill of the bounds of
the rasterTLspRasterStyle.getStartResolutionFactor()
).
Otherwise the bounds of the raster are painted instead.
One dimensional parameterized
data from Earth tilesets
is visualized depending on the parameter and unit:
The visualization of the this data can be configured by setting a TLspParameterizedRasterIconStyle
as the styler
.
The behavior of the raster layer may also be influenced by the layer type
that is set:
ILspLayer.LayerType.INTERACTIVE
: indicates that
the layer should support smooth interaction, such as changes of the visibility, styling or model elementsILspLayer.LayerType.BACKGROUND
: indicates that the
raster is used as background data in the view and will rarely changeILcdEarthTileSet
's or equivalent
ALcdMultilevelImageMosaic
'sstatus
to know
when it is processing changes.
ILspLayer.LayerType
Constructor and Description |
---|
TLspRasterLayer(ILcdModel aModel)
Constructs a new raster layer for the given model.
|
TLspRasterLayer(ILcdModel aModel,
ILspLayer.LayerType aLayerType)
Constructs a new raster layer with the given model and layer type.
|
TLspRasterLayer(ILcdModel aModel,
String aLabel)
Constructs a new raster layer with the given model and label.
|
TLspRasterLayer(ILcdModel aModel,
String aLabel,
ILspLayer.LayerType aLayerType)
Constructs a new raster layer with the given model, label and layer type.
|
Modifier and Type | Method and Description |
---|---|
void |
configureForSLDStyling(TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle)
Style this layer using the specified SLD style.
|
void |
fireStatusEvent(TLcdStatusEvent<ILspLayer> aStatusEvent)
Fires a status event.
|
double |
getBorderFactor()
Returns the size of the surplus border that is processed, relative to the view.
|
long |
getCacheSize()
Returns the size of the private cache.
|
ILspLayer.LayerType |
getLayerType()
Returns the layer type.
|
Collection<TLspPaintRepresentation> |
getPaintRepresentations()
The raster layer only supports the
TLspPaintRepresentation.BODY paint representation. |
ILspStyler |
getStyler(TLspPaintRepresentationState aPaintRepresentationState)
Returns the styler that is used for the given paint representation state.
|
boolean |
isEditableSupported()
Returns
true if the layer supports editing its objects. |
boolean |
isIncrementalPainting()
Returns whether this layer is repainted as soon as a tile becomes available.
|
boolean |
isLoadTexturesInBorder()
Returns whether the surplus processing indicated by the
border factor includes texture
data loading. |
boolean |
isSelectableSupported()
Returns
true if this layer supports selecting objects, false otherwise. |
boolean |
isUseSharedCache() |
<T> T |
query(ALspPaintQuery<T> aQuery,
TLspContext aContext)
Retrieves a set of domain objects and data based on the parameters given by the query.
|
void |
registerView(ILspView aView)
Registers a view with this layer.
|
void |
setBorderFactor(double aBorderFactor)
Returns the size of the surplus border that is processed, relative to the view.
|
void |
setCacheSize(long aCacheSize)
Sets the size of the private cache.
|
void |
setIncrementalPainting(boolean aIncrementalPainting)
Sets whether this layer is repainted as soon as a tile becomes available.
|
void |
setLayerType(ILspLayer.LayerType aLayerType)
Sets the layer type for this layer.
|
void |
setLoadTexturesInBorder(boolean aLoadTexturesInBorder)
Sets whether the surplus processing indicated by the
border factor should also
include texture data loading. |
void |
setStyler(TLspPaintRepresentationState aPaintRepresentationState,
ILspStyler aStyler)
Sets the styler used to style the rasters contained by this layer.
|
void |
setUseSharedCache(boolean aUseSharedCache)
Sets whether the shared cache is used to cache raster data.
|
String |
toString() |
addLayerStateListener, addPaintRepresentation, addPropertyChangeListener, addSelectionListener, addStatusListener, clearSelection, createModelXYZWorldTransformation, fireCollectedSelectionChanges, fireLayerStateChange, fireLayerStateChange, fireLayerStateChange, fireLayerStateChange, firePropertyChange, getBounds, getCurrentViews, getFilter, getIcon, getLabel, getLayerStyle, getMapScaleRange, getModel, getModelXYZWorldTransformation, getSelectionCount, invalidate, isEditable, isEditable, isSelectable, isSelected, isSynchronous, isVisible, isVisible, isVisible, removeLayerStateListener, removePaintRepresentation, removePropertyChangeListener, removeSelectionListener, removeStatusListener, selectedObjects, selectObject, selectObjects, setEditable, setEditable, setFilter, setIcon, setLabel, setLayerStyle, setMapScaleRange, setModel, setSelectable, setSynchronous, setVisible, setVisible, setVisible, unregisterView
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addLayerStateListener, addStatusListener, getBounds, getCurrentViews, getLayerStyle, getMapScaleProvider, getModelXYZWorldTransformation, invalidate, isEditable, isVisible, isVisible, removeLayerStateListener, removeStatusListener, setEditable, setEditable, setLayerStyle, setVisible, setVisible, setVisible, unregisterView
clearSelection, fireCollectedSelectionChanges, getIcon, getLabel, getModel, isEditable, isSelectable, isVisible, selectObject, setIcon, setLabel, setSelectable
addSelectionListener, getSelectedObjects, getSelectionCount, isSelected, removeSelectionListener, selectedObjects
addPropertyChangeListener, removePropertyChangeListener
public TLspRasterLayer(ILcdModel aModel)
aModel
- the model to be assigned to this raster layerpublic TLspRasterLayer(ILcdModel aModel, String aLabel)
aModel
- the model to be assigned to this raster layeraLabel
- the label to be assigned to this raster layerpublic TLspRasterLayer(ILcdModel aModel, ILspLayer.LayerType aLayerType)
supported
.aModel
- the model to be assigned to this raster layeraLayerType
- the layer type to be assigned to this raster layerpublic TLspRasterLayer(ILcdModel aModel, String aLabel, ILspLayer.LayerType aLayerType)
supported
.aModel
- the model to be assigned to this raster layeraLabel
- the label to be assigned to this raster layeraLayerType
- the layer typepublic Collection<TLspPaintRepresentation> getPaintRepresentations()
TLspPaintRepresentation.BODY
paint representation.getPaintRepresentations
in interface ILspLayer
getPaintRepresentations
in class ALspLayer
PaintRepresentation
s, never null
public boolean isEditableSupported()
true
if the layer supports editing its objects.isEditableSupported
in interface ILcdLayer
isEditableSupported
in class ALspLayer
false
ILcdLayer.setEditable(boolean)
public boolean isSelectableSupported()
true
if this layer supports selecting objects, false
otherwise.isSelectableSupported
in interface ILcdLayer
isSelectableSupported
in class ALspLayer
false
ILcdLayer.setSelectable(boolean)
,
ILcdLayer.selectObject(java.lang.Object, boolean, int)
public void setLayerType(ILspLayer.LayerType aLayerType)
ILspLayer.LayerType.INTERACTIVE
: the layer indicates that the layer should support smooth
interaction, such as changes of the visibility or style of the raster dataILspLayer.LayerType.BACKGROUND
: indicates that the raster is used as background data in the
view and will rarely changeILspLayer.LayerType.INTERACTIVE
otherwise.aLayerType
- the layer typepublic ILspLayer.LayerType getLayerType()
getLayerType
in interface ILspLayer
getLayerType
in class ALspLayer
setLayerType(ILspLayer.LayerType)
public boolean isUseSharedCache()
true
if the shared cache is used to cache raster data()
public void setUseSharedCache(boolean aUseSharedCache)
aUseSharedCache
- true
if the shared cache is usedisUseSharedCache()
public long getCacheSize()
()
public void setCacheSize(long aCacheSize)
aCacheSize
- the size of the private cache (in bytes)setUseSharedCache(boolean)
public double getBorderFactor()
setBorderFactor(double)
public void setBorderFactor(double aBorderFactor)
0.25
which results in 25% extra data on all sides, so the total processed area is 2.25x
the area when using no surplus border.
Note that, by default, texture loading is not included in the surplus processing. Including it increases the
memory and cpu usage even more, but will often give faster updates for small pan and zoom operations.
To include it, see setLoadTexturesInBorder(boolean)
.aBorderFactor
- the relative amount by which the view is enlarged on each sidepublic boolean isLoadTexturesInBorder()
border factor
includes texture
data loading.setBorderFactor(double)
,
setLoadTexturesInBorder(boolean)
public void setLoadTexturesInBorder(boolean aLoadTexturesInBorder)
border factor
should also
include texture data loading.
By default, texture loading is not included in the surplus processing. Including it increases the memory and cpu
usage even more than a border factor that does not include texture loading, but will often give faster updates for
small pan and zoom operations.aLoadTexturesInBorder
- whether texture data loading should be included in the surplus border processing.setBorderFactor(double)
public boolean isIncrementalPainting()
setIncrementalPainting(boolean)
public void setIncrementalPainting(boolean aIncrementalPainting)
aIncrementalPainting
- boolean indicating whether this layer is repainted as soon as a tile becomes available.public ILspStyler getStyler(TLspPaintRepresentationState aPaintRepresentationState)
ILspStyledLayer
getStyler
in interface ILspStyledLayer
aPaintRepresentationState
- the paint representation state for which the
styler should be retrievedpublic void setStyler(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler)
TLspPaintRepresentation.BODY
affects the style of the raster.
The styler should submit:
TLspRasterStyle
instance:
mandatory, this controls the style of the raster valuesTLspImageProcessingStyle
instance: a image processing
operator chain applied to the rasterTLspLineStyle
instance: this
controls the style of the outline of the bounds of the rasterTLspFillStyle
instance: this
controls the style of the fill of the bounds of the rasterTLspRasterStyle.getStartResolutionFactor()
). Otherwise the bounds of the raster are painted instead.
The default styler drapes the raster data on top of the view's terrain and paints a red hatched rectangle when zoom
out too far. For a raster with color data you can reproduce its behavior with the following styler:
new TLspStyler( TLspLineStyle.newBuilder().color(Color.RED).build(), TLspFillStyle.newBuilder().color(Color.RED).stipplePattern(TLspFillStyle.StipplePattern.HATCHED).build(), TLspRasterStyle.newBuilder().build() );Note that some additional configuration is needed for non-color data (ex. elevation data). See
TLspRasterStyle.Builder
for details.setStyler
in interface ILspEditableStyledLayer
aPaintRepresentationState
- the paint representation stateaStyler
- the stylerpublic <T> T query(ALspPaintQuery<T> aQuery, TLspContext aContext)
TLspPaintedObjectsTouchQuery
: the result
can be a TLspRasterWorldTouchInfo
combined
with the view's terrain are not included in
this query. You can use ILspTerrainSupport
instead to query these.T
- the type of the return value of ALspPaintQuery.getResult()
aQuery
- the queryaContext
- the contextALspPaintQuery.getResult()
after processing is finishedUnsupportedOperationException
- if an aspect of the query is not supported by this layerpublic void fireStatusEvent(TLcdStatusEvent<ILspLayer> aStatusEvent)
ALspLayer
fireStatusEvent
in class ALspLayer
aStatusEvent
- the status eventpublic void registerView(ILspView aView)
ILspLayer
ILspLayer.unregisterView(com.luciad.view.lightspeed.ILspView)
.
This allows the layer to know at all times in which views it is currently
present; this information may help it to manage any data that it caches.registerView
in interface ILspLayer
registerView
in class ALspLayer
aView
- the view to which this layer has been addedpublic final void configureForSLDStyling(TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle)
Style this layer using the specified SLD style. This method is a utility method, which is the equivalent of:
TLspSLDStyler
for the specified SLD style as body styler.Note that in future versions of the product it is possible that this method will overwrite more settings.
aSLDFeatureTypeStyle
- The SLD styleTLspShapeLayerBuilder.sldStyle(TLcdSLDFeatureTypeStyle)