Class LineOfSightFeature.Builder

java.lang.Object
com.luciad.models.los.LineOfSightFeature.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
LineOfSightFeature

public static final class LineOfSightFeature.Builder extends Object implements AutoCloseable
Allows the incremental creation of a line-of-sight Feature object.

Make sure to configure the id() before finishing the Feature using build().

Otherwise a java.lang.IllegalStateException will be thrown.

Since:
2025.0
  • Constructor Details

  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • build

      @NotNull public Feature build() throws IllegalArgumentException, IllegalStateException
      Build the line-of-sight feature using the configured settings.

      After this method is invoked once, this builder can no longer be used.

      Returns:
      the feature
      Throws:
      IllegalStateException - If not all mandatory parameters are set.
      IllegalArgumentException - if minimumVerticalAngle is larger than maximumVerticalAngle
    • id

      @NotNull public LineOfSightFeature.Builder id(long id)
      Configures the id of the line-of-sight feature being built.

      A feature id should be unique across a model.

      Calling this function is mandatory.

      Parameters:
      id - the id
      Returns:
      this builder
    • center

      @NotNull public LineOfSightFeature.Builder center(@NotNull Point center)
      Configures the center of the line-of-sight feature being built.

      This is the observer location. Note that this property does not define the height above the terrain of the observer. That is explicitly defined by centerHeight.

      Calling this function is mandatory.

      Parameters:
      center - the center
      Returns:
      this builder
    • centerHeight

      @NotNull public LineOfSightFeature.Builder centerHeight(double centerHeight)
      Configures the center height of the line-of-sight feature being built.

      This is the height above the terrain, in meters, of the observer in the center.

      Calling this function is optional. The default is 1.

      Parameters:
      centerHeight - the center height
      Returns:
      this builder
    • radius

      @NotNull public LineOfSightFeature.Builder radius(double radius)
      Configures the radius of the line-of-sight feature being built.

      This is the radius, in meters, of the area in which the line-of-sight visibility will be visualized. Together with startAngle and endAngle, this defines the area in which the line-of-sight visibility will be visualized.

      Note that radius refers to horizontal distance. Vertical travel distance is not taken into account.

      Calling this function is mandatory.

      Parameters:
      radius - the radius
      Returns:
      this builder
    • startAngle

      @NotNull public LineOfSightFeature.Builder startAngle(@NotNull Angle startAngle)
      Configures the start angle of the line-of-sight feature being built.

      This is an angle measured clockwise with respect to the north direction. It helps define the span over which the line-of-sight visibility will be visualized. Together with endAngle and radius, this defines the area in which the line-of-sight visibility will be visualized. The line-of-sight coverage goes from the start angle to the end angle in clockwise direction.

      Calling this function is optional. The default is an angle of 0 degrees.

      Parameters:
      startAngle - the start angle
      Returns:
      this builder
    • endAngle

      @NotNull public LineOfSightFeature.Builder endAngle(@NotNull Angle endAngle)
      Configures the end angle of the line-of-sight feature being built.

      This is an angle measured clockwise with respect to the north direction. It helps define the span over which the line-of-sight visibility will be visualized. Together with startAngle and radius, this defines the area in which the line-of-sight visibility will be visualized. The line-of-sight coverage goes from the start angle to the end angle in clockwise direction.

      Calling this function is optional. The default is an angle of 360 degrees.

      Parameters:
      endAngle - the end angle
      Returns:
      this builder
    • minimumVerticalAngle

      @NotNull public LineOfSightFeature.Builder minimumVerticalAngle(@NotNull Angle minimumVerticalAngle)
      Configures the minimum vertical angle of the line-of-sight feature being built.

      Some observers cannot see directly below or directly above, there is a so-called cone of silence where there is no visibility possible. Together with maximumVerticalAngle, this angle defines the area between these angles where visibility is possible. The angle starts from 0, pointing towards the ground, to 180 at zenith.

      Calling this function is optional. The default is an angle of 0 degrees.

      Parameters:
      minimumVerticalAngle - the minimum vertical angle
      Returns:
      this builder
    • maximumVerticalAngle

      @NotNull public LineOfSightFeature.Builder maximumVerticalAngle(@NotNull Angle maximumVerticalAngle)
      Configures the maximum vertical angle of the line-of-sight feature being built.

      Some observers cannot see directly below or directly above, there is a so-called cone of silence where there is no visibility possible. Together with minimumVerticalAngle, this angle defines the area between these angles where visibility is possible. The angle starts from 0, pointing towards the ground, to 180 at zenith.

      Calling this function is optional. The default is an angle of 180 degrees.

      Parameters:
      maximumVerticalAngle - the maximum vertical angle
      Returns:
      this builder