Package gov.nasa.worldwind.util
Class GeographicImageInterpolator.GeographicCell
- java.lang.Object
-
- gov.nasa.worldwind.util.ImageInterpolator.Cell
-
- gov.nasa.worldwind.util.GeographicImageInterpolator.GeographicCell
-
- All Implemented Interfaces:
Cacheable
- Enclosing class:
- GeographicImageInterpolator
protected static class GeographicImageInterpolator.GeographicCell extends ImageInterpolator.Cell
GeographicCell extendsImageInterpolator.Cell
to correctly handle image cells which have geographic coordinates. Unlike its superclass, which works in Cartesian coordinates, GeographicCell handles the singularities of geographic coordinates, such as image cells which cross the international dateline.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
crossesDateline
Denotes if the pixels in this geographic image cell crosses the international dateline.
-
Constructor Summary
Constructors Constructor Description GeographicCell(int m0, int m1, int n0, int n1)
Constructs a new Geographic Cell, but otherwise does nothing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
childrenCrossDateline()
Returns true if any of this image cell's children cross the international dateline, and false otherwise.protected void
computeExtremesFromChildren()
Overridden to correctly compute the extremes for parent cells who's children cross the international dateline.protected void
computeExtremesFromLocations(java.awt.Dimension dim, float[] xs, float[] ys)
Overridden to correctly compute the extremes for leaf cells which cross the international dateline.boolean
intersects(float x, float y)
Overridden to correctly compute intersection for cells which cross the international dateline.boolean
isCrossesDateline()
Returns true if this image cell crosses the international dateline, and false otherwise.protected boolean
longitudesCrossDateline(java.awt.Dimension dim, float[] longitudes)
Returns true if a line segment from the first pixel in this cell to any other pixel in this cell crosses the international dateline, and false otherwise.protected ImageInterpolator.Cell
makeChildCell(int m0, int m1, int n0, int n1)
Overridden to create aGeographicImageInterpolator.GeographicCell
.-
Methods inherited from class gov.nasa.worldwind.util.ImageInterpolator.Cell
build, computeBounds, getSizeInBytes, split
-
-
-
-
Constructor Detail
-
GeographicCell
public GeographicCell(int m0, int m1, int n0, int n1)
Constructs a new Geographic Cell, but otherwise does nothing.- Parameters:
m0
- the cell's left image coordinate.m1
- the cell's right image coordinate.n0
- the cell's bottom image coordinate.n1
- the cell's top image coordinate.
-
-
Method Detail
-
makeChildCell
protected ImageInterpolator.Cell makeChildCell(int m0, int m1, int n0, int n1)
Overridden to create aGeographicImageInterpolator.GeographicCell
.- Overrides:
makeChildCell
in classImageInterpolator.Cell
- Parameters:
m0
- the cell's left image coordinate.m1
- the cell's right image coordinate.n0
- the cell's bottom image coordinate.n1
- the cell's top image coordinate.- Returns:
- a new GeographicCell with the specified image coordinates.
-
isCrossesDateline
public boolean isCrossesDateline()
Returns true if this image cell crosses the international dateline, and false otherwise.- Returns:
- true if this cell crosses the international dateline; false otherwise.
-
intersects
public boolean intersects(float x, float y)
Overridden to correctly compute intersection for cells which cross the international dateline. If the specified cell does not cross the dateline, this invokes the superclass' functionality.- Overrides:
intersects
in classImageInterpolator.Cell
- Parameters:
x
- the x-component to test for intersection with this cell.y
- the y-component to test for intersection with this cell.- Returns:
- true if the (x, y) point intersects this cell; false otherwise.
-
computeExtremesFromLocations
protected void computeExtremesFromLocations(java.awt.Dimension dim, float[] xs, float[] ys)
Overridden to correctly compute the extremes for leaf cells which cross the international dateline. If this cell does not cross the dateline, this invokes the superclass' functionality.- Overrides:
computeExtremesFromLocations
in classImageInterpolator.Cell
- Parameters:
dim
- the image's dimensions.xs
- the x-coordinates of the image's pixels. Must contain at leastgridSize.width * gridSize.height
elements.ys
- the y-coordinates of the image's pixels. Must contain at leastgridSize.width * gridSize.height
elements.
-
computeExtremesFromChildren
protected void computeExtremesFromChildren()
Overridden to correctly compute the extremes for parent cells who's children cross the international dateline. If the this cell does not cross the dateline, this invokes the superclass' functionality.- Overrides:
computeExtremesFromChildren
in classImageInterpolator.Cell
-
longitudesCrossDateline
protected boolean longitudesCrossDateline(java.awt.Dimension dim, float[] longitudes)
Returns true if a line segment from the first pixel in this cell to any other pixel in this cell crosses the international dateline, and false otherwise.- Parameters:
dim
- the image's dimensions.longitudes
- the longitude coordinates of the image's pixels in degrees. Must contain at leastdim.width * dim.height
elements.- Returns:
- true if this image cell's crosses the international dateline; false otherwise.
-
childrenCrossDateline
protected boolean childrenCrossDateline()
Returns true if any of this image cell's children cross the international dateline, and false otherwise. Returns false if this image cell has no children.- Returns:
- true if any children cross the international dateline; false otherwise.
-
-