Class TerrainIntersections
- java.lang.Object
-
- gov.nasa.worldwindx.examples.ApplicationTemplate
-
- gov.nasa.worldwindx.examples.TerrainIntersections
-
public class TerrainIntersections extends ApplicationTemplate
Shows how to compute terrain intersections using the highest resolution terrain data available from a globe's elevation model.To generate and show intersections, Shift + LeftClick anywhere on the globe. The program forms a grid of locations around the selected location. The grid points are shown in yellow. It then determines whether a line between the selected location and each grid point intersects the terrain. If it does, the intersection nearest the selected location is shown in cyan and a line is drawn from the selected location to the intersection. If there is no intersection, a line is drawn from the selected location to the grid position.
If the highest resolution terrain is not available for the area around the selected location, it is retrieved from the elevation model's source, which is most likely a remote server. Since the high-res data must be retrieved and then loaded from the local disk cache, it will take some time to compute and show the intersections.
This example uses a
Terrainobject to perform the terrain retrieval, generation and intersection calculations.s
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTerrainIntersections.AppFrame-
Nested classes/interfaces inherited from class gov.nasa.worldwindx.examples.ApplicationTemplate
ApplicationTemplate.AppPanel
-
-
Field Summary
Fields Modifier and Type Field Description protected static intGRID_DIMENSIONThe number of cells along each edge of the grid.protected static AngleGRID_RADIUSThe width and height in degrees of the grid used to calculate intersections.protected static intNUM_THREADSprotected static java.lang.DoubleTARGET_RESOLUTIONThe desired terrain resolution to use in the intersection calculations.
-
Constructor Summary
Constructors Constructor Description TerrainIntersections()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)-
Methods inherited from class gov.nasa.worldwindx.examples.ApplicationTemplate
insertAfterPlacenames, insertBeforeCompass, insertBeforeLayerName, insertBeforePlacenames, start
-
-
-
-
Field Detail
-
GRID_RADIUS
protected static final Angle GRID_RADIUS
The width and height in degrees of the grid used to calculate intersections.
-
GRID_DIMENSION
protected static final int GRID_DIMENSION
The number of cells along each edge of the grid.- See Also:
- Constant Field Values
-
TARGET_RESOLUTION
protected static final java.lang.Double TARGET_RESOLUTION
The desired terrain resolution to use in the intersection calculations.
-
NUM_THREADS
protected static final int NUM_THREADS
- See Also:
- Constant Field Values
-
-