Package gov.nasa.worldwind.render
Class SurfaceObjectTileBuilder.SurfaceObjectTile
- java.lang.Object
- 
- gov.nasa.worldwind.util.Tile
- 
- gov.nasa.worldwind.layers.TextureTile
- 
- gov.nasa.worldwind.render.SurfaceObjectTileBuilder.SurfaceObjectTile
 
 
 
- 
- All Implemented Interfaces:
- Cacheable,- SurfaceTile,- java.lang.Comparable<Tile>
 - Enclosing class:
- SurfaceObjectTileBuilder
 
 protected static class SurfaceObjectTileBuilder.SurfaceObjectTile extends TextureTile Represents aTextureTilewho'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 methodgetStateKey(DrawContext)provides a mechanism to uniquely identify the tile's current state, including the state of each intersecting surface object.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.List<SurfaceRenderable>intersectingObjectsList of surface renderables intersecting the tile.protected java.lang.ObjectlastUpdateStateKeyThe state key that was valid when the tile was last updated.protected SectorobjectSectorThe sector that bounds the surface renderables intersecting the tile.- 
Fields inherited from class gov.nasa.worldwind.layers.TextureTilehasMipmapData, updateTime
 
- 
 - 
Constructor SummaryConstructors Constructor Description SurfaceObjectTile(Sector sector, Level level, int row, int column, java.lang.String cacheName)Constructs a tile for a given sector, level, row and column of the tile's containing tile set.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllSurfaceObjects(java.util.List<SurfaceRenderable> c, Sector sector)Adds the specified collection of surface renderables to the tile's list of intersecting objects.voidaddSurfaceObject(SurfaceRenderable so, Sector sector)Adds the specified surface renderable to the tile's list of intersecting objects.voidclearObjectList()Clears the tile's list of intersecting objects.protected TextureTilecreateSubTile(Sector sector, Level level, int row, int col)protected TileKeycreateSubTileKey(Level level, int row, int col)Returns a key for a sub tile of this texture tile with the specifiedLevel, row, and column.java.util.List<SurfaceRenderable>getObjectList()Returns a list of surface renderables intersecting the tile.SectorgetObjectSector()Returns a sector that bounds the surface renderables intersecting the tile.longgetSizeInBytes()Returns the tile's size in bytes.java.lang.ObjectgetStateKey(DrawContext dc)Returns an object that uniquely identifies the tile's state on the specified draw context.booleanhasObjects()Returns whether list of surface renderables intersecting this tile has elements.- 
Methods inherited from class gov.nasa.worldwind.layers.TextureTileapplyInternalTransform, applyResourceTextureTransform, bind, createSubTiles, equals, getCentroidPoint, getCorners, getExtent, getFallbackTile, getMemoryCache, getTexture, getTextureData, getTileFromMemoryCache, getUpdateTime, hashCode, initializeTexture, isTextureExpired, isTextureExpired, isTextureInMemory, setFallbackTile, setTexture, setTextureData, setTextureParameters, toString, updateMemoryCache
 - 
Methods inherited from class gov.nasa.worldwind.util.TilecompareTo, computeColumn, computeColumnLongitude, computeRow, computeRowLatitude, getCacheName, getColumn, getFormatSuffix, getHeight, getLabel, getLevel, getLevelName, getLevelNumber, getPath, getPathBase, getPriority, getResourceURL, getResourceURL, getRow, getSector, getTileKey, getWidth, setPriority
 - 
Methods inherited from interface gov.nasa.worldwind.render.SurfaceTilegetSector
 
- 
 
- 
- 
- 
Field Detail- 
objectSectorprotected Sector objectSector The sector that bounds the surface renderables intersecting the tile.
 - 
intersectingObjectsprotected java.util.List<SurfaceRenderable> intersectingObjects List of surface renderables intersecting the tile.
 - 
lastUpdateStateKeyprotected java.lang.Object lastUpdateStateKey The state key that was valid when the tile was last updated.
 
- 
 - 
Constructor Detail- 
SurfaceObjectTilepublic SurfaceObjectTile(Sector sector, Level level, int row, int column, java.lang.String cacheName) Constructs a tile for a given sector, level, row and column of the tile's containing tile set.- Parameters:
- 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.
- Throws:
- java.lang.IllegalArgumentException- if any of the- sector,- level, or- cacheNameare- null.
 
 
- 
 - 
Method Detail- 
getSizeInBytespublic long getSizeInBytes() Returns the tile's size in bytes. Overridden to append the size of thelastUpdateStateKeyto the superclass' computed size.- Specified by:
- getSizeInBytesin interface- Cacheable
- Overrides:
- getSizeInBytesin class- TextureTile
- Returns:
- The tile's size in bytes.
 
 - 
getStateKeypublic java.lang.Object getStateKey(DrawContext dc) Returns an object that uniquely identifies the tile's state on the specified draw context. This object is guaranteed to be globally unique; an equality test with a state key from another always returns false.- Parameters:
- dc- the draw context the state key relates to.
- Returns:
- an object representing surface renderable's current state.
 
 - 
getObjectSectorpublic Sector getObjectSector() Returns a sector that bounds the surface renderables intersecting the tile. This returns null if no surface objects intersect the tile.- Returns:
- a sector bounding the tile's intersecting objects.
 
 - 
hasObjectspublic boolean hasObjects() Returns whether list of surface renderables intersecting this tile has elements.- Returns:
- trueif the list of surface renderables intersecting this tile has elements, and- falseotherwise.
 
 - 
getObjectListpublic java.util.List<SurfaceRenderable> getObjectList() Returns a list of surface renderables intersecting the tile.- Returns:
- a tile's intersecting objects.
 
 - 
clearObjectListpublic void clearObjectList() Clears the tile's list of intersecting objects.getObjectSector()returns null after calling this method.
 - 
addSurfaceObjectpublic void addSurfaceObject(SurfaceRenderable so, Sector sector) Adds the specified surface renderable to the tile's list of intersecting objects.- Parameters:
- so- the surface renderable to add.
- sector- the sector bounding the specified surface renderable.
 
 - 
addAllSurfaceObjectspublic void addAllSurfaceObjects(java.util.List<SurfaceRenderable> c, Sector sector) Adds the specified collection of surface renderables to the tile's list of intersecting objects.- Parameters:
- c- the collection of surface renderables to add.
- sector- the sector bounding the specified surface renderable collection.
 
 - 
createSubTileprotected TextureTile createSubTile(Sector sector, Level level, int row, int col) Creates a sub tile of this texture tile with the specifiedSector,Level, row, and column. This is called byTextureTile.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. - Overrides:
- createSubTilein class- TextureTile
- Parameters:
- sector- the sub tile's sector.
- level- the sub tile's level.
- row- the sub tile's row.
- col- the sub tile's column.
- Returns:
- a sub tile of this texture tile.
 
 - 
createSubTileKeyprotected TileKey createSubTileKey(Level level, int row, int col) Returns a key for a sub tile of this texture tile with the specifiedLevel, row, and column. This is called byTextureTile.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. - Overrides:
- createSubTileKeyin class- TextureTile
- Parameters:
- level- the sub tile's level.
- row- the sub tile's row.
- col- the sub tile's column.
- Returns:
- a sub tile of this texture tile.
 
 
- 
 
-