Class LineOfSightFeature.Builder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
LineOfSightFeature
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the line-of-sight feature using the configured settings.Configures the center of the line-of-sight feature being built.centerHeight
(double centerHeight) Configures the center height of the line-of-sight feature being built.void
close()
Configures the end angle of the line-of-sight feature being built.protected void
finalize()
id
(long id) Configures the id of the line-of-sight feature being built.maximumVerticalAngle
(Angle maximumVerticalAngle) Configures the maximum vertical angle of the line-of-sight feature being built.minimumVerticalAngle
(Angle minimumVerticalAngle) Configures the minimum vertical angle of the line-of-sight feature being built.radius
(double radius) Configures the radius of the line-of-sight feature being built.startAngle
(Angle startAngle) Configures the start angle of the line-of-sight feature being built.
-
Constructor Details
-
Builder
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
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
- ifminimumVerticalAngle
is larger thanmaximumVerticalAngle
-
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
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
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
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
andendAngle
, 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
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
andradius
, 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
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
andradius
, 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
-