Class TLspLIDARLayerBuilder
You can configure the following aspects using this builder:
model: mandatoryplot stylesscale rangemandatory attributes
This builder is similar to TLspPlotLayerBuilder, but with some other defaults:
- Default styling:
- Color: if the data type associated with the model has a property of type
Color. - Height: otherwise, a color gradient is applied over the height range of the whole model.
- Color: if the data type associated with the model has a property of type
- Optimized painting performance: point size and visibility is automatically adapted based on the camera settings.
default style and adapting it.
See example below.
See newBuilder() for more default values.
Example with default styling:
ILspLayer layer = TLspLIDARLayerBuilder.newBuilder()
.model(myModel)
.build()
Example with custom styling:
TLspPlotStyle defaultStyle = getDefaultStyle(myModel);
ILcdExpression<Color> myColorExpression = ...
TLspPlotStyle myStyle = defaultStyle.asBuilder()
.color(ifThenElse(myColorAvailable, myColorExpression, defaultStyle.getColor()));
.build();
ILspLayer layer = TLspLIDARLayerBuilder.newBuilder()
.model(myModel)
.bodyStyler(REGULAR, myStyle)
.build()
Performance:
Since Lidar data typically consists of many millions of points, it can take up a large amount of video memory. LuciadLightspeed has a limit on the amount of data in its cache. If this limit is too low, it can have a severe impact on performance. To increase this cache, use the following system property, with values in megabytes:
-Dcom.luciad.view.lightspeed.opengl.cacheSize=768
As an alternative, it is possible to limit the amount of points in the model. This can for example be done by
using the TLcdLASModelDecoder#setMaxNumberOfPoints method.
- Since:
- 2014.0
-
Method Summary
Modifier and TypeMethodDescriptionbodyScaleRange(ILcdInterval aScaleRange) Sets a scale range within which the objects are displayed.bodyStyler(TLspPaintState aPaintState, ILspStyler aStyler) Sets the styler used for the points in theBODYpaint representation.bodyStyles(TLspPaintState aPaintState, TLspPlotStyle... aStyles) Sets a (fixed) set of styles to use in this layer for theBODYpaint representation.build()Creates a new layer instance.static TLspPlotStylegetDefaultStyle(ILcdModel aModel) Creates aTLspPlotStyleconfigured for the given model.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) The layer type of lidar layers cannot be set.mandatoryAttributes(ILcdExpression... aMandatoryAttributes) Set a list of attributes that should always be loaded, regardless of what is necessary for styling and filtering.Sets the model of the layer.static TLspLIDARLayerBuilderCreates a new builder.Methods inherited from class com.luciad.view.lightspeed.layer.ALspLayerBuilder
getIcon, getLabel, getLayerStyle, getLayerType, getModel
-
Method Details
-
newBuilder
Creates a new builder.You must set a model on it using
model(com.luciad.model.ILcdModel).Default values:
- attributes: all data properties of the model are added as mandatory attributes
- style(r): the default styling is explained in the
class javadoc - scale range: not set (always visible)
- Returns:
- A builder
-
model
Description copied from class:ALspLayerBuilderSets the model of the layer. The default value isnull.- Overrides:
modelin classALspLayerBuilder- Parameters:
aModel- a model- Returns:
- this builder
- See Also:
-
label
Description copied from class:ALspLayerBuilderSets 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 isnull.- Overrides:
labelin classALspLayerBuilder- Parameters:
aLabel- the label- Returns:
- this builder
- See Also:
-
icon
Description copied from class:ALspLayerBuilderSets the icon of the layer. The default value isnull.- Overrides:
iconin classALspLayerBuilder- Parameters:
aIcon- the icon- Returns:
- this builder
- See Also:
-
layerStyle
Description copied from class:ALspLayerBuilderSet a layer style to be used during the rendering of the layer.TLspLayerStyleis 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:
layerStylein 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:
-
layerType
The layer type of lidar layers cannot be set. It is alwaysILspLayer.LayerType.INTERACTIVE.This method throws
UnsupportedOperationException.- Overrides:
layerTypein classALspLayerBuilder- Parameters:
aLayerType- not used- Returns:
- this builder
- See Also:
-
mandatoryAttributes
Set a list of attributes that should always be loaded, regardless of what is necessary for styling and filtering.
This call is optional. The layer will automatically determine the necessary attributes based on the expressions inside
TLspPlotStyle.However, if at runtime a new style is set with other attributes, the layer will have to process the new attributes. To avoid this processing, you can set the super-set of all attributes you may need up front.
For
LASlayers,height,color,classification,intensityandinfra-redare added by default for convenience.For E57 layers,
height,color, andintensityare added by default for convenience when they are present in the data.- Parameters:
aMandatoryAttributes- The set of mandatory attributes- Returns:
- this
-
bodyStyles
Sets a (fixed) set of styles to use in this layer for theBODYpaint representation.This method delegates to
bodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler). CallbodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)with a custom styler if you need to change styles at runtime after creation.If not set, the default styling is used (see
class javadocfor details).- Parameters:
aPaintState- Paint state for this styleraStyles- The styles to use- Returns:
- this
- See Also:
-
bodyStyler
Sets the styler used for the points in theBODYpaint representation.Special considerations:
- It must submit
TLspPlotStyle. - It must submit the whole, original collection of domain objects. You cannot split styles per object. Instead, you can use expressions to style objects based on rules.
- It is strongly advised (although not mandatory) to re-use the same style instance if it is unchanged.
- You can use a
style target providerto extract the actual point geometry out of the domain object. It must returnILcdPointobjects.
public void style(Collection<?> aObjects, ALspStyleCollector aStyleCollector, TLspContext aContext) { aStyleCollector.objects(aObjects).geometry(fPointExtractor).style(fStyle).submit(); }If not set, the default styling is used (see
class javadocfor details).- Parameters:
aPaintState- Paint state for this styleraStyler- The styler to use- Returns:
- this
- See Also:
- It must submit
-
bodyScaleRange
Sets a scale range within which the objects are displayed. The layer will not paint anything if the view's current scale is outside the given range.If not set, no scale range is used and the layer will always paint itself.
- Parameters:
aScaleRange- The scale range- Returns:
- this
-
build
Description copied from class:ALspLayerBuilderCreates a new layer instance.
- Specified by:
buildin classALspLayerBuilder- Returns:
- the new layer instance
-
getDefaultStyle
Creates aTLspPlotStyleconfigured for the given model.- If a data property with type
Coloris available it uses that. - Otherwise, a color gradient over the height range in the model is used.
- Optimized painting performance: point size and visibility is automatically adapted based on the model extent and camera settings.
Example:
TLspPlotStyle defaultStyle = getDefaultStyle(myModel); ILcdExpression<Color> myColorExpression = ... TLspPlotStyle myStyle = defaultStyle.asBuilder() .color(ifThenElse(myColorAvailable, myColorExpression, defaultStyle.getColor())); .build();- Parameters:
aModel- The model to create a style for.- Returns:
- A plot style.
- If a data property with type
-