Class TLcdCompositeModelHeightProviderFactory

java.lang.Object
com.luciad.util.height.TLcdCompositeModelHeightProviderFactory
All Implemented Interfaces:
ILcdModelHeightProviderFactory

public class TLcdCompositeModelHeightProviderFactory extends Object implements ILcdModelHeightProviderFactory
This ILcdModelHeightProviderFactory tries to create an ILcdHeightProvider using a given list of other ILcdModelHeightProviderFactory instances. The first ILcdModelHeightProviderFactory that creates a height provider prevails.

Sample code

A class that requires a height provider based on a different types of models could construct a suitable factory as follows:


 // Create a list of height provider factories that may be relevant
 // for different models and different properties.
 List<ILcdModelHeightProviderFactory> factories = new ArrayList<ILcdModelHeightProviderFactory>();
 factories.add(new TLcdRasterModelHeightProviderFactory());
 ...

 // Create a composite height provider factory.
 ILcdModelHeightProviderFactory factory =
   new TLcdCompositeModelHeightProviderFactory(factories);
 
Since:
9.1
  • Constructor Details

    • TLcdCompositeModelHeightProviderFactory

      public TLcdCompositeModelHeightProviderFactory(List<? extends ILcdModelHeightProviderFactory> aFactories)
      Creates a TLcdCompositeModelHeightProviderFactory with a given list of ILcdModelHeightProviderFactory instances.
      Parameters:
      aFactories - a list of ILcdModelHeightProviderFactorys.
  • Method Details

    • getModelHeightProviderFactories

      public List<ILcdModelHeightProviderFactory> getModelHeightProviderFactories()
      Returns the list of height providers that this factory uses.
      Returns:
      an unmodifiable list of height providers used by this factory.
    • createHeightProvider

      public ILcdHeightProvider createHeightProvider(ILcdModel aModel, Map<String,Object> aRequiredProperties, Map<String,Object> aOptionalProperties) throws TLcdMissingPropertyException, TLcdUnsupportedPropertyException
      Description copied from interface: ILcdModelHeightProviderFactory
      Returns a height provider for a given ILcdModel using the given properties. The returned height provider is determined by the implementation, the ILcdModel and the given properties.
      Specified by:
      createHeightProvider in interface ILcdModelHeightProviderFactory
      Parameters:
      aModel - an ILcdModel for which a height provider is created.
      aRequiredProperties - the required properties. The properties can be retrieved using a String 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 an implementation of this interface uses a required property, it should always remove it from the list of required properties. When the ILcdHeightProvider 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 a String 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: