Class TLcyLOSManager

java.lang.Object
com.luciad.lucy.addons.tea.lineofsight.TLcyLOSManager
All Implemented Interfaces:
ILcdDisposable, AutoCloseable

public class TLcyLOSManager extends Object implements ILcdDisposable

The LOS (line-of-sight) manager allows you to create, remove, and configure LOS coverages on Lightspeed maps in Lucy.

You have access to the TLcyLOSManager through the Lucy service mechanism. You can request a LOS manager with:

    TLcyLOSManager losManager = aLucyEnv.getService(TLcyLOSManager.class);

Because LOS coverages are displayed around point objects, the LOS manager allows you to validate first if a domain object is suitable for the addition of a LOS coverage.

When you create a LOS coverage, the ensuing LOS computation results in a TLcyLOSDomainObject. All LOS coverage objects are added to a Line-of-sight layer with its dedicated model. This layer and model are automatically added to and removed from the view.

To change the properties used for the LOS calculation, you need to get the LOS model with getLOSModel(TLcyLOSDomainObject) first, and access the LOS properties from there.

See this article for more information about the use of the TLcyLOSManager.

Note that all changes to the LOS manager must originate from the Event Dispatch Thread (EDT). You must also take a lock on the LOS model if you want to change the LOS calculation properties.

Since:
2019.1
  • Method Details

    • getLOSModel

      public ILcdModel getLOSModel(TLcyLOSDomainObject aLOSDomainObject)
      Gets the LOS model for an existing LOS domain object. This is useful for taking a lock on the LOS model before reading from or writing to the LOS domain object.
      Parameters:
      aLOSDomainObject - the LOS domain object to find.
      Returns:
      the LOS model or null when the LOS domain object is no longer registered. (e.g. after it was removed).
    • addLOSCoverage

      public TLcyLOSDomainObject addLOSCoverage(TLcdDomainObjectContext aDomainObjectContext) throws IllegalArgumentException

      Adds a LOS coverage for a specific domain object. If there is no LOS layer yet for the given view, it will be created along with its LOS model.

      If the domain object context doesn't support LOS Coverages, an IllegalArgumentException gets thrown. Verify this with canAddLOSCoverageFor(TLcdDomainObjectContext).

      Parameters:
      aDomainObjectContext - the context with the domain object.
      Returns:
      the new LOS coverage data domain object.
      Throws:
      IllegalArgumentException - if the domain object context doesn't support LOS coverages.
    • removeLOSCoverage

      public void removeLOSCoverage(TLcdDomainObjectContext aDomainObjectContext)
      Remove the LOS coverage for a specific domain object. If there was no coverage yet for the specified domain object, no action will be taken.
      Parameters:
      aDomainObjectContext - the context with the domain object.
    • dispose

      public void dispose()
      Description copied from interface: ILcdDisposable

      Disposes of this object and allows it to release any system resources that it is holding.

      The result of calling any other method (other than finalize) on this object subsequent to a call to this method is undefined.

      Specified by:
      dispose in interface ILcdDisposable
    • canAddLOSCoverageFor

      public boolean canAddLOSCoverageFor(TLcdDomainObjectContext aContext)
      Verify if a domain object context can be used for a LOS coverage. Domain objects that are an ILcdPoint, or a ILcdPointList containing a single point, are supported.
      Parameters:
      aContext - the context with the domain object.
      Returns:
      whether or not the domain object can have a LOS coverage.