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
ILcdEarthTileSets
in ILcdGXYViews. 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
Constructors -
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 ILcdHeightProvidercreateTileSetHeightProvider(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 TLcdEarthGXYElevationRasterPaintergetGXYElevationPainter(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:
createHeightProviderin interfaceILcdLayerHeightProviderFactory- Parameters:
aLayer- anILcdLayerfor which a height provider is created.aView- anILcdViewin whichaLayeris contained.aRequiredProperties- the required properties. The properties can be retrieved using aStringkey describing the property type. When not all required properties are used, an exception is thrown.aRequiredPropertiesmay 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 anILcdHeightProvideris actually made, the list of required properties should be verified.aOptionalProperties- the optional properties. The properties can be retrieved using aStringkey describing the property type. The optional properties may or may not be used by the implementation.aOptionalPropertiesmay be empty but should not be null.- Returns:
- a height provider if elevation is supported, or
nullwhen 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- theILcdEarthTileSetfor which a height provider is created.aGXYLayer- anILcdGXYLayerfor which a height provider is created.aGXYView- anILcdGXYViewin whichaLayeris contained.aReference- the geographic reference of the height provider.aRequiredPropertiesSFCT- the required properties. The properties can be retrieved using aStringkey describing the property type. When not all required properties are used, an exception is thrown.aRequiredPropertiesmay 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 anILcdHeightProvideris actually made, the list of required properties should be verified.aOptionalProperties- the optional properties. The properties can be retrieved using aStringkey describing the property type. The optional properties may or may not be used by the implementation.aOptionalPropertiesmay be empty but should not be null.- Returns:
- a height provider if elevation is supported, or
nullwhen 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 aTLcdGXYLayerwith aTLcdEarthGXYElevationRasterPainteras one of its painter providers ornullotherwise. This method can be overridden to retrieve the elevation painter from a layer that is not supported by the default implementation.- Parameters:
aTileSet- theILcdEarthTileSetfor which a height provider is created.aGXYLayer- anILcdGXYLayerfor which a height provider is created.aGXYView- anILcdGXYViewin whichaLayeris contained.aReference- the geographic reference of the height provider.aRequiredPropertiesSFCT- the required properties. The properties can be retrieved using aStringkey describing the property type. When not all required properties are used, an exception is thrown.aRequiredPropertiesmay 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 anILcdHeightProvideris actually made, the list of required properties should be verified.aOptionalProperties- the optional properties. The properties can be retrieved using aStringkey describing the property type. The optional properties may or may not be used by the implementation.aOptionalPropertiesmay be empty but should not be null.- Returns:
- an elevation painter or
nullwhen none is available. - See Also:
-