Class TLspNetCDFLayerBuilder
Layer builder for NetCDF models. It tries to provide sensible coloring defaults.
An example of how to use this builder:
ILspLayer layer = TLspNetCDFLayerBuilder.newBuilder()
.model(myNetCDFModel)
.build();
Note that this layer builder cannot handle model tree nodes. In order to visualize a model tree node with multiple NetCDF leaf models, one can create a layer tree node for the model tree node, and use this layer builder for the leaf NetCDF models.
NetCDF images can also be visualized as an icon grid. This happens automatically when the ALcdImage
to be painted contains 2 bands. Icon grid visualization can also be enable/customized by setting a
TLspParameterizedRasterIconStyle
as the styler
. In other cases, the image is visualized
as a raster.
- Since:
- 2015.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a new layer instance.static TLcdColorMap
createDefaultColorMap
(Object aNetCDFObject) Creates a default color map for the given NetCDF object orALcdImage
.filter
(ILcdDynamicFilter aFilter) Sets a filter that will be used to filter objects to prevent them from being painted by the layer.Sets the icon of the layer.Sets the label of the layer.layerStyle
(TLspLayerStyle aLayerStyle) Set a layer style to be used during the rendering of the layer.layerType
(ILspLayer.LayerType aLayerType) This method is not supported for NetCDF layers.Sets the model of the layer.static TLspNetCDFLayerBuilder
Returns a new layer builder with the default settingsstyler
(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler) Sets the styler used to visualize the image.Methods inherited from class com.luciad.view.lightspeed.layer.ALspLayerBuilder
getIcon, getLabel, getLayerStyle, getLayerType, getModel
-
Method Details
-
newBuilder
Returns a new layer builder with the default settings- Returns:
- a new layer builder with the default settings.
-
createDefaultColorMap
Creates a default color map for the given NetCDF object orALcdImage
. It takes into account the type of data and the min and max values of the data, if available. This layer builder uses the color map retrieved from this method as default color map.- Parameters:
aNetCDFObject
- the NetCDF object orALcdImage
for which to create a color map.- Returns:
- a default color map for the given image.
- Throws:
IllegalArgumentException
- if the given NetCDF object is not created by the NetCDF model decoder.
-
build
Creates a new layer instance.
When
styler
is not called, the created layer exposes anILspCustomizableStyler
with the default styles.- Specified by:
build
in classALspLayerBuilder
- Returns:
- the new layer instance
-
styler
public TLspNetCDFLayerBuilder styler(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler) Sets the styler used to visualize the image. Only theTLspPaintRepresentation#BODY
affects the style of the raster. Refer to the TLspRasterLayerBuilder class javadoc for an overview of the supported styles. 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. It also configures a default color map.- Parameters:
aPaintRepresentationState
- the paint representation.aStyler
- the styler- Returns:
- this builder
-
filter
Sets a filter that will be used to filter objects to prevent them from being painted by the layer. No filter is set by default.
The objects passed to the layer filter are domain objects of a
TLcdNetCDFFilteredModel
. SeeTLcdNetCDFFilteredModel
javadoc for more information about these domain objects. Note that NetCDF models typically contain exactly one domain object.- Parameters:
aFilter
- the filter- Returns:
- this builder
-
model
Sets the model of the layer.- Overrides:
model
in classALspLayerBuilder
- Parameters:
aModel
- a model- Returns:
- this builder
- Throws:
IllegalArgumentException
- if the given model is not a NetCDF model- See Also:
-
label
Sets the label of the layer. This is a short textual representation for it, often used to represent the layer to end-users.
The default value is
null
. In that case, the display name of the model descriptor is used as label.- Overrides:
label
in classALspLayerBuilder
- Parameters:
aLabel
- the label- Returns:
- this builder
- See Also:
-
layerType
This method is not supported for NetCDF layers. The default of
LayerType#EDITABLE
is used.- Overrides:
layerType
in classALspLayerBuilder
- Parameters:
aLayerType
- the layer type- Returns:
- this builder
- Throws:
UnsupportedOperationException
- this method is not supported for NetCDF layers- See Also:
-
layerStyle
Description copied from class:ALspLayerBuilder
Set a layer style to be used during the rendering of the layer.TLspLayerStyle
is used to style the layer as a whole. Layer style can for example modify the transparency of a layer. Also, layer style can be modified after building the layer by callingILspLayer.setLayerStyle(TLspLayerStyle)
.- Overrides:
layerStyle
in classALspLayerBuilder
- Parameters:
aLayerStyle
- the layer style. Must not benull
. If you want to set the default layer style, setTLspLayerStyle.newBuilder().build()
- Returns:
- this
- See Also:
-
icon
Description copied from class:ALspLayerBuilder
Sets the icon of the layer. The default value isnull
.- Overrides:
icon
in classALspLayerBuilder
- Parameters:
aIcon
- the icon- Returns:
- this builder
- See Also:
-