protected static class SurfaceObjectTileBuilder.SurfaceObjectTile extends TextureTile
TextureTile
who's contents is constructed by a set of surface
objects. The tile maintains a collection of surface renderables that intersect the tile, and provides methods for
to modify and retrieve that collection. Additionally, the method getStateKey(DrawContext)
provides a
mechanism to uniquely identify the tile's current state, including the state of each intersecting surface
object.Modifier and Type | Field and Description |
---|---|
protected List<SurfaceRenderable> |
intersectingObjects
List of surface renderables intersecting the tile.
|
protected Object |
lastUpdateStateKey
The state key that was valid when the tile was last updated.
|
protected Sector |
objectSector
The sector that bounds the surface renderables intersecting the tile.
|
hasMipmapData, updateTime
Constructor and Description |
---|
SurfaceObjectTile(Sector sector,
Level level,
int row,
int column,
String cacheName)
Constructs a tile for a given sector, level, row and column of the tile's containing tile set.
|
Modifier and Type | Method and Description |
---|---|
void |
addAllSurfaceObjects(List<SurfaceRenderable> c,
Sector sector)
Adds the specified collection of surface renderables to the tile's list of intersecting objects.
|
void |
addSurfaceObject(SurfaceRenderable so,
Sector sector)
Adds the specified surface renderable to the tile's list of intersecting objects.
|
void |
clearObjectList()
Clears the tile's list of intersecting objects.
|
protected TextureTile |
createSubTile(Sector sector,
Level level,
int row,
int col)
|
protected TileKey |
createSubTileKey(Level level,
int row,
int col)
Returns a key for a sub tile of this texture tile with the specified
Level , row,
and column. |
List<SurfaceRenderable> |
getObjectList()
Returns a list of surface renderables intersecting the tile.
|
Sector |
getObjectSector()
Returns a sector that bounds the surface renderables intersecting the tile.
|
long |
getSizeInBytes()
Returns the tile's size in bytes.
|
Object |
getStateKey(DrawContext dc)
Returns an object that uniquely identifies the tile's state on the specified draw context.
|
boolean |
hasObjects()
Returns whether list of surface renderables intersecting this tile has elements.
|
applyInternalTransform, applyResourceTextureTransform, bind, createSubTiles, equals, getCentroidPoint, getCorners, getExtent, getFallbackTile, getMemoryCache, getTexture, getTextureData, getTileFromMemoryCache, getUpdateTime, hashCode, initializeTexture, isTextureExpired, isTextureExpired, isTextureInMemory, setFallbackTile, setTexture, setTextureData, setTextureParameters, toString, updateMemoryCache
compareTo, computeColumn, computeColumnLongitude, computeRow, computeRowLatitude, getCacheName, getColumn, getFormatSuffix, getHeight, getLabel, getLevel, getLevelName, getLevelNumber, getPath, getPathBase, getPriority, getResourceURL, getResourceURL, getRow, getSector, getTileKey, getWidth, setPriority
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getSector
protected List<SurfaceRenderable> intersectingObjects
protected Object lastUpdateStateKey
protected Sector objectSector
public SurfaceObjectTile(Sector sector, Level level, int row, int column, String cacheName)
sector
- The sector corresponding with the tile.level
- The tile's level within a containing level set.row
- The row index (0 origin) of the tile within the indicated level.column
- The column index (0 origin) of the tile within the indicated level.cacheName
- The tile's cache name. Overrides the Level's cache name to associates the tile with it's
tile builder in a global cache.IllegalArgumentException
- if any of the sector
, level
, or cacheName
are
null
.public void addAllSurfaceObjects(List<SurfaceRenderable> c, Sector sector)
c
- the collection of surface renderables to add.sector
- the sector bounding the specified surface renderable collection.public void addSurfaceObject(SurfaceRenderable so, Sector sector)
so
- the surface renderable to add.sector
- the sector bounding the specified surface renderable.public void clearObjectList()
getObjectSector()
returns null after calling this
method.protected TextureTile createSubTile(Sector sector, Level level, int row, int col)
Sector
, Level
, row, and column. This is called by TextureTile.createSubTiles(gov.nasa.worldwind.util.Level)
,
to construct a sub tile for each quadrant of this tile. Subclasses must override this method to return an
instance of the derived version.
Overridden to return a new SurfaceObjectTile. The returned tile is created with the same cache name as this
tile.createSubTile
in class TextureTile
sector
- the sub tile's sector.level
- the sub tile's level.row
- the sub tile's row.col
- the sub tile's column.protected TileKey createSubTileKey(Level level, int row, int col)
Level
, row,
and column. This is called by TextureTile.createSubTiles(gov.nasa.worldwind.util.Level)
, to create a sub tile key
for each quadrant of this tile.
Overridden to return a TileKey with the same cache name as this tile.createSubTileKey
in class TextureTile
level
- the sub tile's level.row
- the sub tile's row.col
- the sub tile's column.public List<SurfaceRenderable> getObjectList()
public Sector getObjectSector()
public long getSizeInBytes()
Tile.cacheName
and the lastUpdateStateKey
to the superclass' computed size.getSizeInBytes
in interface Cacheable
getSizeInBytes
in class TextureTile
public Object getStateKey(DrawContext dc)
dc
- the draw context the state key relates to.public boolean hasObjects()
true
if the list of surface renderables intersecting this tile has elements, and false
otherwise.