public final class CompositeTerrainProvider extends TerrainProvider implements List<TerrainProvider>
Shape
(get
/ set
) and
ShapeFixedFrame
(get
/ set
) properties.Constructor and Description |
---|
CompositeTerrainProvider()
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
TerrainProvider item)
Inserts an element into the
CompositeTerrainProvider
at the given index. |
boolean |
add(TerrainProvider item)
Adds an item.
|
boolean |
addAll(Collection<? extends TerrainProvider> c)
Appends all of the elements in the specified collection to the end of
this list, in the order that they are returned by the specified
collection's iterator (optional operation).
|
boolean |
addAll(int index,
Collection<? extends TerrainProvider> c)
Inserts all of the elements in the specified collection into this
list at the specified position (optional operation).
|
void |
clear()
Removes all of the items
|
boolean |
contains(Object item)
Determines whether an item is in the
CompositeTerrainProvider list. |
boolean |
containsAll(Collection<?> c)
Returns true if this list contains all of the elements of the
specified collection.
|
TerrainProvider |
get(int index)
Gets the
TerrainProvider at the specified index. |
FirstPartialsOfHeight |
getFirstPartials(double longitude,
double latitude)
|
double |
getHeight(double longitude,
double latitude)
Gets the interpolated height of the terrain at the specified longitude and latitude using the
default interpolator for this terrain provider.
|
double |
getHeight(double longitude,
double latitude,
RasterTerrainInterpolator interpolator)
Gets the interpolated height of the terrain at the specified longitude and latitude
using the given interpolator.
|
double |
getHeightNativeUnits(double longitude,
double latitude)
Gets the interpolated height of the terrain at the specified longitude and latitude.
|
double |
getHeightNativeUnits(double longitude,
double latitude,
RasterTerrainInterpolator interpolator)
Gets the interpolated height of the terrain at the specified longitude and latitude.
|
double |
getLocalMinimumSampleSpacing(double longitude,
double latitude)
Gets the smallest distance between the successive height samples of the terrain data, in radians, at the specified coordinates.
|
double |
getMinimumSampleSpacing()
Gets the smallest distance between the successive height samples of the terrain data, in radians.
|
SecondPartialsOfHeight |
getSecondPartials(double longitude,
double latitude)
|
int |
indexOf(Object item)
Returns the index of the provided item.
|
boolean |
isEmpty()
Returns true if this list contains no elements.
|
Iterator<TerrainProvider> |
iterator()
Gets the enumerator.
|
int |
lastIndexOf(Object o)
Returns the index of the last occurrence of the specified element
in this list, or -1 if this list does not contain the element.
|
ListIterator<TerrainProvider> |
listIterator()
Returns a list iterator over the elements in this list (in proper
sequence).
|
ListIterator<TerrainProvider> |
listIterator(int index)
Returns a list iterator over the elements in this list (in proper
sequence), starting at the specified position in the list.
|
void |
preloadExtent(CartographicExtent extent)
Loads the terrain data in a given
CartographicExtent into the terrain cache. |
TerrainProvider |
remove(int index)
Removes the element at the given index of the
CompositeTerrainProvider . |
boolean |
remove(Object item)
Removes the specified item.
|
boolean |
removeAll(Collection<?> c)
Removes from this list all of its elements that are contained in the
specified collection (optional operation).
|
boolean |
retainAll(Collection<?> c)
Retains only the elements in this list that are contained in the
specified collection (optional operation).
|
TerrainProvider |
set(int index,
TerrainProvider value)
Sets the
TerrainProvider at the specified index. |
int |
size()
Gets the number of items.
|
List<TerrainProvider> |
subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
Object[] |
toArray()
Returns an array containing all of the elements in this list in proper
sequence (from first to last element).
|
<T> T[] |
toArray(T[] a)
Returns an array containing all of the elements in this list in
proper sequence (from first to last element); the runtime type of
the returned array is that of the specified array.
|
void |
unloadExtent(CartographicExtent extent)
Unloads the cached terrain data for a given
CartographicExtent . |
getBoundingExtent, getBoundingExtentNativeUnits, getGradient, getHeightReference, getHeightRelativeToShape, getHessian, getNativeToMeters, getNormal, getRadiansToNative, getReferenceSurface, getShape, getShapeFixedFrame, inGlobalBounds, setBoundingExtent, setBoundingExtentNativeUnits, setHeightReference, setNativeToMeters, setRadiansToNative, setReferenceSurface, setShape, setShapeFixedFrame
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, replaceAll, sort, spliterator
parallelStream, removeIf, stream
public CompositeTerrainProvider()
public double getHeight(double longitude, double latitude)
If HeightReference
(get
/ set
) is HeightReference.REFERENCE_SURFACE
,
the returned height is relative to the surface specified by the ReferenceSurface
(get
/ set
) property.
If HeightReference
(get
/ set
) is HeightReference.SHAPE
,
the returned height is relative to the ellipsoid specified by the Shape
(get
/ set
) property.
This method may return Double.NaN
if the requested longitude and latitude are outside
the terrain region or if the terrain data indicates that the height is unknown.
It is safe to call this method from multiple threads simultaneously.
getHeight
in class TerrainProvider
longitude
- The longitude, in radians.
Requesting a height for a longitude less than -π or greater than π will always return Double.NaN
.latitude
- The latitude, in radians.
Requesting a height for a latitude less than -π/2 or greater than π/2 will always return Double.NaN
.Double.NaN
if the height is not available at the requested longitude and latitude.public final double getHeight(double longitude, double latitude, RasterTerrainInterpolator interpolator)
For a TerrainProvider
that is not a derivation of a RasterTerrainProvider
,
the interpolator parameter is ignored.
longitude
- The longitude, in radians.latitude
- The latitude, in radians.interpolator
- The interpolator to use to interpolate heights for points that do not fall precisely on a post.Double.NaN
if the height is not available at the requested longitude and latitude.public double getHeightNativeUnits(double longitude, double latitude)
If HeightReference
(get
/ set
) is HeightReference.REFERENCE_SURFACE
,
the returned height is relative to the surface specified by the ReferenceSurface
(get
/ set
) property.
If HeightReference
(get
/ set
) is HeightReference.SHAPE
,
the returned height is relative to the ellipsoid specified by the Shape
(get
/ set
) property.
This method may return Double.NaN
if the requested longitude and latitude are outside
the terrain region or if the terrain data indicates that the height is unknown.
It is safe to call this method from multiple threads simultaneously.
getHeightNativeUnits
in class TerrainProvider
longitude
- The longitude, in the native units of the terrain provider.latitude
- The latitude, in the native units of the terrain provider.Double.NaN
if the height is not available at the requested longitude and latitude.public final double getHeightNativeUnits(double longitude, double latitude, RasterTerrainInterpolator interpolator)
longitude
- The longitude, in the native units of the terrain provider.latitude
- The latitude, in the native units of the terrain provider.interpolator
- The interpolator to use to interpolate heights for points that do not fall precisely on a post.Double.NaN
if the height is not available at the requested longitude and latitude.public void preloadExtent(CartographicExtent extent)
CartographicExtent
into the terrain cache.
This method does not return until the terrain data is fully loaded. All terrain data within the extent is loaded into
memory, even if doing so would exceed the TerrainCacheGroup's
MaximumSize
(get
/ set
). Furthermore, the loaded terrain data is locked
in memory (meaning it will not be unloaded) until the user calls CompositeTerrainProvider.unloadExtent(agi.foundation.coordinates.CartographicExtent)
.
This method is safe to call from any thread.preloadExtent
in class TerrainProvider
extent
- The extent for which to load terrain data, in radians.ArgumentNullException
- Thrown when extent
is null
.public void unloadExtent(CartographicExtent extent)
CartographicExtent
.
This method unloads all cached regions where any part of the region falls within
the extent. It does not return until the regions have been unloaded. However,
if a region within the extent is being used in another thread while this method
is executing, the region may be reloaded immediately after this method unloads it.
This method is safe to call from any thread.unloadExtent
in class TerrainProvider
extent
- The CartographicExtent
for which to unload terrain, in radians.ArgumentNullException
- Thrown when extent
is null
.@Nonnull public FirstPartialsOfHeight getFirstPartials(double longitude, double latitude)
Shape
(get
/ set
).getFirstPartials
in class TerrainProvider
longitude
- The longitude, in radians.
Requesting derivatives for a longitude less than -π or greater than π will always return Double.NaN
.latitude
- The latitude, in radians.
Requesting derivatives for a latitude less than -π/2 or greater than π/2 will always return Double.NaN
.FirstPartialsOfHeight
with respect to longitude and latitude,
in meters of height per radian.@Nonnull public SecondPartialsOfHeight getSecondPartials(double longitude, double latitude)
Shape
(get
/ set
).getSecondPartials
in class TerrainProvider
longitude
- The longitude, in radians.
Requesting derivatives for a longitude less than -π or greater than π will always return Double.NaN
.latitude
- The latitude, in radians.
Requesting derivatives for a latitude less than -π/2 or greater than π/2 will always return Double.NaN
.SecondPartialsOfHeight
with respect to longitude and latitude,
in meters of height per radian squared.public double getMinimumSampleSpacing()
getMinimumSampleSpacing
in class TerrainProvider
public double getLocalMinimumSampleSpacing(double longitude, double latitude)
getLocalMinimumSampleSpacing
in class TerrainProvider
longitude
- The longitude, in radians.latitude
- The latitude, in radians.public final int indexOf(Object item)
indexOf
in interface List<TerrainProvider>
item
- Item that is being indexedpublic final void add(int index, @Nonnull TerrainProvider item)
CompositeTerrainProvider
at the given index.add
in interface List<TerrainProvider>
index
- The index, based at zero, to where the item is to be inserteditem
- The specific object that is being inserted (Value can be null for reference types).ArgumentNullException
- Thrown when item
is null
.ArgumentException
- Thrown when item
already exists in this composite,
or when item
has a different
Shape
(get
/ set
) or ShapeFixedFrame
(get
/ set
)
than this composite.public final TerrainProvider remove(int index)
CompositeTerrainProvider
.remove
in interface List<TerrainProvider>
index
- The index, based at zero, to where the item is to be removed.public final TerrainProvider get(int index)
TerrainProvider
at the specified index.get
in interface List<TerrainProvider>
index
- The index.public final TerrainProvider set(int index, TerrainProvider value)
TerrainProvider
at the specified index.set
in interface List<TerrainProvider>
index
- The index.value
- element to be stored at the specified positionpublic final boolean add(@Nonnull TerrainProvider item)
add
in interface Collection<TerrainProvider>
add
in interface List<TerrainProvider>
item
- Item that is to be added.Collection.add(E)
)ArgumentNullException
- Thrown when item
is null
.ArgumentException
- Thrown when item
already exists in this composite,
or when item
has a different
Shape
(get
/ set
) or ShapeFixedFrame
(get
/ set
)
than this composite.public final void clear()
clear
in interface Collection<TerrainProvider>
clear
in interface List<TerrainProvider>
public final boolean contains(Object item)
CompositeTerrainProvider
list.contains
in interface Collection<TerrainProvider>
contains
in interface List<TerrainProvider>
item
- Item that is being searched for.true
if the item is found; otherwise false
.public final int size()
size
in interface Collection<TerrainProvider>
size
in interface List<TerrainProvider>
public final boolean remove(Object item)
remove
in interface Collection<TerrainProvider>
remove
in interface List<TerrainProvider>
item
- The item to remove.true
if item
is removed; otherwise false
.public final Iterator<TerrainProvider> iterator()
iterator
in interface Iterable<TerrainProvider>
iterator
in interface Collection<TerrainProvider>
iterator
in interface List<TerrainProvider>
public final boolean isEmpty()
java.util.List
isEmpty
in interface Collection<TerrainProvider>
isEmpty
in interface List<TerrainProvider>
public final boolean addAll(Collection<? extends TerrainProvider> c)
java.util.List
addAll
in interface Collection<TerrainProvider>
addAll
in interface List<TerrainProvider>
c
- collection containing elements to be added to this listList.add(Object)
public final boolean addAll(int index, Collection<? extends TerrainProvider> c)
java.util.List
addAll
in interface List<TerrainProvider>
index
- index at which to insert the first element from the
specified collectionc
- collection containing elements to be added to this listpublic final boolean containsAll(Collection<?> c)
java.util.List
containsAll
in interface Collection<TerrainProvider>
containsAll
in interface List<TerrainProvider>
c
- collection to be checked for containment in this listList.contains(Object)
public final Object[] toArray()
java.util.List
The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array even if this list is backed by an array). The caller is thus free to modify the returned array.
This method acts as bridge between array-based and collection-based APIs.
toArray
in interface Collection<TerrainProvider>
toArray
in interface List<TerrainProvider>
Arrays.asList(Object[])
public final <T> T[] toArray(T[] a)
java.util.List
If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the list is set to null. (This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.)
Like the List.toArray()
method, this method acts as bridge between
array-based and collection-based APIs. Further, this method allows
precise control over the runtime type of the output array, and may,
under certain circumstances, be used to save allocation costs.
Suppose x is a list known to contain only strings. The following code can be used to dump the list into a newly allocated array of String:
String[] y = x.toArray(new String[0]);
Note that toArray(new Object[0]) is identical in function to
toArray().toArray
in interface Collection<TerrainProvider>
toArray
in interface List<TerrainProvider>
T
- the runtime type of the array to contain the collectiona
- the array into which the elements of this list are to
be stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose.public final int lastIndexOf(Object o)
java.util.List
lastIndexOf
in interface List<TerrainProvider>
o
- element to search forpublic final ListIterator<TerrainProvider> listIterator()
java.util.List
listIterator
in interface List<TerrainProvider>
public final ListIterator<TerrainProvider> listIterator(int index)
java.util.List
next
.
An initial call to previous
would
return the element with the specified index minus one.listIterator
in interface List<TerrainProvider>
index
- index of the first element to be returned from the
list iterator (by a call to next
)public final List<TerrainProvider> subList(int fromIndex, int toIndex)
java.util.List
This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:
list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and
lastIndexOf, and all of the algorithms in the
Collections class can be applied to a subList.The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)
subList
in interface List<TerrainProvider>
fromIndex
- low endpoint (inclusive) of the subListtoIndex
- high endpoint (exclusive) of the subListpublic final boolean removeAll(Collection<?> c)
java.util.List
removeAll
in interface Collection<TerrainProvider>
removeAll
in interface List<TerrainProvider>
c
- collection containing elements to be removed from this listList.remove(Object)
,
List.contains(Object)
public final boolean retainAll(Collection<?> c)
java.util.List
retainAll
in interface Collection<TerrainProvider>
retainAll
in interface List<TerrainProvider>
c
- collection containing elements to be retained in this listList.remove(Object)
,
List.contains(Object)