Class TLspRadarVideoLayerBuilder
ILcdDataModelDescriptor
whose
element types contain a TLcdDataType
which
extends from TLcdRadarVideoDataTypes.RADAR_VIDEO_DATA_TYPE
.
Customizing the radar visualization
The appearance of the radar video can be configured usingTLspRadarVideoStyle
. Additionally, the layers
created by this builder support the same styling constructs as
TLspShapeLayerBuilder
. This allows the user to
add decorations (e.g. grid lines) and labels to the radar feed.
The default styler shows the radar video data, a sweep line and a polar grid. This styler is a
ILspCustomizableStyler
, which means you can adjust the style of these elements after you have created this
layer.
The identifiers of this ILspCustomizableStyler
are:
- "radarVideo" for the
TLspRadarVideoStyle
for the radar content. - "radarSweepLine" for the
TLspLineStyle
of the sweep line. - "radarRangeRing" for the
TLspLineStyle
of the range rings. - "radarGrid" for the
TLspLineStyle
of the polar grid lines.
You can use these identifiers if you want to change the style of one of these elements. For instance, changing the color of the sweep line:
private ILspLayer createRadarLayer(ILcdModel aModel) {
ILspEditableStyledLayer radarLayer = TLspRadarVideoLayerBuilder
.newBuilder()
.model(aModel)
.build();
ILspCustomizableStyler styler = (ILspCustomizableStyler) radarLayer.getStyler(
TLspPaintRepresentationState.REGULAR_BODY
);
for (TLspCustomizableStyle style : styler.getStyles()) {
if (style.getIdentifier().equals(TLspRadarVideoLayerBuilder.SWEEP_LINE_STYLE_IDENTIFIER)) {
TLspLineStyle originalStyle = (TLspLineStyle) style.getStyle();
style.setStyle(originalStyle.asBuilder().color(Color.BLUE).build());
}
}
return radarLayer;
}
For deeper customization, you can replace the styler with your own implementation. For example if you want to change the number of range rings:
public class RadarStyler extends ALspStyler {
private static final int RING_COUNT = 3;
private static final ALspStyleTargetProvider sRangeRingStyleTargetProvider = new ALspStyleTargetProvider() {
@Override
public void getStyleTargetsSFCT(Object aObject, TLspContext aContext, List<Object> aResultSFCT) {
double range = (Double) ((ILcdDataObject) aObject).getValue(TLcdRadarVideoDataTypes.RADAR_RANGE_PROPERTY);
// Range rings
for (int i = 1; i <= RING_COUNT; i++) {
TLcdXYCircle c = new TLcdXYCircle(0, 0, i * range / RING_COUNT);
aResultSFCT.add(c);
}
}
};
private final ALspStyle fRadarStyle = TLspRadarVideoStyle.newBuilder().build();
private final ALspStyle fRingStyle = TLspLineStyle.newBuilder().build();
@Override
public void style(Collection<?> aObjects, ALspStyleCollector aStyleCollector, com.luciad.view.lightspeed.TLspContext aContext) {
aStyleCollector
.objects(aObjects)
.styles(fRadarStyle)
.submit();
aStyleCollector
.objects(aObjects)
.geometry(sRangeRingStyleTargetProvider)
.styles(fRingStyle)
.submit();
}
}
Data resolution
For more information on the modeling of radar data, please refer toTLcdRadar
.
The resolution of a radar video feed is determined by two properties:
- The angular resolution depends on the azimuth range covered by each individual data record
- The radial resolution depends on the "cell length" property of each data record
- The radar data is treated as uniform data: based on the records in the initialization phase, all sweep lines are treated as if they have the same azimuth arc angle. The azimuth arc angle is the difference between start and end azimuth.
- A sweep line can be provided in multiple parts, meaning two records will be received with the same start and end azimuth, but with a different start range. In that case, the cell lengths in both calls must be equal or an integer multiple of each other.
- The number of radial steps is chosen based on the smallest encountered cell length. If the cell length is variable, we assume that larger cells use a multiple of the smallest ones.
It is, however, also possible to decouple the resolution of the visualization from that of the data, by calling the
displayResolution(TLspRadarDisplayResolution)
method. This method allows you to specify the
resolution and range of the visualization, thus providing a trade-off between performance and quality. The incoming
data records will be resampled to match the resolution you specified. This resampling step is performed by the GPU
and is therefore very efficient. If you enable this behavior, your radar layer can support radar data with variable
angular or radial resolutions, which does not meet the assumptions outlined above. As a result,
such data will not introduce errors in the display.
- Since:
- 2014.1
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Identifier for theTLspCustomizableStyle
for the polar grid lines.static final String
Identifier for theTLspCustomizableStyle
for the radar video.static final String
Identifier for theTLspCustomizableStyle
for the range rings.static final String
Identifier for theTLspCustomizableStyle
for the sweep line. -
Method Summary
Modifier and TypeMethodDescriptionbodyStyler
(TLspPaintState aPaintState, ILspStyler aBodyStyler) Sets the body styler for the given paint state.build()
Creates a new radar layer using the current settings of this builder.displayResolution
(TLspRadarDisplayResolution aSettings) Specifies the resolution and range of the radar data that is visualized.Sets the icon of the layer.Sets the label of the layer.labelStyler
(TLspPaintState aPaintState, ILspStyler aLabelStyler) Sets the label styler for the given paint state.layerStyle
(TLspLayerStyle aLayerStyle) Set a layer style to be used during the rendering of the layer.layerType
(ILspLayer.LayerType aLayerType) This method throws anUnsupportedOperationException
.Sets the model of the layer.static TLspRadarVideoLayerBuilder
Creates a new radar layer builder.selectable
(boolean aSelectable) Specifies whether layers should be made selectable.selectableSupported
(boolean aSelectableSupported) Sets whether the layer should support selection.synchronous
(boolean aIsSynchronous) Specifies whether created layers should paint synchronously.Methods inherited from class com.luciad.view.lightspeed.layer.ALspLayerBuilder
getIcon, getLabel, getLayerStyle, getLayerType, getModel
-
Field Details
-
RADAR_VIDEO_STYLE_IDENTIFIER
Identifier for theTLspCustomizableStyle
for the radar video. The style contained in thatTLspCustomizableStyle
is aTLspRadarVideoStyle
.- Since:
- 2018.0
- See Also:
-
GRID_LINE_STYLE_IDENTIFIER
Identifier for theTLspCustomizableStyle
for the polar grid lines. The style contained in thatTLspCustomizableStyle
is aTLspLineStyle
.- Since:
- 2018.0
- See Also:
-
RANGE_RING_STYLE_IDENTIFIER
Identifier for theTLspCustomizableStyle
for the range rings. The style contained in thatTLspCustomizableStyle
is aTLspLineStyle
.- Since:
- 2018.0
- See Also:
-
SWEEP_LINE_STYLE_IDENTIFIER
Identifier for theTLspCustomizableStyle
for the sweep line. The style contained in thatTLspCustomizableStyle
is aTLspLineStyle
.- Since:
- 2018.0
- See Also:
-
-
Method Details
-
newBuilder
Creates a new radar layer builder.- Returns:
- a new radar layer builder
-
build
Creates a new radar layer using the current settings of this builder.- Specified by:
build
in classALspLayerBuilder
- Returns:
- a new radar layer
-
bodyStyler
Sets the body styler for the given paint state. The styler can produceTLspRadarVideoStyle
s to customize the appearance of the radar feed. Furthermore, the styler may output additional geometries (using astyle target provider
).e For these additional geometries, all styles supported byTLspShapeLayerBuilder
are also supported. This allows the styler to add decorations such as grid lines on top of the radar feed.- Parameters:
aPaintState
- the paint state for which to set the body styleraBodyStyler
- the new body styler for the layer- Returns:
this
-
labelStyler
Sets the label styler for the given paint state. SeeTLspShapeLayerBuilder
for information on the supported styles.- Parameters:
aPaintState
- the paint state for which to set the label styleraLabelStyler
- the new label styler for the layer- Returns:
this
-
selectable
Specifies whether layers should be made selectable. Set totrue
by default.- Parameters:
aSelectable
- whether or not created layers should be selectable- Returns:
this
-
selectableSupported
Sets whether the layer should support selection. By default, layers support selection.- Parameters:
aSelectableSupported
- whether the layer should support selection- Returns:
this
-
synchronous
Specifies whether created layers should paint synchronously. The default is false and allows layers to perform shape discretization and other expensive processing using the view's ILspTaskExecutor. When synchronous mode is on, all such tasks are performed on the EDT.It is strongly recommended to leave this setting off, to ensure that the application remains responsive. Applications that need to change the view's world reference on a regular basis, however, may want to consider synchronous mode to avoid flickering.
- Parameters:
aIsSynchronous
- true if the layer should paint synchronously- Returns:
this
-
model
Description copied from class:ALspLayerBuilder
Sets the model of the layer. The default value isnull
.- Overrides:
model
in classALspLayerBuilder
- Parameters:
aModel
- a model- Returns:
- this builder
- See Also:
-
label
Description copied from class:ALspLayerBuilder
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 isnull
.- Overrides:
label
in classALspLayerBuilder
- Parameters:
aLabel
- the label- Returns:
- this builder
- 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:
-
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:
-
layerType
This method throws anUnsupportedOperationException
. The layer type of radar layers is alwaysILspLayer.LayerType.REALTIME
.- Overrides:
layerType
in classALspLayerBuilder
- Parameters:
aLayerType
- the layer type- Returns:
this
- See Also:
-
displayResolution
Specifies the resolution and range of the radar data that is visualized. Data that lies outside the specified distance range will not be displayed, and incoming data will be resampled to match the requested radial and angular resolution. If this method is not called, the layer will infer the range and resolution of the radar feed by looking at the data records themselves, but this requires the feed resolution to be constant (i.e. the cell size and azimuth interval must be consistently the same in all radar data records).- Parameters:
aSettings
- the resolution settings to be used for the radar display.- Returns:
this
- Since:
- 2024.0
-