NASA World Wind

gov.nasa.worldwind.globes
Class FlatGlobe

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.globes.FlatGlobe
All Implemented Interfaces:
AVList, Extent, Globe, WWObject, PropertyChangeListener, EventListener
Direct Known Subclasses:
EarthFlat

public class FlatGlobe
extends WWObjectImpl
implements Globe

Experimental flat globe See TODOs for difference from EllipsoidalGlobe


Field Summary
static String PROJECTION_LAT_LON
           
static String PROJECTION_MERCATOR
           
static String PROJECTION_SINUSOIDAL
           
static String PROJECTION_TEST
           
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
FlatGlobe(double equatorialRadius, double polarRadius, double es, ElevationModel em)
           
 
Method Summary
 Cylinder computeBoundingCylinder(double verticalExaggeration, Sector sector)
          Returns a cylinder that minimally surrounds the sector at a specified vertical exaggeration.
 Vec4 computePointFromPosition(Angle latitude, Angle longitude, double metersElevation)
           
 Vec4 computePointFromPosition(Position position)
           
 Position computePositionFromPoint(Vec4 point)
           
 Vec4 computeSurfaceNormalAtPoint(Vec4 p)
           
 boolean equals(Object o)
           
 Double getBestElevation(Angle latitude, Angle longitude)
           
 Vec4 getCenter()
           
 double getDiameter()
           
 double getEccentricitySquared()
           
 double getElevation(Angle latitude, Angle longitude)
           
 Double getElevationAtResolution(Angle latitude, Angle longitude, double resolution)
           
 ElevationModel getElevationModel()
           
 double getEquatorialRadius()
           
 Extent getExtent()
           
 Position getIntersectionPosition(Line line)
           
 double getMaxElevation()
           
 double getMaxElevation(Sector sector)
           
 double getMaximumRadius()
           
 double getMinElevation()
           
 double getMinElevation(Sector sector)
           
 double getPolarRadius()
           
 String getProjection()
           
 double getRadius()
           
 double getRadiusAt(Angle latitude, Angle longitude)
           
 double getRadiusAt(LatLon latLon)
           
 Tessellator getTessellator()
           
 int hashCode()
           
 Intersection[] intersect(Line line)
          Obtain the intersections of this extent with line.
 Intersection[] intersect(Line line, double altitude)
           
 boolean intersects(Frustum frustum)
          Tests whether or not this Extent intersects frustum.
 boolean intersects(Line line)
          Calculate whether or not line intersects this Extent.
 boolean intersects(Plane plane)
          Calculate whether or not this Extent is intersected by plane.
 void setProjection(String projection)
           
 void setTessellator(Tessellator tessellator)
           
 SectorGeometryList tessellate(DrawContext dc)
           
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, propertyChange, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Field Detail

PROJECTION_LAT_LON

public static final String PROJECTION_LAT_LON
See Also:
Constant Field Values

PROJECTION_MERCATOR

public static final String PROJECTION_MERCATOR
See Also:
Constant Field Values

PROJECTION_SINUSOIDAL

public static final String PROJECTION_SINUSOIDAL
See Also:
Constant Field Values

PROJECTION_TEST

public static final String PROJECTION_TEST
See Also:
Constant Field Values
Constructor Detail

FlatGlobe

public FlatGlobe(double equatorialRadius,
                 double polarRadius,
                 double es,
                 ElevationModel em)
Method Detail

computeBoundingCylinder

public Cylinder computeBoundingCylinder(double verticalExaggeration,
                                        Sector sector)
Returns a cylinder that minimally surrounds the sector at a specified vertical exaggeration.

Specified by:
computeBoundingCylinder in interface Globe
Parameters:
verticalExaggeration - the vertical exaggeration to apply to the globe's elevations when computing the cylinder.
sector - the sector to return the bounding cylinder for.
Returns:
The minimal bounding cylinder in Cartesian coordinates.
Throws:
IllegalArgumentException - if globe or sector is null

computePointFromPosition

public final Vec4 computePointFromPosition(Angle latitude,
                                           Angle longitude,
                                           double metersElevation)
Specified by:
computePointFromPosition in interface Globe

computePointFromPosition

public final Vec4 computePointFromPosition(Position position)
Specified by:
computePointFromPosition in interface Globe

computePositionFromPoint

