Class TLcyLOSAddOn
TLcyLspLOSAddOn as well.
For line-of-sight calculations on a GXY map, refer to TLcyLOSCoverageAddOn.- Since:
- 2019.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe LOS Model will use this as the type name in the model descriptor. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ALcyFormatReturns a new data format for this add-on.Returns a function used to calculate the center point of the line-of-sight and its corresponding altitude mode.protected final ALcyFormatcreateFormatWrapper(ALcyFormat aBaseFormat) Returns a new data format wrapper for this add-on.protected ILcdAltitudeProvidercreateTerrainAltitudeProvider(ILcdView aView, double aCalculationStepSize, ILcdGeoReference aPreferredReference, ILcyLucyEnv aLucyEnv) Creates anILcdAltitudeProviderthat is used by the line-of-sight calculations to retrieve the altitude of the terrain.voidplugInto(ILcyLucyEnv aLucyEnv) Creates and plugs in the add-on's format.voidunplugFrom(ILcyLucyEnv aLucyEnv) Unplugs the add-on's format.Methods inherited from class com.luciad.lucy.addons.ALcyFormatAddOn
createFormatTool, getFormatMethods inherited from class com.luciad.lucy.addons.ALcyPreferencesAddOn
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefixMethods inherited from class com.luciad.lucy.addons.ALcyAddOn
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
-
Field Details
-
LOS_MODEL_DESCRIPTOR_TYPENAME
The LOS Model will use this as the type name in the model descriptor.- See Also:
-
-
Constructor Details
-
TLcyLOSAddOn
public TLcyLOSAddOn()Create a new TLcyLOSAddOn.
-
-
Method Details
-
plugInto
Description copied from class:ALcyFormatAddOnCreates and plugs in the add-on's format.
- Overrides:
plugIntoin classALcyFormatAddOn- Parameters:
aLucyEnv- the Lucy environment to plug into- See Also:
-
unplugFrom
Description copied from class:ALcyFormatAddOnUnplugs the add-on's format.- Overrides:
unplugFromin classALcyFormatAddOn- Parameters:
aLucyEnv- the Lucy environment- See Also:
-
createBaseFormat
Description copied from class:ALcyFormatAddOnReturns a new data format for this add-on. Override this method to extend the default format with new functionality.
For example, to alter the icon of the layers of this format, you can decorate the layer factory created in the format:
@Override protected ALcyFormat createBaseFormat() { return new ALcyFormatWrapper(super.createBaseFormat()){ @Override protected ILcdGXYLayerFactory createGXYLayerFactory(){ final ILcdGXYLayerFactory delegate = super.createGXYLayerFactory(); return new ILcdGXYLayerFactory(){ @Override public ILcdGXYLayer createGXYLayer(ILcdModel aModel){ ILcdGXYLayer layer = delegate.createGXYLayer(aModel); if (layer != null){ ILcdIcon icon = ...; layer.setIcon(icon); } return layer; } } } } }- Specified by:
createBaseFormatin classALcyFormatAddOn- Returns:
- a new format for this add-on
-
createFormatWrapper
Description copied from class:ALcyFormatAddOnReturns a new data format wrapper for this add-on. A format wrapper extends the base format with aspects such as asynchronous painting, mutable file behavior, safe guarding, etc.
Overriding this method of an existing add-on should be done with extreme care as add-ons typically rely on the wrappers that should be present (e.g. a safe guard).
- Specified by:
createFormatWrapperin classALcyFormatAddOn- Parameters:
aBaseFormat- the base format to wrap- Returns:
- a new format for this add-on
- See Also:
-
createCenterPointShapeProvider
protected Function<TLcdDomainObjectContext,TLcdShapeAltitudeContext<ILcdPoint>> createCenterPointShapeProvider()Returns a function used to calculate the center point of the line-of-sight and its corresponding altitude mode. The function receives the
TLcdDomainObjectContextfor the (candidate) observer domain object, and should return the center point for the line-of-sight when the domain object is a valid source, together with the altitude mode to interpret the Z-value of the point. If not, the function should returnnull.The point returned by the function:
- must be defined in the same reference as the model containing the domain object.
-
must have a Z-value that can be interpreted in the returned altitude mode.
When the altitude mode is
TLcdCoverageAltitudeMode.ABOVE_GEOID, the geoid height information will be retrieved from the model reference. In that case, the model reference must contain this information (seeILcdGeoReference.getGeodeticDatum()andILcdGeodeticDatum.hasNonZeroHeights()).
The returned function will be called multiple times for the same domain object context. For example when the domain object changes, the function will be re-triggered to obtain the new shape.
When the function has returned a non-
nullvalue for a certain domain object context, it should return a non-nullvalue on subsequent calls for the same domain object context.The default implementation of this method is based on the
ALcdShape.fromDomainObject(Object)for deriving the shape and uses a heuristic for the coverage altitude mode.This method can also be called from a background thread.
- Returns:
- function to retrieve the center
ILcdPointand its altitude mode from a domain object context. - Since:
- 2020.1
-
createTerrainAltitudeProvider
protected ILcdAltitudeProvider createTerrainAltitudeProvider(ILcdView aView, double aCalculationStepSize, ILcdGeoReference aPreferredReference, ILcyLucyEnv aLucyEnv) Creates an
ILcdAltitudeProviderthat is used by the line-of-sight calculations to retrieve the altitude of the terrain.The default implementation of this method returns an altitude provider using either the elevation of the painted terrain or the height data available in the models loaded on the map, depending on the value of the
useModelElevationDataproperty in the configuration file of this add-on.This method can also be called from a background thread.
- Parameters:
aView- The view containing the line-of-sight. This can be used to access all the data that is loaded on the map.aCalculationStepSize- The step size that will be used for the calculation. It is based on theTLspLOSProperties.getRadiusStep()and theTLspLOSProperties.getRadiusSampleDistances().aPreferredReference- The reference that will be used the most to retrieve elevation values. Performance will improve if the returned altitude provider can provide elevation values for points expressed in this reference without additional transformations.aLucyEnv- The Lucy back-end- Returns:
- The created altitude provider.
- Since:
- 2020.1
-