public class FlatGlobe extends EllipsoidalGlobe implements Globe2D
geodeticToCartesian
cartesianToGeodetic
.
This globe uses a Cartesian coordinate system in the world plane is located at the origin and has UNIT-Z as normal. The Y axis points to the north pole. The Z axis points up. The X axis completes a right-handed coordinate system, and points east. Latitude and longitude zero are at the origin on y and x respectively. Sea level is at z = zero.
EllipsoidalGlobe.StateKey
Modifier and Type | Field and Description |
---|---|
protected boolean |
continuous |
protected int |
offset |
protected Vec4 |
offsetVector |
protected GeographicProjection |
projection |
static java.lang.String |
PROJECTION_LAT_LON
Latitude/Longitude
projection.
|
static java.lang.String |
PROJECTION_MERCATOR
Mercator projection.
|
static java.lang.String |
PROJECTION_MODIFIED_SINUSOIDAL |
static java.lang.String |
PROJECTION_SINUSOIDAL
Sinusoidal projection.
|
egm96, equatorialRadius, es, polarRadius
Constructor and Description |
---|
FlatGlobe(double equatorialRadius,
double polarRadius,
double es,
ElevationModel em)
Create a new globe.
|
Modifier and Type | Method and Description |
---|---|
protected Position |
cartesianToGeodetic(Vec4 cart)
Compute the geographic position to corresponds to a Cartesian point.
|
Vec4 |
computeNorthPointingTangentAtLocation(Angle latitude,
Angle longitude)
Computes a vector tangent to this globe and pointing toward the north pole.
|
Vec4 |
computeSurfaceNormalAtLocation(Angle latitude,
Angle longitude)
Returns the normal to the Globe at the specified position.
|
Vec4 |
computeSurfaceNormalAtPoint(Vec4 point)
Returns the normal to the Globe at the specified cartiesian point.
|
Matrix |
computeSurfaceOrientationAtPosition(Angle latitude,
Angle longitude,
double metersElevation)
Returns the cartesian transform matrix that maps model coordinates to a local coordinate system at (latitude,
longitude, metersElevation).
|
protected Vec4 |
geodeticToCartesian(Angle latitude,
Angle longitude,
double metersElevation)
Maps a position to a flat world Cartesian coordinates.
|
protected void |
geodeticToCartesian(Sector sector,
int numLat,
int numLon,
double[] metersElevation,
Vec4[] out)
Maps a grid of geographic positions to Cartesian coordinates.
|
double |
getElevation(Angle latitude,
Angle longitude)
Indicates the elevation at a specified location.
|
GlobeStateKey |
getGlobeStateKey()
Returns a typed state key identifying this globe's current configuration.
|
GlobeStateKey |
getGlobeStateKey(DrawContext dc)
Returns a typed state key identifying this globe's current configuration.
|
int |
getOffset() |
GeographicProjection |
getProjection()
Indicates the projection used to project the globe onto a plane.
|
java.lang.Object |
getStateKey(DrawContext dc)
Returns a state key identifying this globe's current configuration.
|
protected Intersection[] |
intersect(Line line,
double equRadius,
double polarRadius) |
boolean |
intersects(Frustum frustum)
Determines whether or not this
Extent intersects frustum . |
boolean |
intersects(Line line)
Determines whether or not
line intersects this Extent . |
boolean |
intersects(Plane plane)
Calculate whether or not this
Extent is intersected by plane . |
boolean |
isContinuous()
Indicates whether it makes sense to treat the associated projection as contiguous with itself.
|
boolean |
isPointAboveElevation(Vec4 point,
double elevation)
Determines whether a point is above a given elevation
|
void |
setContinuous(boolean continuous)
Specifies whether to treat the associated projection as contiguous with itself.
|
void |
setOffset(int offset)
Indicates an offset to apply to Cartesian points computed by this globe.
|
void |
setProjection(GeographicProjection projection)
Specifies the geographic projection for this globe.
|
applyEGMA96Offsets, computeEllipsoidalNormalAtLocation, computeEllipsoidalOrientationAtPosition, computeEllipsoidalPointFromLocation, computeEllipsoidalPointFromPosition, computeEllipsoidalPointFromPosition, computeModelCoordinateOriginTransform, computeModelCoordinateOriginTransform, computePointFromLocation, computePointFromPosition, computePointFromPosition, computePointFromPosition, computePointsFromPositions, computePositionFromEllipsoidalPoint, computePositionFromPoint, computeSurfaceOrientationAtPosition, ellipsoidalToGeodetic, geodeticToEllipsoidal, getCenter, getDiameter, getEccentricitySquared, getEffectiveRadius, getElevationModel, getElevations, getElevations, getEquatorialRadius, getExtent, getIntersectionPosition, getMaxElevation, getMaximumRadius, getMinAndMaxElevations, getMinAndMaxElevations, getMinElevation, getPolarRadius, getProjectedArea, getRadius, getRadiusAt, getRadiusAt, getTessellator, intersect, intersect, intersect, makeElevationModel, setElevationModel, setTessellator, tessellate
onMessage, propertyChange
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
protected boolean continuous
protected int offset
protected Vec4 offsetVector
protected GeographicProjection projection
public static final java.lang.String PROJECTION_LAT_LON
public static final java.lang.String PROJECTION_MERCATOR
public static final java.lang.String PROJECTION_MODIFIED_SINUSOIDAL
public static final java.lang.String PROJECTION_SINUSOIDAL
public FlatGlobe(double equatorialRadius, double polarRadius, double es, ElevationModel em)
setProjection(GeographicProjection)
.equatorialRadius
- Radius of the globe at the equator.polarRadius
- Radius of the globe at the poles.es
- Square of the globe's eccentricity.em
- Elevation model. May be null.protected Position cartesianToGeodetic(Vec4 cart)
EllipsoidalGlobe
cartesianToGeodetic
in class EllipsoidalGlobe
cart
- Cartesian point to convert to geographic.cart
.EllipsoidalGlobe.geodeticToCartesian(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle, double)
public Vec4 computeNorthPointingTangentAtLocation(Angle latitude, Angle longitude)
Globe
computeNorthPointingTangentAtLocation
in interface Globe
computeNorthPointingTangentAtLocation
in class EllipsoidalGlobe
latitude
- Latitude of the location at which to compute the tangent vector.longitude
- Longitude of the location at which to compute the tangent vector.public Vec4 computeSurfaceNormalAtLocation(Angle latitude, Angle longitude)
EllipsoidalGlobe
computeSurfaceNormalAtLocation
in interface Globe
computeSurfaceNormalAtLocation
in class EllipsoidalGlobe
latitude
- the latitude of the position.longitude
- the longitude of the position.public Vec4 computeSurfaceNormalAtPoint(Vec4 point)
EllipsoidalGlobe
computeSurfaceNormalAtPoint
in interface Globe
computeSurfaceNormalAtPoint
in class EllipsoidalGlobe
point
- the cartesian point.public Matrix computeSurfaceOrientationAtPosition(Angle latitude, Angle longitude, double metersElevation)
EllipsoidalGlobe
computeSurfaceOrientationAtPosition
in interface Globe
computeSurfaceOrientationAtPosition
in class EllipsoidalGlobe
latitude
- the latitude of the position.longitude
- the longitude of the position.metersElevation
- the number of meters above or below mean sea level.protected Vec4 geodeticToCartesian(Angle latitude, Angle longitude, double metersElevation)
geodeticToCartesian
in class EllipsoidalGlobe
latitude
- the latitude of the position.longitude
- the longitude of the position.metersElevation
- the number of meters above or below mean sea level.protected void geodeticToCartesian(Sector sector, int numLat, int numLon, double[] metersElevation, Vec4[] out)
EllipsoidalGlobe
This method provides an interface for efficient generation of a grid of cartesian points within a sector. The
grid is constructed by dividing the sector into numLon x numLat
evenly separated points in
geographic coordinates. The first and last points in latitude and longitude are placed at the sector's minimum
and maximum boundary, and the remaining points are spaced evenly between those boundary points.
For each grid point within the sector, an elevation value is specified via an array of elevations. The calculation at each position incorporates the associated elevation.
geodeticToCartesian
in class EllipsoidalGlobe
sector
- The sector over which to generate the points.numLat
- The number of points to generate latitudinally.numLon
- The number of points to generate longitudinally.metersElevation
- An array of elevations to incorporate in the point calculations. There must be one
elevation value in the array for each generated point, so the array must have a length of
at least numLon x numLat
. Elevations are read from this array in row major
order, beginning with the row of minimum latitude.out
- An array to hold the computed cartesian points. It must have a length of at least
numLon x numLat
. Points are written to this array in row major order,
beginning with the row of minimum latitude.public double getElevation(Angle latitude, Angle longitude)
Globe
The elevation returned from this method is the best available in memory. If no elevation is in memory, the elevation model's minimum extreme elevation at the location is returned. Local disk caches are not consulted.
getElevation
in interface Globe
getElevation
in class EllipsoidalGlobe
latitude
- the latitude of the location at which to determine elevation.longitude
- the longitude of the location at which to determine elevation.Globe.getElevationModel()
public GlobeStateKey getGlobeStateKey()
Globe
getGlobeStateKey
in interface Globe
getGlobeStateKey
in class EllipsoidalGlobe
public GlobeStateKey getGlobeStateKey(DrawContext dc)
Globe
getGlobeStateKey
in interface Globe
getGlobeStateKey
in class EllipsoidalGlobe
dc
- the current draw context.public GeographicProjection getProjection()
getProjection
in interface Globe2D
setProjection(java.lang.String)
public java.lang.Object getStateKey(DrawContext dc)
Globe
getStateKey
in interface Globe
getStateKey
in class EllipsoidalGlobe
dc
- the current draw context.protected Intersection[] intersect(Line line, double equRadius, double polarRadius)
intersect
in class EllipsoidalGlobe
public boolean intersects(Frustum frustum)
Extent
Extent
intersects frustum
. Returns true if any part of
these two objects intersect, including the case where either object wholly contains the other, false otherwise.intersects
in interface Extent
intersects
in class EllipsoidalGlobe
frustum
- the Frustum
with which to test for intersection.public boolean intersects(Line line)
Extent
line
intersects this Extent
. This method may be faster than
checking the size of the array returned by intersect(Line)
. Implementing methods must ensure that
this method returns true if and only if intersect(Line)
returns a non-null array containing at least
one element.intersects
in interface Extent
intersects
in class EllipsoidalGlobe
line
- the Line
with which to test for intersection.public boolean intersects(Plane plane)
Extent
Extent
is intersected by plane
.intersects
in interface Extent
intersects
in class EllipsoidalGlobe
plane
- the Plane
with which to test for intersection.plane
is found to intersect this Extent
.public boolean isContinuous()
Globe2D
isContinuous
in interface Globe2D
true
if it makes sense to treat the associated projection as continuous, otherwise
false
.public boolean isPointAboveElevation(Vec4 point, double elevation)
isPointAboveElevation
in interface Globe
isPointAboveElevation
in class EllipsoidalGlobe
point
- the Vec4
point to test.elevation
- the elevation to test for.public void setContinuous(boolean continuous)
Globe2D
setContinuous
in interface Globe2D
continuous
- true
if it makes sense to treat the associated projection as continuous, otherwise
false
.GeographicProjection.isContinuous()
public void setOffset(int offset)
Globe2D
public void setProjection(GeographicProjection projection)
Globe2D
setProjection
in interface Globe2D
projection
- The projection to apply to this globe.GeographicProjection