Class TLcdPolygonViewshedFactory

java.lang.Object
com.luciad.tea.viewshed.TLcdPolygonViewshedFactory
All Implemented Interfaces:
ILcdViewshedFactory

public class TLcdPolygonViewshedFactory extends Object implements ILcdViewshedFactory

A viewshed factory that can create viewsheds for planar polygons (i.e. polygons which have points that are part of the same, arbitrary 3D plane).

To create a viewshed, either use the methods defined in ILcdViewshedFactory, or directly call the createViewshed(com.luciad.shape.ILcdPolygon, com.luciad.transformation.ILcdModelModelTransformation) method.

The setCullBackfaces(boolean) method can be used to automatically cull polygons that are not facing the observer. See the javadoc of the method for more details.

Since:
11.0
See Also:
  • setCullBackfaces(boolean)
  • createViewshed(com.luciad.shape.ILcdPolygon, com.luciad.transformation.ILcdModelModelTransformation)
  • Constructor Details

    • TLcdPolygonViewshedFactory

      public TLcdPolygonViewshedFactory(ILcdGeoReference aViewshedReference, ALcdViewshedObserver aViewshedObserver)
      Parameters:
      aViewshedReference - The viewshed reference that should be used by this factory. All generated viewsheds will use this reference.
      aViewshedObserver - The viewshed observer for this viewshed.
  • Method Details

    • getViewshedObserver

      public ALcdViewshedObserver getViewshedObserver()
      Returns the viewshed observer for this TLcdBoundedCompositeViewshed.
      Returns:
      A viewshed observer.
    • isCullBackfaces

      public boolean isCullBackfaces()

      Check whether this implementation culls back-faces.

      Returns:
      true if this implementation culls back-faces; false otherwise.
      See Also:
    • setCullBackfaces

      public void setCullBackfaces(boolean aCullBackfaces)

      If true, this implementation will cull polygons that are back-facing by having this factory return null for back-facing polygons instead of ILcdViewshed instances.

      A polygon is back-facing if the polygon appears to be counter-clockwise when viewed from the observer.

      Parameters:
      aCullBackfaces - true if this implementation should cull back faces; false otherwise.
      See Also:
    • createViewshed

      public ILcdViewshed createViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation)

      Creates a viewshed for the given ILcdPolygon.

      The arguments for this method should return true for the ILcdViewshedFactory.canCreateViewshed(Object, com.luciad.transformation.ILcdModelModelTransformation) method.

      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. This should be a cartesian reference such as ILcdGeocentricReference.
      Returns:
      A viewshed representation of aObject, for the observer given by getViewshedObserver() and in the destination reference of aModelModelTransformation.
    • canCreateViewshed

      public boolean canCreateViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation)
      Checks if this TLcdPolygonViewshedFactory can handle the given object.
      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. This should be a cartesian reference such as ILcdGeocentricReference.
      Returns:
      true if the given aObject is an instance of ILcdPolygon, and all its points lie in a single plane.