Package com.luciad.util.height
Class ALcdModelHeightProviderFactory
java.lang.Object
com.luciad.util.height.ALcdModelHeightProviderFactory
- All Implemented Interfaces:
ILcdModelHeightProviderFactory
- Direct Known Subclasses:
ALcdRasterModelHeightProviderFactory
public abstract class ALcdModelHeightProviderFactory
extends Object
implements ILcdModelHeightProviderFactory
This abstract class provides a method to create an
ILcdHeightProvider
when an ILcdModel
is given.- Since:
- 9.1
-
Field Summary
Fields inherited from interface com.luciad.util.height.ILcdModelHeightProviderFactory
KEY_GEO_REFERENCE
-
Constructor Summary
ConstructorDescriptionCreates a newTLcdModelHeightProviderFactory
. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
canCreateHeightProvider
(ILcdModel aModel) Checks if a height provider can be created from the givenILcdModel
.createHeightProvider
(ILcdModel aModel, Map<String, Object> aRequiredPropertiesSFCT, Map<String, Object> aOptionalProperties) Returns a height provider for a givenILcdModel
using the given properties.protected abstract ILcdHeightProvider
createModelElementHeightProvider
(Object aElement, Map<String, Object> aRequiredPropertiesSFCT, Map<String, Object> aOptionalProperties) Creates anILcdHeightProvider
for the given model element.protected void
transformProperties
(ILcdModel aModel, ILcdGeoReference aFromReference, ILcdGeoReference aToReference, Map<String, Object> aRequiredPropertiesSFCT, Map<String, Object> aOptionalPropertiesSFCT) Transforms the properties in theTLcdHeightProviderProperties
.
-
Constructor Details
-
ALcdModelHeightProviderFactory
public ALcdModelHeightProviderFactory()Creates a newTLcdModelHeightProviderFactory
.
-
-
Method Details
-
createHeightProvider
public ILcdHeightProvider createHeightProvider(ILcdModel aModel, Map<String, Object> aRequiredPropertiesSFCT, Map<String, throws TLcdMissingPropertyException, TLcdUnsupportedPropertyExceptionObject> aOptionalProperties) Description copied from interface:ILcdModelHeightProviderFactory
Returns a height provider for a givenILcdModel
using the given properties. The returned height provider is determined by the implementation, theILcdModel
and the given properties.- Specified by:
createHeightProvider
in interfaceILcdModelHeightProviderFactory
- Parameters:
aModel
- anILcdModel
for which a height provider is created.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 benull
. When an implementation of this interface uses a required property, it should always remove it from the list of required properties. When theILcdHeightProvider
is actually made, implementations should verify that the list of required properties is empty (and all required properties are used).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:
-
transformProperties
protected void transformProperties(ILcdModel aModel, ILcdGeoReference aFromReference, ILcdGeoReference aToReference, Map<String, Object> aRequiredPropertiesSFCT, Map<String, throws TLcdOutOfBoundsExceptionObject> aOptionalPropertiesSFCT) Transforms the properties in theTLcdHeightProviderProperties
. A height provider factory that extends this class should override this method if it defines extra properties that depend on the geo reference property. If this is the case, it should be possible to transform these properties toaToReference
.- Parameters:
aModel
- a model defined with respect toaToReference
.aFromReference
- the reference in which the properties are defined.aToReference
- the reference to which the properties will be transformed.aRequiredPropertiesSFCT
- the required properties.aOptionalPropertiesSFCT
- the optional properties.- Throws:
TLcdOutOfBoundsException
- when a property cannot be transformed correctly.
-
createModelElementHeightProvider
protected abstract ILcdHeightProvider createModelElementHeightProvider(Object aElement, Map<String, Object> aRequiredPropertiesSFCT, Map<String, throws TLcdMissingPropertyException, TLcdUnsupportedPropertyExceptionObject> aOptionalProperties) Creates anILcdHeightProvider
for the given model element.- Parameters:
aElement
- a model element.aRequiredPropertiesSFCT
- the required properties.aOptionalProperties
- the optional properties.- Returns:
- an
ILcdHeightProvider
for the given model element ornull
if noILcdHeightProvider
can be created. - Throws:
TLcdMissingPropertyException
- when a property is missing that is necessary to create theILcdHeightProvider
.TLcdUnsupportedPropertyException
- when a required property was never used while creating theILcdHeightProvider
.
-
canCreateHeightProvider
Checks if a height provider can be created from the givenILcdModel
.- Parameters:
aModel
- the given model.- Returns:
true
if a height provider can be created from the given model andfalse
otherwise.
-