public class ElevationMask extends BaseCollection<ElevationRise> implements IEquatable<ElevationMask>
AzimuthElevationMask
.
This class defines how the view is obscured in a particular direction.Constructor and Description |
---|
ElevationMask()
Initializes a new instance.
|
ElevationMask(double azimuth,
double elevation)
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Indicates whether another object is exactly equal to this instance.
|
boolean |
equalsType(ElevationMask other)
Indicates whether another instance of this type is exactly equal to this instance.
|
static ArrayList<ElevationMask> |
fromTerrain(TerrainProvider provider,
double minimumTerrainHeight,
double maximumTerrainHeight,
Cartographic observerPosition,
double stepSize,
double maximumSearchAngle,
double[] azimuths,
boolean multithreadComputations)
Computes elevation masks from the specified terrain provider along the provided azimuths.
|
static ArrayList<ElevationMask> |
fromTerrain(TerrainProvider provider,
double minimumTerrainHeight,
double maximumTerrainHeight,
Cartographic observerPosition,
double stepSize,
double maximumSearchAngle,
double[] azimuths,
boolean multithreadComputations,
ITrackCalculationProgress tracker)
Computes elevation masks from the specified terrain provider along the provided azimuths with progress tracking.
|
double |
getAzimuth()
Gets the azimuth of the ray, in radians.
|
double |
getElevation()
Gets the maximum obscured elevation angle along the ray, in radians.
|
int |
hashCode()
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
|
void |
setAzimuth(double value)
Sets the azimuth of the ray, in radians.
|
void |
setElevation(double value)
Sets the maximum obscured elevation angle along the ray, in radians.
|
add, add, addAll, addAll, clear, clearItems, contains, containsAll, get, getItems, indexOf, insertItem, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeItem, retainAll, set, setItem, size, subList, toArray, toArray
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
replaceAll, sort, spliterator
parallelStream, removeIf, stream
public ElevationMask()
public ElevationMask(double azimuth, double elevation)
azimuth
- The azimuth of the ray, in radians.elevation
- The maximum obscured elevation along the ray, in radians.public final double getAzimuth()
public final void setAzimuth(double value)
public final double getElevation()
public final void setElevation(double value)
public boolean equals(Object obj)
equals
in interface Collection<ElevationRise>
equals
in interface List<ElevationRise>
equals
in class Object
obj
- The object to compare to this instance.true
if obj
is an instance of this type and represents the same value as this instance; otherwise false
.Object.hashCode()
,
HashMap
public final boolean equalsType(ElevationMask other)
equalsType
in interface IEquatable<ElevationMask>
other
- The instance to compare to this instance.true
if other
represents the same value as this instance; otherwise false
.public int hashCode()
hashCode
in interface Collection<ElevationRise>
hashCode
in interface List<ElevationRise>
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public static ArrayList<ElevationMask> fromTerrain(TerrainProvider provider, double minimumTerrainHeight, double maximumTerrainHeight, @Nonnull Cartographic observerPosition, double stepSize, double maximumSearchAngle, double[] azimuths, boolean multithreadComputations)
This method works by casting a ray out from the observerPosition
along a specified direction to
determine the minimum elevation angle that is visible above the terrain in that direction. More specifically,
the various distances at which the minimum elevation angle increases in that direction are determined.
stepSize
is the distance between steps along the ray, in radians. A reasonable value for this
parameter would sample approximately three times per terrain grid cell.
maximumSearchAngle
is the maximum angle, in radians, to move along each ray. In other words,
this parameter indicates the stopping point for sampling along the ray. A reasonable value will take into account
the difference between the maximum and minimum heights of terrain provided by provider
and
potentially how close together the minimum and maximum heights are located.
The following example shows one way this value might be chosen:
double approximateHeightOfMtEverest = 8850.0;
double semimajorAxisLength = WorldGeodeticSystem1984.getShape().getSemimajorAxisLength();
double maximumSearchAngle = Math.acos(semimajorAxisLength / (semimajorAxisLength + approximateHeightOfMtEverest));
provider
- The source of terrain from which to compute the masks.minimumTerrainHeight
- The minimum height in meters that can be returned by the
TerrainProvider's
TerrainProvider.getHeightRelativeToShape(double, double)
method.
Setting this value lower than necessary will not affect the results, but it will decrease
performance. Setting it too high can cause incorrect results.maximumTerrainHeight
- The maximum height in meters that can be returned by the
TerrainProvider's
TerrainProvider.getHeightRelativeToShape(double, double)
method.
Setting this value higher than necessary will not affect the results, but it will decrease
performance. Setting it too low can cause incorrect results.observerPosition
- The planetodetic position of the stationary observer at which the masks are computed.stepSize
- The size of the step along each azimuth ray, in radians.maximumSearchAngle
- The maximum angle, in radians, to move along each azimuth ray in constructing the masks.azimuths
- The azimuths, in radians, along which to compute the elevation masks.multithreadComputations
- Indicates whether the computations should be multithreaded.azimuths
.ArgumentNullException
- Thrown if provider
is null
.ArgumentOutOfRangeException
- Thrown if azimuths
is less than or equal to zero.public static ArrayList<ElevationMask> fromTerrain(TerrainProvider provider, double minimumTerrainHeight, double maximumTerrainHeight, @Nonnull Cartographic observerPosition, double stepSize, double maximumSearchAngle, double[] azimuths, boolean multithreadComputations, @Nullable ITrackCalculationProgress tracker)
This method works by casting a ray out from the observerPosition
along a specified direction to
determine the minimum elevation angle that is visible above the terrain in that direction. More specifically,
the various distances at which the minimum elevation angle increases in that direction are determined.
stepSize
is the distance between steps along the ray, in radians. A reasonable value for this
parameter would sample approximately three times per terrain grid cell.
maximumSearchAngle
is the maximum angle, in radians, to move along each ray. In other words,
this parameter indicates the stopping point for sampling along the ray. A reasonable value will take into account
the difference between the maximum and minimum heights of terrain provided by provider
and
potentially how close together the minimum and maximum heights are located.
The following example shows one way this value might be chosen:
double approximateHeightOfMtEverest = 8850.0;
double semimajorAxisLength = WorldGeodeticSystem1984.getShape().getSemimajorAxisLength();
double maximumSearchAngle = Math.acos(semimajorAxisLength / (semimajorAxisLength + approximateHeightOfMtEverest));
provider
- The source of terrain from which to compute the masks.minimumTerrainHeight
- The minimum height in meters that can be returned by the
TerrainProvider's
TerrainProvider.getHeightRelativeToShape(double, double)
method.
Setting this value lower than necessary will not affect the results, but it will decrease
performance. Setting it too high can cause incorrect results.maximumTerrainHeight
- The maximum height in meters that can be returned by the
TerrainProvider's
TerrainProvider.getHeightRelativeToShape(double, double)
method.
Setting this value higher than necessary will not affect the results, but it will decrease
performance. Setting it too low can cause incorrect results.observerPosition
- The planetodetic position of the stationary observer at which the masks are computed.stepSize
- The size of the step along each azimuth ray, in radians.maximumSearchAngle
- The maximum angle, in radians, to move along each azimuth ray in constructing the masks.azimuths
- The azimuths, in radians, along which to compute the elevation masks.multithreadComputations
- Indicates whether the computations should be multithreaded.tracker
- The object to which progress is reported and that is able to cancel this operation before it is complete, or null
.
When reporting progress, the 'additionalInformation' parameter to ITrackCalculationProgress.reportProgress(int, java.lang.Object)
will be null
.azimuths
.ArgumentNullException
- Thrown if provider
is null
.ArgumentOutOfRangeException
- Thrown if azimuths
is less than or equal to zero.