Class TLcdTerrainViewshedFactory

java.lang.Object
com.luciad.tea.viewshed.TLcdTerrainViewshedFactory
All Implemented Interfaces:
ILcdViewshedFactory, ILcdStatusSource

public class TLcdTerrainViewshedFactory extends Object implements ILcdViewshedFactory, ILcdStatusSource

Creates viewsheds for terrain models.

Since:
11.0
  • Constructor Details

    • TLcdTerrainViewshedFactory

      public TLcdTerrainViewshedFactory(ILcdGeoReference aViewshedReference, ALcdViewshedObserver aViewshedObserver, double aStepSize)
      Creates a new terrain viewshed factory that samples terrain for a given step size.
      Parameters:
      aViewshedReference - the reference of the generated viewsheds
      aViewshedObserver - A viewshed observer
      aStepSize - A step size in the reference of the terrain. The step size should be defined in the reference of the given height providers.
  • Method Details

    • removeStatusListener

      public void removeStatusListener(ILcdStatusListener aStatusListener)
      Terminates notifying a listener of the progress of creation of a viewshed
      Specified by:
      removeStatusListener in interface ILcdStatusSource
      Parameters:
      aStatusListener - will no longer be notified of progress of creation of the viewshed
      See Also:
    • addStatusListener

      public void addStatusListener(ILcdStatusListener aStatusListener)
      Starts notifying a listener with the progress of creation of a viewshed
      Specified by:
      addStatusListener in interface ILcdStatusSource
      Parameters:
      aStatusListener - will be notified of progress of creation of the viewshed
      See Also:
    • getStepSize

      public double getStepSize()
      Gets the step size in which terrain is sampled, expressed in the reference of the terrain.
      Returns:
      the step size in which terrain is sampled, expressed in the reference of the terrain.
    • setStepSize

      public void setStepSize(double aPixelDensity)
      Sets the step size in which terrain should be sampled, expressed in the reference of the terrain.
      Parameters:
      aPixelDensity - the step size in which terrain should be sampled, expressed in the reference of the terrain.
    • getSamplingBounds

      public ILcdBounds getSamplingBounds()

      Returns the bounds in which terrain is sampled, expressed in the reference of the height provider.

      By default this value is null, which means this factory will use the bounds of the given height providers for sampling.

      Returns:
      null if no sampling bounds
      See Also:
    • setSamplingBounds

      public void setSamplingBounds(ILcdBounds aSamplingBounds)

      Sets the sampling bounds for this terrain viewshed factory. The bounds must be given in the reference of the height providers given to the createViewshed(Object, com.luciad.transformation.ILcdModelModelTransformation) methods.

      This method acts as an override function. If set to null, no bounds will be overridden, and this object will create viewsheds based on the bounds of the given height providers.

      Parameters:
      aSamplingBounds - A bounds
    • createViewshed

      public ILcdViewshed createViewshed(ILcdHeightProvider aHeightProvider, ILcdBounds aBounds, ILcdModelModelTransformation aModelModelTransformation)
      Creates a viewshed for a given height provider within a given bounds. The height provider will be sampled in the set step size, which is set using setStepSize(double)) or at construction.
      Parameters:
      aHeightProvider - A height provider
      aBounds - The bounds in which terrain should be sampled for the viewshed, given in the source reference of aModelModelTransformation.
      aModelModelTransformation - A transformation that has its source reference set to the reference in which aHeightProvider can be sampled, and its destination reference set to the desired reference of the resulting viewshed.
      Returns:
      A viewshed for the given height provider, created for the object within the given bounds, in the reference that is the destination reference of aModelModelTransformation
    • createViewshed

      public ILcdViewshed createViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation)

      Creates a viewshed for a given object.

      If the given object is ILcdBounded, and no specific sampling bounds have been set by setSamplingBounds(com.luciad.shape.ILcdBounds), then these bounds returned by this ILcdBounded object will be used to sample the terrain.

      If getSamplingBounds() is not null, then the value of getSamplingBounds() will be used instead.

      Specified by:
      createViewshed in interface ILcdViewshedFactory
      Parameters:
      aObject - The object for which a viewshed will be created.
      aModelModelTransformation - The transformation that transforms the domain object to the reference in which the viewshed should be defined. The source reference should be the reference of aObject and aModel. The destination reference is the desired reference of the viewshed.
      Returns:
      A viewshed for the given height provider, created for the object within the given bounds, in the reference that is the destination reference of aModelModelTransformation
    • canCreateViewshed

      public boolean canCreateViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation)
      Checks if the given object is a height provider.
      Specified by:
      canCreateViewshed in interface ILcdViewshedFactory
      Parameters:
      aObject - The object to check.
      aModelModelTransformation - The transformation that transforms the domain object to the reference in which the viewshed should be defined. The source reference should be the reference of aObject and aModel. The destination reference is the desired reference of the viewshed.
      Returns:
      true if aObject is a height provider; false otherwise.