Class TLcyVisibilityAddOn
For visibility calculations on a Lightspeed map, refer to TLcyShapeVisibilityAddOn
and TLcyLspShapeVisibilityFormatAddOn
.
The back-end
performs the actual calculation. It can be used independently of the used
GUI.
The GUI's application pane is built by a ALcyApplicationPaneTool
, using the add-on's GUI factory
.
By default, this GUI uses the composite workspace preferences of the add-on's preferences tool
.
The add-on's functionality can be changed by extending the back-end, or by extending the GUI builder and tapping into the latter preferences object. See the TEA developer's guide for more information on using and extending TEA add-ons.
Note that this add-on depends on the LuciadLightspeed Terrain Analysis Engine component.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Determines whether GUI changes should be automatically propagated to the layer and start a new visibility calculation.static final boolean
Default value for the propertyAUTO_UPDATE_KEY
.static final String
Property name for the color to use for invisibility.static final Color
Default value for the propertyCOLOR_INVISIBLE_KEY
.static final String
Property name for the color to use for unknown visibility.static final Color
Default value for the propertyCOLOR_UNKNOWN_KEY
.static final String
Property name for the color to use for visibility.static final Color
Default value for the propertyCOLOR_VISIBLE_KEY
.static final String
Property name for the currently selected shape to compute visibility from.static final String
Property name for the shapes to compute visibility from.static final String
TheILcdGXYLayer
that is linked to the GUI panel.static final ILcdGXYLayer
Default value for the propertyLINKED_LAYER_KEY
.static final String
Property name for the used output format.static final String
Constant identifying a raster-based visibility.static final String
Default value for the propertyOUTPUT_FORMAT_KEY
.static final String
Constant identifying a vector-based visibility.static final String[]
Default value for the propertyPROPAGATION_LIST_KEY
.static final String
Property name for the list of propagation functions to choose from.static final String
Property name for descriptions of the predefined quality levels to choose from.static final String[]
Default value for theQUALITY_DESCRIPTIONS_KEY
property.static final String
Property name for predefined quality levels to choose from.static final double[]
Default value for theproperty
.static final String
Quality property for calculations, expressed in meters per discretization step.static final double
Default value for theproperty
.static final String
Default value for the propertySELECTED_PROPAGATION_KEY
.static final String
Property name for the propagation function to use to calculate the visibility.static final String
Property name for the currently selected shape to compute visibility to.static final String
Property name for the shapes to compute visibility to. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ALcyApplicationPaneTool
Returns the add-on's application pane tool.protected ALcyFormat
Returns a new data format for this add-on.final ALcyFormat
createFormatWrapper
(ALcyFormat aBaseFormat) Returns a new data format wrapper for this add-on.protected ALcyGUIFactory
<Component> Returns a new GUI factory for this add-on.protected TLcyPreferencesTool
Creates theTLcyPreferencesTool
to be used by this add-on.protected TLcyVisibilityBackEnd
Returns a new back-end for visibility calculations.Returns the tool that creates the add-on's application pane.Returns the GUI factory to create the add-on's application pane.The back-end that the GUI can use for performing visibility calculations.void
plugInto
(ILcyLucyEnv aLucyEnv) Builds a GUI, back-end and file format for visibility calculations and plugs in the GUI and file format.void
unplugFrom
(ILcyLucyEnv aLucyEnv) Unplugs the add-on's format, preferences tool and application pane tool.Methods inherited from class com.luciad.lucy.addons.ALcyFormatAddOn
createFormatTool, getFormat
Methods inherited from class com.luciad.lucy.addons.ALcyPreferencesAddOn
getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix
Methods inherited from class com.luciad.lucy.addons.ALcyAddOn
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
-
Field Details
-
FROM_SHAPE_LIST_KEY
Property name for the shapes to compute visibility from. The associated property value is an array of String objects.- See Also:
-
FROM_SELECTED_SHAPE_KEY
Property name for the currently selected shape to compute visibility from. The associated value is of type String, and denotes the ID that can be used to retrieve the shape's sub-properties. The sub-property suffixes are defined inTLcyVisibilityBackEnd
.For example, the domain object for the shape "Shape23" can be found in the property named ""TLcyVisibilityAddOn.layer.tea.from."" + "Shape23" + "." +
TLcyVisibilityBackEnd.DOMAIN_OBJECT_CONTEXT_KEY
-
TO_SHAPE_LIST_KEY
Property name for the shapes to compute visibility to. The associated property value is an array of String objects.- See Also:
-
TO_SELECTED_SHAPE_KEY
Property name for the currently selected shape to compute visibility to. The associated value is of type String, and denotes the ID that can be used to retrieve additional shape properties. These properties are defined inTLcyVisibilityBackEnd
.For example, the domain object for the shape "Shape23" can be found in the property named ""TLcyVisibilityAddOn.layer.tea.to."" + "Shape23" + "." +
TLcyVisibilityBackEnd.DOMAIN_OBJECT_CONTEXT_KEY
-
PROPAGATION_LIST_KEY
Property name for the list of propagation functions to choose from. The associated property value is an array of String objects.- See Also:
-
PROPAGATION_LIST_DEFAULT_VALUE
Default value for the propertyPROPAGATION_LIST_KEY
. -
SELECTED_PROPAGATION_KEY
Property name for the propagation function to use to calculate the visibility. The associated property value is of type String. SeeTLcyVisibilityBackEnd
for the supported propagation functions.TLcyVisibilityBackEnd.createPropagationFunction(com.luciad.lucy.util.properties.ALcyProperties)
is used to construct the actual provider.The property value is used for additional propagation properties. These properties are defined in
TLcyVisibilityBackEnd
. For example, the altitude mode for the functionTLcyVisibilityBackEnd.PROPAGATION_FUNCTION_VALUE_NORMAL
can be found in the property named:
-
""TLcyVisibilityAddOn.layer.tea.propagation."" +
TLcyVisibilityBackEnd.PROPAGATION_FUNCTION_VALUE_NORMAL
+ "." +
- See Also:
-
SELECTED_PROPAGATION_DEFAULT_VALUE
Default value for the propertySELECTED_PROPAGATION_KEY
. -
QUALITY_KEY
Quality property for calculations, expressed in meters per discretization step. The corresponding property value is of type double.- See Also:
-
QUALITY_VALUE_DEFAULT
public static final double QUALITY_VALUE_DEFAULTDefault value for theproperty
.- See Also:
-
QUALITY_ITEMS_KEY
Property name for predefined quality levels to choose from. The values are sorted by increasing accuracy.- See Also:
-
QUALITY_ITEMS_VALUE_DEFAULT
public static final double[] QUALITY_ITEMS_VALUE_DEFAULTDefault value for theproperty
. -
QUALITY_DESCRIPTIONS_KEY
Property name for descriptions of the predefined quality levels to choose from.- See Also:
-
QUALITY_DESCRIPTIONS_VALUE_DEFAULT
Default value for theQUALITY_DESCRIPTIONS_KEY
property. -
COLOR_UNKNOWN_KEY
Property name for the color to use for unknown visibility. The associated property type is of typeColor
.- See Also:
-
COLOR_UNKNOWN_VALUE_DEFAULT
Default value for the propertyCOLOR_UNKNOWN_KEY
. -
COLOR_VISIBLE_KEY
Property name for the color to use for visibility. The associated property type is of typeColor
.- See Also:
-
COLOR_VISIBLE_VALUE_DEFAULT
Default value for the propertyCOLOR_VISIBLE_KEY
. -
COLOR_INVISIBLE_KEY
Property name for the color to use for invisibility. The associated property type is of typeColor
.- See Also:
-
COLOR_INVISIBLE_VALUE_DEFAULT
Default value for the propertyCOLOR_INVISIBLE_KEY
. -
OUTPUT_FORMAT_KEY
Property name for the used output format. The associated property is one ofOUTPUT_FORMAT_RASTER_ID
orOUTPUT_FORMAT_VECTOR_ID
.- See Also:
-
OUTPUT_FORMAT_VALUE_DEFAULT
Default value for the propertyOUTPUT_FORMAT_KEY
.- See Also:
-
OUTPUT_FORMAT_RASTER_ID
Constant identifying a raster-based visibility.- See Also:
-
OUTPUT_FORMAT_VECTOR_ID
Constant identifying a vector-based visibility.- See Also:
-
LINKED_LAYER_KEY
TheILcdGXYLayer
that is linked to the GUI panel. This value is automatically set when selecting a contour layer in the active map's layer panel. The corresponding property value is of typeILcdGXYLayer
- See Also:
-
LINKED_LAYER_VALUE_DEFAULT
Default value for the propertyLINKED_LAYER_KEY
. -
AUTO_UPDATE_KEY
Determines whether GUI changes should be automatically propagated to the layer and start a new visibility calculation. The corresponding property value is a boolean.- See Also:
-
AUTO_UPDATE_VALUE_DEFAULT
public static final boolean AUTO_UPDATE_VALUE_DEFAULTDefault value for the propertyAUTO_UPDATE_KEY
.- See Also:
-
-
Constructor Details
-
TLcyVisibilityAddOn
public TLcyVisibilityAddOn()Default constructor for the visibility add-on.
-
-
Method Details
-
plugInto
Builds a GUI, back-end and file format for visibility calculations and plugs in the GUI and file format.- Parameters:
aLucyEnv
- the Lucy instance to plug into- See Also:
-
getVisibilityBackEnd
The back-end that the GUI can use for performing visibility calculations.Override
createVisibilityBackEnd()
to extend the back-end.- Returns:
- a
TLcyVisibilityBackEnd
object for performing visibility calculations - See Also:
-
createVisibilityBackEnd
Returns a new back-end for visibility calculations. Override this method to extend the default back-end with new functionality.- Returns:
- a new back-end for extreme point calculations
-
createGUIFactory
Returns a new GUI factory for this add-on. Override this method to extend the default GUI with new functionality.For example, this add-on could return a new instance of
TLcyVisibilityGUIFactory
- Returns:
- a new GUI factory for this add-on
-
createBaseFormat
Returns 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; } } } } }
Note that the created format is at least wrapped by a
TLcySafeGuardFormatWrapper
(or equivalent) before it is plugged inILcyLucyEnv
(using e.g. TLcyFormatTool). So it is safe to rely on the safety checks performed by that wrapper.- Returns:
- a new file format for this add-on
-
createFormatWrapper
Description copied from class:ALcyFormatAddOn
Returns 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:
createFormatWrapper
in classALcyFormatAddOn
- Parameters:
aBaseFormat
- the base format to wrap- Returns:
- a new format for this add-on
- See Also:
-
createApplicationPaneTool
Returns the add-on's application pane tool. Override this method to add to the default application pane tool's functionality.This add-on's application pane tool initializes the GUI factory with the add-on's composite workspace preferences. It also ensures that the panel is updated from the selected TEA layer's stored GUI properties.
- Returns:
- the add-on's application pane tool
- See Also:
-
getGUIFactory
Returns the GUI factory to create the add-on's application pane. SeecreateGUIFactory()
if you want to override or extend the add-on's factory.- Returns:
- the add-on's GUI factory
-
getApplicationPaneTool
Returns the tool that creates the add-on's application pane. SeecreateApplicationPaneTool()
if you want to override or extend the add-on's application pane tool.- Returns:
- the tool that creates the add-on's application pane
-
unplugFrom
Unplugs the add-on's format, preferences tool and application pane tool.- Overrides:
unplugFrom
in classALcyFormatAddOn
- Parameters:
aLucyEnv
- the Lucy environment- See Also:
-
createPreferencesTool
Creates theTLcyPreferencesTool
to be used by this add-on. Overwriting this method for example allows to register additionalILcyPropertyConverter
s for (complex) custom properties, to make sure they are correctly decoded from the add-on's configuration file and/or saved to the workspace. Note that this isn't required for simple properties such asString
,int
,double
, etc.- Overrides:
createPreferencesTool
in classALcyPreferencesAddOn
- Returns:
- the created
TLcyPreferencesTool
.
-