public class TLspLIDARLayerBuilder extends ALspLayerBuilder
You can configure the following aspects using this builder:
model
: mandatoryplot styles
scale range
mandatory attributes
This builder is similar to TLspPlotLayerBuilder
, but with some other defaults:
Color
.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=768As 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.
Modifier and Type | Method and Description |
---|---|
TLspLIDARLayerBuilder |
bodyScaleRange(ILcdInterval aScaleRange)
Sets a scale range within which the objects are displayed.
|
TLspLIDARLayerBuilder |
bodyStyler(TLspPaintState aPaintState,
ILspStyler aStyler)
Sets the styler used for the points in the
BODY paint representation. |
TLspLIDARLayerBuilder |
bodyStyles(TLspPaintState aPaintState,
TLspPlotStyle... aStyles)
Sets a (fixed) set of styles to use in this layer for the
BODY paint representation. |
ILspLayer |
build()
Creates a new layer instance.
|
static TLspPlotStyle |
getDefaultStyle(ILcdModel aModel)
Creates a
TLspPlotStyle configured for the given model. |
TLspLIDARLayerBuilder |
icon(ILcdIcon aIcon)
Sets the icon of the layer.
|
TLspLIDARLayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspLIDARLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspLIDARLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
The layer type of lidar layers cannot be set.
|
TLspLIDARLayerBuilder |
mandatoryAttributes(ILcdExpression... aMandatoryAttributes)
Set a list of attributes that should always be loaded, regardless of what is necessary for
styling and filtering.
|
TLspLIDARLayerBuilder |
model(ILcdModel aModel)
Sets the model of the layer.
|
static TLspLIDARLayerBuilder |
newBuilder()
Creates a new builder.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
public static TLspLIDARLayerBuilder newBuilder()
You must set a model on it using model(com.luciad.model.ILcdModel)
.
Default values:
class javadoc
public TLspLIDARLayerBuilder model(ILcdModel aModel)
ALspLayerBuilder
null
.model
in class ALspLayerBuilder
aModel
- a modelILcdLayer.getModel()
public TLspLIDARLayerBuilder label(String aLabel)
ALspLayerBuilder
null
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspLIDARLayerBuilder icon(ILcdIcon aIcon)
ALspLayerBuilder
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()
public TLspLIDARLayerBuilder layerStyle(TLspLayerStyle aLayerStyle)
ALspLayerBuilder
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 calling
ILspLayer.setLayerStyle(TLspLayerStyle)
.layerStyle
in class ALspLayerBuilder
aLayerStyle
- the layer style. Must not be null
. If you want to set the default layer style, set TLspLayerStyle.newBuilder().build()
ILspLayer.getLayerStyle()
,
ILspLayer.setLayerStyle(TLspLayerStyle)
public TLspLIDARLayerBuilder layerType(ILspLayer.LayerType aLayerType)
ILspLayer.LayerType.INTERACTIVE
.
This method throws UnsupportedOperationException
.
layerType
in class ALspLayerBuilder
aLayerType
- not usedILspLayer.getLayerType()
public TLspLIDARLayerBuilder mandatoryAttributes(ILcdExpression... aMandatoryAttributes)
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 LAS
layers, height
,
color
, classification
,
intensity
and infra-red
are
added by default for convenience.
For E57 layers, height
,
color
, and intensity
are added
by default for convenience when they are present in the data.
aMandatoryAttributes
- The set of mandatory attributespublic TLspLIDARLayerBuilder bodyStyles(TLspPaintState aPaintState, TLspPlotStyle... aStyles)
BODY
paint representation.
This method delegates to bodyStyler(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.styler.ILspStyler)
. Call bodyStyler(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 javadoc
for details).
aPaintState
- Paint state for this styleraStyles
- The styles to useTLspPlotStyle
public TLspLIDARLayerBuilder bodyStyler(TLspPaintState aPaintState, ILspStyler aStyler)
BODY
paint representation.
Special considerations:
TLspPlotStyle
.style target provider
to extract the actual point geometry out of the domain object. It must return ILcdPoint
objects.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 javadoc
for details).
aPaintState
- Paint state for this styleraStyler
- The styler to usebodyStyles(com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.style.TLspPlotStyle...)
public TLspLIDARLayerBuilder bodyScaleRange(ILcdInterval aScaleRange)
If not set, no scale range is used and the layer will always paint itself.
aScaleRange
- The scale rangepublic ILspLayer build()
ALspLayerBuilder
Creates a new layer instance.
build
in class ALspLayerBuilder
public static TLspPlotStyle getDefaultStyle(ILcdModel aModel)
TLspPlotStyle
configured for the given model.
Color
is available it uses that.Example:
TLspPlotStyle defaultStyle = getDefaultStyle(myModel); ILcdExpression<Color> myColorExpression = ... TLspPlotStyle myStyle = defaultStyle.asBuilder() .color(ifThenElse(myColorAvailable, myColorExpression, defaultStyle.getColor())); .build();
aModel
- The model to create a style for.