public final Position computePositionFromPoint(Vec4 point)
Specified by:
computePositionFromPoint in interface Globe

computeSurfaceNormalAtPoint

public Vec4 computeSurfaceNormalAtPoint(Vec4 p)
Specified by:
computeSurfaceNormalAtPoint in interface Globe

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getBestElevation

public Double getBestElevation(Angle latitude,
                               Angle longitude)
Specified by:
getBestElevation in interface Globe

getCenter

public final Vec4 getCenter()
Specified by:
getCenter in interface Extent

getDiameter

public final double getDiameter()
Specified by:
getDiameter in interface Extent

getEccentricitySquared

public double getEccentricitySquared()
Specified by:
getEccentricitySquared in interface Globe

getElevation

public final double getElevation(Angle latitude,
                                 Angle longitude)
Specified by:
getElevation in interface Globe

getElevationAtResolution

public final Double getElevationAtResolution(Angle latitude,
                                             Angle longitude,
                                             double resolution)
Specified by:
getElevationAtResolution in interface Globe

getElevationModel

public final ElevationModel getElevationModel()
Specified by:
getElevationModel in interface Globe

getEquatorialRadius

public final double getEquatorialRadius()
Specified by:
getEquatorialRadius in interface Globe

getExtent

public final Extent getExtent()
Specified by:
getExtent in interface Globe

getIntersectionPosition

public final Position getIntersectionPosition(Line line)
Specified by:
getIntersectionPosition in interface Globe

getMaxElevation

public double getMaxElevation()
Specified by:
getMaxElevation in interface Globe

getMaxElevation

public double getMaxElevation(Sector sector)
Specified by:
getMaxElevation in interface Globe

getMaximumRadius

public double getMaximumRadius()
Specified by:
getMaximumRadius in interface Globe

getMinElevation

public double getMinElevation()
Specified by:
getMinElevation in interface Globe

getMinElevation

public double getMinElevation(Sector sector)
Specified by:
getMinElevation in interface Globe

getPolarRadius

public final double getPolarRadius()
Specified by:
getPolarRadius in interface Globe

getProjection

public String getProjection()

getRadius

public final double getRadius()
Specified by:
getRadius in interface Extent

getRadiusAt

public double getRadiusAt(Angle latitude,
                          Angle longitude)
Specified by:
getRadiusAt in interface Globe

getRadiusAt

public double getRadiusAt(LatLon latLon)
Specified by:
getRadiusAt in interface Globe

getTessellator

public Tessellator getTessellator()
Specified by:
getTessellator in interface Globe

hashCode

public int hashCode()
Overrides:
hashCode in class Object

intersect

public Intersection[] intersect(Line line)
Description copied from interface: Extent
Obtain the intersections of this extent with line. The returned array may be either null or of zero length if no intersections are discovered. It does not contain null elements. Tangential intersections are marked as such. line is considered to have infinite length in both directions.

Specified by:
intersect in interface Extent
Parameters:
line - the Line with which to intersect this Extent
Returns:
an array of intersections representing all the points where line enters or leave this Extent

intersect

public Intersection[] intersect(Line line,
                                double altitude)
Specified by:
intersect in interface Globe

intersects

public boolean intersects(Frustum frustum)
Description copied from interface: Extent
Tests whether or not this 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.

Specified by:
intersects in interface Extent
Parameters:
frustum - the Frustum with which to test for intersection
Returns:
true if there is an intersection, false otherwise

intersects

public boolean intersects(Line line)
Description copied from interface: Extent
Calculate whether or not line intersects this Extent. This method may be faster than checking the size of the arary 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.

Specified by:
intersects in interface Extent
Parameters:
line - the Line with which to test for intersection
Returns:
true if an intersection is found, false otherwise

intersects

public boolean intersects(Plane plane)
Description copied from interface: Extent
Calculate whether or not this Extent is intersected by plane.

Specified by:
intersects in interface Extent
Parameters:
plane - the Plane with which to test for intersection
Returns:
true if plane is found to intersect this Extent

setProjection

public void setProjection(String projection)

setTessellator

public void setTessellator(Tessellator tessellator)
Specified by:
setTessellator in interface Globe

tessellate

public SectorGeometryList tessellate(DrawContext dc)
Specified by:
tessellate in interface Globe

NASA World Wind