public class Tile
extends java.lang.Object
LevelSet
, typically representing terrain or imagery. Provides a base
class for tiles used by tiled image layers and elevation models. Applications typically do not interact with this
class.Modifier and Type | Field and Description |
---|---|
int |
column
The tile's column within its level.
|
Level |
level
The level at which this tile lies within a
LevelSet . |
int |
row
The tile's row within its level.
|
Sector |
sector
The sector spanned by this tile.
|
java.lang.String |
tileKey
A key that uniquely identifies this tile within a level set.
|
Constructor and Description |
---|
Tile(Sector sector,
Level level,
int row,
int column)
Constructs a tile with a specified sector, level, row and column.
|
Modifier and Type | Method and Description |
---|---|
static java.util.Collection<Tile> |
assembleTilesForLevel(Level level,
TileFactory tileFactory,
java.util.Collection<Tile> result)
Creates all tiles for a specified level within a
LevelSet . |
static int |
computeColumn(double tileDelta,
double longitude)
Computes a column number for a tile within a level given the tile's longitude.
|
static int |
computeLastColumn(double tileDelta,
double maxLongitude)
Computes the last column number for a tile within a level given the tile's maximum longitude.
|
static int |
computeLastRow(double tileDelta,
double maxLatitude)
Computes the last row number for a tile within a level given the tile's maximum latitude.
|
static int |
computeRow(double tileDelta,
double latitude)
Computes a row number for a tile within a level given the tile's latitude.
|
boolean |
intersectsFrustum(RenderContext rc,
Frustum frustum)
Indicates whether this tile's Cartesian extent intersects a specified frustum.
|
boolean |
intersectsSector(Sector sector)
Indicates whether this tile intersects a specified sector.
|
boolean |
mustSubdivide(RenderContext rc,
double detailFactor)
Indicates whether this tile should be subdivided based on the current navigation state and a specified detail
factor.
|
Tile[] |
subdivide(TileFactory tileFactory)
Returns the four children formed by subdividing this tile.
|
Tile[] |
subdivideToCache(TileFactory tileFactory,
LruMemoryCache<java.lang.String,Tile[]> cache,
int cacheSize)
Returns the four children formed by subdividing this tile, drawing those children from a specified cache.
|
public final Sector sector
public final int row
public final int column
public final java.lang.String tileKey
public Tile(Sector sector, Level level, int row, int column)
sector
- the sector spanned by the tilelevel
- the tile's level in a LevelSet
row
- the tile's row within the specified levelcolumn
- the tile's column within the specified leveljava.lang.IllegalArgumentException
- if either the sector or the level is nullpublic static int computeRow(double tileDelta, double latitude)
tileDelta
- the level's tile delta in degreeslatitude
- the tile's minimum latitude in degreespublic static int computeColumn(double tileDelta, double longitude)
tileDelta
- the level's tile delta in degreeslongitude
- the tile's minimum longitude in degreespublic static int computeLastRow(double tileDelta, double maxLatitude)
tileDelta
- the level's tile delta in degreesmaxLatitude
- the tile's maximum latitude in degreespublic static int computeLastColumn(double tileDelta, double maxLongitude)
tileDelta
- the level's tile delta in degreesmaxLongitude
- the tile's maximum longitude in degreespublic static java.util.Collection<Tile> assembleTilesForLevel(Level level, TileFactory tileFactory, java.util.Collection<Tile> result)
LevelSet
.level
- the level to create the tiles fortileFactory
- the tile factory to use for creating tiles.result
- an pre-allocated Collection in which to store the resultsjava.lang.IllegalArgumentException
- If any argument is nullpublic boolean intersectsFrustum(RenderContext rc, Frustum frustum)
rc
- the current render contextfrustum
- the frustum of interestjava.lang.IllegalArgumentException
- If the frustum is nullpublic boolean intersectsSector(Sector sector)
sector
- the sector of interestjava.lang.IllegalArgumentException
- If the sector is nullpublic boolean mustSubdivide(RenderContext rc, double detailFactor)
rc
- the current render contextdetailFactor
- the detail factor to considerpublic Tile[] subdivide(TileFactory tileFactory)
LevelSet
.tileFactory
- the tile factory to use to create the childrenjava.lang.IllegalArgumentException
- If the tile factory is nullpublic Tile[] subdivideToCache(TileFactory tileFactory, LruMemoryCache<java.lang.String,Tile[]> cache, int cacheSize)
subdivide(TileFactory)
and added to the cache.tileFactory
- the tile factory to use to create the childrencache
- a memory cache that may contain pre-existing child tiles.cacheSize
- the cached size of the four child tilesjava.lang.IllegalArgumentException
- If any argument is null