Package com.luciad.earth.tileset.terrain
Class TLcdEarthGXYLayerHeightProviderFactory
java.lang.Object
com.luciad.earth.tileset.terrain.TLcdEarthGXYLayerHeightProviderFactory
- All Implemented Interfaces:
ILcdLayerHeightProviderFactory
public class TLcdEarthGXYLayerHeightProviderFactory
extends Object
implements ILcdLayerHeightProviderFactory
A layer-based height provider factory implementation for
ILcdEarthTileSet
s
in ILcdGXYView
s. Additionally the ILcdGXYLayer
must have a TLcdEarthGXYElevationRasterPainter
as painter.
Usage
An important advantage of the layer-based height providers vs. model-based height providers is that the returned heights are the same as those visible in the view. This is for example important when you have a label that displays the height at the cursor position. Another important advantage is that using a layer-based height provider typically results in significantly better performance than the model-based counterpart because all necessary tiles are already cached. This avoids additional tile production which possibly requires expensive operations such as IO. This is especially important when the heights need to be retrieved from the event dispatch thread (ex. while painting).- Since:
- 10.1
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.util.height.ILcdLayerHeightProviderFactory
KEY_GEO_REFERENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateHeightProvider
(ILcdLayer aLayer, ILcdView aView, Map<String, Object> aRequiredProperties, Map<String, Object> aOptionalProperties) A height provider is created for each tile set in the layer's model by using thecreateTileSetHeightProvider(com.luciad.earth.tileset.ILcdEarthTileSet, com.luciad.view.gxy.ILcdGXYLayer, com.luciad.view.gxy.ILcdGXYView, com.luciad.reference.ILcdGeoReference, java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>)
method.protected ILcdHeightProvider
createTileSetHeightProvider
(ILcdEarthTileSet aTileSet, ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView, ILcdGeoReference aReference, Map<String, Object> aRequiredPropertiesSFCT, Map<String, Object> aOptionalProperties) Creates a layer-based height provider for a tile set.protected TLcdEarthGXYElevationRasterPainter
getGXYElevationPainter
(ILcdEarthTileSet aTileSet, ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView, ILcdGeoReference aReference, Map<String, Object> aRequiredPropertiesSFCT, Map<String, Object> aOptionalProperties) Returns the elevation painter for a tile set.
-
Constructor Details
-
TLcdEarthGXYLayerHeightProviderFactory
public TLcdEarthGXYLayerHeightProviderFactory()
-
-
Method Details
-
createHeightProvider
public ILcdHeightProvider createHeightProvider(ILcdLayer aLayer, ILcdView aView, Map<String, Object> aRequiredProperties, Map<String, throws TLcdMissingPropertyException, TLcdUnsupportedPropertyExceptionObject> aOptionalProperties) A height provider is created for each tile set in the layer's model by using thecreateTileSetHeightProvider(com.luciad.earth.tileset.ILcdEarthTileSet, com.luciad.view.gxy.ILcdGXYLayer, com.luciad.view.gxy.ILcdGXYView, com.luciad.reference.ILcdGeoReference, java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>)
method.- Specified by:
createHeightProvider
in interfaceILcdLayerHeightProviderFactory
- Parameters:
aLayer
- anILcdLayer
for which a height provider is created.aView
- anILcdView
in whichaLayer
is contained.aRequiredProperties
- the required properties. The properties can be retrieved using aString
key describing the property type. When not all required properties are used, an exception is thrown.aRequiredProperties
may be empty but should not be null. When a required property as used, it should always be removed from the list of required properties. When anILcdHeightProvider
is actually made, the list of required properties should be verified.aOptionalProperties
- the optional properties. The properties can be retrieved using aString
key describing the property type. The optional properties may or may not be used by the implementation.aOptionalProperties
may be empty but should not be null.- Returns:
- a height provider if elevation is supported, or
null
when elevation is not supported or when no valid height provider can be created. - Throws:
TLcdMissingPropertyException
- when the implementation misses a necessary property.TLcdUnsupportedPropertyException
- when a required property is not used by the implementation.- See Also:
-
createTileSetHeightProvider
protected ILcdHeightProvider createTileSetHeightProvider(ILcdEarthTileSet aTileSet, ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView, ILcdGeoReference aReference, Map<String, Object> aRequiredPropertiesSFCT, Map<String, Object> aOptionalProperties) Creates a layer-based height provider for a tile set. The elevation painter for the tile set is retrieved using thegetGXYElevationPainter(com.luciad.earth.tileset.ILcdEarthTileSet, com.luciad.view.gxy.ILcdGXYLayer, com.luciad.view.gxy.ILcdGXYView, com.luciad.reference.ILcdGeoReference, java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>)
method.- Parameters:
aTileSet
- theILcdEarthTileSet
for which a height provider is created.aGXYLayer
- anILcdGXYLayer
for which a height provider is created.aGXYView
- anILcdGXYView
in whichaLayer
is contained.aReference
- the geographic reference of the height provider.aRequiredPropertiesSFCT
- the required properties. The properties can be retrieved using aString
key describing the property type. When not all required properties are used, an exception is thrown.aRequiredProperties
may be empty but should not be null. When a required property as used, it should always be removed from the list of required properties. When anILcdHeightProvider
is actually made, the list of required properties should be verified.aOptionalProperties
- the optional properties. The properties can be retrieved using aString
key describing the property type. The optional properties may or may not be used by the implementation.aOptionalProperties
may be empty but should not be null.- Returns:
- a height provider if elevation is supported, or
null
when elevation is not supported or when no valid height provider can be created. - See Also:
-
getGXYElevationPainter
protected TLcdEarthGXYElevationRasterPainter getGXYElevationPainter(ILcdEarthTileSet aTileSet, ILcdGXYLayer aGXYLayer, ILcdGXYView aGXYView, ILcdGeoReference aReference, Map<String, Object> aRequiredPropertiesSFCT, Map<String, Object> aOptionalProperties) Returns the elevation painter for a tile set. The default implementation returns a painter if the layer is aTLcdGXYLayer
with aTLcdEarthGXYElevationRasterPainter
as one of its painter providers ornull
otherwise. This method can be overridden to retrieve the elevation painter from a layer that is not supported by the default implementation.- Parameters:
aTileSet
- theILcdEarthTileSet
for which a height provider is created.aGXYLayer
- anILcdGXYLayer
for which a height provider is created.aGXYView
- anILcdGXYView
in whichaLayer
is contained.aReference
- the geographic reference of the height provider.aRequiredPropertiesSFCT
- the required properties. The properties can be retrieved using aString
key describing the property type. When not all required properties are used, an exception is thrown.aRequiredProperties
may be empty but should not be null. When a required property as used, it should always be removed from the list of required properties. When anILcdHeightProvider
is actually made, the list of required properties should be verified.aOptionalProperties
- the optional properties. The properties can be retrieved using aString
key describing the property type. The optional properties may or may not be used by the implementation.aOptionalProperties
may be empty but should not be null.- Returns:
- an elevation painter or
null
when none is available. - See Also:
-