gov.nasa.worldwind.render
Class TiledSurfaceObjectRenderer
java.lang.Object
gov.nasa.worldwind.render.TiledSurfaceObjectRenderer
public class TiledSurfaceObjectRenderer
- extends java.lang.Object
|
Method Summary |
protected void |
addSurfaceObject(DrawContext dc,
LevelSet levelSet,
SurfaceObject surfaceObject)
|
protected void |
addTile(DrawContext dc,
TextureTile tile)
|
protected void |
addTileOrDescendants(DrawContext dc,
LevelSet levelSet,
Sector boundingSector,
TextureTile tile)
|
protected void |
assemblePickTile(DrawContext dc,
LevelSet levelSet)
|
protected void |
assembleSurfaceObjects(DrawContext dc,
LevelSet levelSet)
|
protected void |
assembleTiles(DrawContext dc,
LevelSet levelSet)
|
protected TextureTile[] |
assembleTopLevelTiles(LevelSet levelSet,
Sector sector)
|
protected void |
beginRendering(DrawContext dc,
OGLStackHandler ogsh)
|
protected void |
beginUpdateTiles(DrawContext dc,
java.awt.Rectangle viewport)
|
protected PickedObject |
bindPickableObject(DrawContext dc,
java.lang.Object userObject,
java.lang.Object objectId)
|
protected boolean |
canAssembleTiles(DrawContext dc)
|
protected void |
clearSurfaceObjects(DrawContext dc)
|
protected void |
clearTiles(DrawContext dc)
|
protected Sector |
computeCurrentBoundingSector()
|
protected java.awt.Dimension |
computeTileDimension(DrawContext dc,
int preferredWidth,
int preferredHeight)
|
protected LevelSet |
createLevelSet(int tileWidth,
int tileHeight)
|
protected com.sun.opengl.util.texture.TextureData |
createTileTextureData(int width,
int height,
boolean mipmap)
|
protected static java.lang.String |
createUniqueCacheId()
|
protected void |
draw(DrawContext dc,
boolean isPickCall)
|
protected void |
drawPickTiles(DrawContext dc)
|
protected void |
drawRenderTiles(DrawContext dc)
|
protected void |
drawTiles(DrawContext dc,
boolean isPickCall)
|
protected void |
endRendering(DrawContext dc,
OGLStackHandler ogsh)
|
protected void |
endUpdateTiles(DrawContext dc)
|
protected TiledSurfaceObjectRenderer.SurfaceObjectState |
getCurrentStateFor(DrawContext dc,
Tile tile)
|
protected TextureTile |
getIntersectingTile(Angle latitude,
Angle longitude,
java.lang.Iterable<? extends TextureTile> tiles)
|
protected LevelSet |
getLevelSet(DrawContext dc,
int preferredTileWidth,
int preferredTileHeight)
|
protected Vec4 |
getNearestPointInSector(DrawContext dc,
Sector sector)
|
protected Position |
getPickedTerrainPosition(DrawContext dc)
|
protected TiledSurfaceObjectRenderer.PickTile |
getPickTile(LevelSet levelSet)
|
java.lang.Iterable<? extends SurfaceObject> |
getSurfaceObjects()
|
double |
getTexelToPixelRatio()
Returns the surface object texel to screen pixel ratio. |
java.awt.Color |
getTileBackgroundColor()
|
protected TextureTile |
getTileFromMemoryCache(TileKey tileKey)
|
protected TiledSurfaceObjectRenderer.SurfaceObjectState |
getTileState(TextureTile tile)
|
protected PickedObject |
getTopPickedSurfaceObject(DrawContext dc,
java.awt.Point pickPoint)
|
boolean |
isDrawBoundingSectors()
|
boolean |
isPickEnabled()
|
boolean |
isShowTileOutlines()
|
protected boolean |
isTileCurrent(DrawContext dc,
TextureTile tile,
TiledSurfaceObjectRenderer.SurfaceObjectState state)
|
protected boolean |
isTileMeetsRenderCriteria(DrawContext dc,
LevelSet levelSet,
Tile tile)
|
protected boolean |
isTileNeeded(DrawContext dc,
Sector boundingSector,
Tile tile)
|
protected boolean |
isTileVisible(DrawContext dc,
SurfaceTile tile)
|
boolean |
isUseMipmaps()
|
protected boolean |
needToSubdivide(DrawContext dc,
Sector sector,
int width,
int height)
|
protected static long |
nextUniqueId()
|
void |
pick(DrawContext dc,
java.awt.Point pickPoint,
Layer layer)
|
void |
preRender(DrawContext dc)
|
void |
render(DrawContext dc)
|
protected void |
renderBoundingSectors(DrawContext dc,
java.lang.Iterable<? extends SurfaceObject> surfaceObjects,
Sector sector,
int x,
int y,
int width,
int height)
|
protected void |
resolvePick(DrawContext dc,
java.awt.Point pickPoint,
Layer layer)
|
void |
setDrawBoundingSectors(boolean draw)
|
void |
setPickEnabled(boolean enabled)
|
void |
setShowTileOutlines(boolean show)
|
void |
setSurfaceObjects(java.lang.Iterable<? extends SurfaceObject> objects)
|
void |
setTexelToPixelRatio(double ratio)
Sets the surface object texel to screen pixel ratio. |
void |
setTileBackgroundColor(java.awt.Color color)
|
protected void |
setTileState(TextureTile tile,
TiledSurfaceObjectRenderer.SurfaceObjectState state)
|
protected com.sun.opengl.util.texture.Texture |
setupTextureTile(DrawContext dc,
TextureTile tile,
boolean useMipmaps)
|
void |
setUseMipmaps(boolean useMipmaps)
|
protected void |
updatePickTile(DrawContext dc,
TiledSurfaceObjectRenderer.PickTile tile,
java.awt.Rectangle viewport)
|
protected void |
updatePickTileData(DrawContext dc,
TiledSurfaceObjectRenderer.PickTile tile,
java.awt.Rectangle viewport)
|
protected void |
updateTile(DrawContext dc,
TextureTile tile,
java.awt.Rectangle viewport)
|
protected void |
updateTileData(DrawContext dc,
TextureTile tile,
TiledSurfaceObjectRenderer.SurfaceObjectState state,
java.awt.Rectangle viewport)
|
protected void |
updateTiles(DrawContext dc,
LevelSet levelSet)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
currentPickTile
protected TiledSurfaceObjectRenderer.PickTile currentPickTile
currentSurfaceObjects
protected java.util.List<TiledSurfaceObjectRenderer.SurfaceObjectInfo> currentSurfaceObjects
currentTiles
protected java.util.List<TextureTile> currentTiles
DEFAULT_DRAW_BOUNDING_SECTORS
protected static final boolean DEFAULT_DRAW_BOUNDING_SECTORS
- See Also:
- Constant Field Values
DEFAULT_NUM_EMPTY_LEVELS
protected static final int DEFAULT_NUM_EMPTY_LEVELS
- See Also:
- Constant Field Values
DEFAULT_NUM_LEVELS
protected static final int DEFAULT_NUM_LEVELS
- See Also:
- Constant Field Values
DEFAULT_PICK_ENABLED
protected static final boolean DEFAULT_PICK_ENABLED
- See Also:
- Constant Field Values
DEFAULT_SECTOR
protected static final Sector DEFAULT_SECTOR
DEFAULT_SHOW_TILE_OUTLINES
protected static final boolean DEFAULT_SHOW_TILE_OUTLINES
- See Also:
- Constant Field Values
DEFAULT_TEXEL_TO_PIXEL_RATIO
protected static final double DEFAULT_TEXEL_TO_PIXEL_RATIO
- See Also:
- Constant Field Values
DEFAULT_TILE_BACKGROUND_COLOR
protected static final java.awt.Color DEFAULT_TILE_BACKGROUND_COLOR
DEFAULT_TILE_COUNT_NAME
protected static final java.lang.String DEFAULT_TILE_COUNT_NAME
- See Also:
- Constant Field Values
DEFAULT_TILE_DELTA
protected static final LatLon DEFAULT_TILE_DELTA
DEFAULT_TILE_HEIGHT
protected static final int DEFAULT_TILE_HEIGHT
- See Also:
- Constant Field Values
DEFAULT_TILE_WIDTH
protected static final int DEFAULT_TILE_WIDTH
- See Also:
- Constant Field Values
DEFAULT_USE_MIPMAPS
protected static final boolean DEFAULT_USE_MIPMAPS
- See Also:
- Constant Field Values
drawBoundingSectors
protected boolean drawBoundingSectors
levelSetMap
protected java.util.Map<java.awt.Dimension,LevelSet> levelSetMap
PICK_TILE_COL
protected static final int PICK_TILE_COL
- See Also:
- Constant Field Values
PICK_TILE_ROW
protected static final int PICK_TILE_ROW
- See Also:
- Constant Field Values
pickEnabled
protected boolean pickEnabled
pickSupport
protected PickSupport pickSupport
pickTileMap
protected java.util.Map<TileKey,TiledSurfaceObjectRenderer.PickTile> pickTileMap
rttSupport
protected OGLRenderToTextureSupport rttSupport
showTileOutlines
protected boolean showTileOutlines
surfaceObjectIterable
protected java.lang.Iterable<? extends SurfaceObject> surfaceObjectIterable
texelToPixelRatio
protected double texelToPixelRatio
tileBackgroundColor
protected java.awt.Color tileBackgroundColor
tileCountName
protected java.lang.String tileCountName
tileStateMap
protected java.util.Map<TileKey,TiledSurfaceObjectRenderer.SurfaceObjectState> tileStateMap
uniqueId
protected static long uniqueId
useMipmaps
protected boolean useMipmaps
TiledSurfaceObjectRenderer
public TiledSurfaceObjectRenderer()
addSurfaceObject
protected void addSurfaceObject(DrawContext dc,
LevelSet levelSet,
SurfaceObject surfaceObject)
addTile
protected void addTile(DrawContext dc,
TextureTile tile)
addTileOrDescendants
protected void addTileOrDescendants(DrawContext dc,
LevelSet levelSet,
Sector boundingSector,
TextureTile tile)
assemblePickTile
protected void assemblePickTile(DrawContext dc,
LevelSet levelSet)
assembleSurfaceObjects
protected void assembleSurfaceObjects(DrawContext dc,
LevelSet levelSet)
assembleTiles
protected void assembleTiles(DrawContext dc,
LevelSet levelSet)
assembleTopLevelTiles
protected TextureTile[] assembleTopLevelTiles(LevelSet levelSet,
Sector sector)
beginRendering
protected void beginRendering(DrawContext dc,
OGLStackHandler ogsh)
beginUpdateTiles
protected void beginUpdateTiles(DrawContext dc,
java.awt.Rectangle viewport)
bindPickableObject
protected PickedObject bindPickableObject(DrawContext dc,
java.lang.Object userObject,
java.lang.Object objectId)
canAssembleTiles
protected boolean canAssembleTiles(DrawContext dc)
clearSurfaceObjects
protected void clearSurfaceObjects(DrawContext dc)
clearTiles
protected void clearTiles(DrawContext dc)
computeCurrentBoundingSector
protected Sector computeCurrentBoundingSector()
computeTileDimension
protected java.awt.Dimension computeTileDimension(DrawContext dc,
int preferredWidth,
int preferredHeight)
createLevelSet
protected LevelSet createLevelSet(int tileWidth,
int tileHeight)
createTileTextureData
protected com.sun.opengl.util.texture.TextureData createTileTextureData(int width,
int height,
boolean mipmap)
createUniqueCacheId
protected static java.lang.String createUniqueCacheId()
draw
protected void draw(DrawContext dc,
boolean isPickCall)
drawPickTiles
protected void drawPickTiles(DrawContext dc)
drawRenderTiles
protected void drawRenderTiles(DrawContext dc)
drawTiles
protected void drawTiles(DrawContext dc,
boolean isPickCall)
endRendering
protected void endRendering(DrawContext dc,
OGLStackHandler ogsh)
endUpdateTiles
protected void endUpdateTiles(DrawContext dc)
getCurrentStateFor
protected TiledSurfaceObjectRenderer.SurfaceObjectState getCurrentStateFor(DrawContext dc,
Tile tile)
getIntersectingTile
protected TextureTile getIntersectingTile(Angle latitude,
Angle longitude,
java.lang.Iterable<? extends TextureTile> tiles)
getLevelSet
protected LevelSet getLevelSet(DrawContext dc,
int preferredTileWidth,
int preferredTileHeight)
getNearestPointInSector
protected Vec4 getNearestPointInSector(DrawContext dc,
Sector sector)
getPickedTerrainPosition
protected Position getPickedTerrainPosition(DrawContext dc)
getPickTile
protected TiledSurfaceObjectRenderer.PickTile getPickTile(LevelSet levelSet)
getSurfaceObjects
public java.lang.Iterable<? extends SurfaceObject> getSurfaceObjects()
getTexelToPixelRatio
public double getTexelToPixelRatio()
- Returns the surface object texel to screen pixel ratio. See {#link setPixelToTexelRatio(double} for a description
of this value's meaning.
- Returns:
- surface object texel to screen pixel ratio.
getTileBackgroundColor
public java.awt.Color getTileBackgroundColor()
getTileFromMemoryCache
protected TextureTile getTileFromMemoryCache(TileKey tileKey)
getTileState
protected TiledSurfaceObjectRenderer.SurfaceObjectState getTileState(TextureTile tile)
getTopPickedSurfaceObject
protected PickedObject getTopPickedSurfaceObject(DrawContext dc,
java.awt.Point pickPoint)
isDrawBoundingSectors
public boolean isDrawBoundingSectors()
isPickEnabled
public boolean isPickEnabled()
isShowTileOutlines
public boolean isShowTileOutlines()
isTileCurrent
protected boolean isTileCurrent(DrawContext dc,
TextureTile tile,
TiledSurfaceObjectRenderer.SurfaceObjectState state)
isTileMeetsRenderCriteria
protected boolean isTileMeetsRenderCriteria(DrawContext dc,
LevelSet levelSet,
Tile tile)
isTileNeeded
protected boolean isTileNeeded(DrawContext dc,
Sector boundingSector,
Tile tile)
isTileVisible
protected boolean isTileVisible(DrawContext dc,
SurfaceTile tile)
isUseMipmaps
public boolean isUseMipmaps()
needToSubdivide
protected boolean needToSubdivide(DrawContext dc,
Sector sector,
int width,
int height)
nextUniqueId
protected static long nextUniqueId()
pick
public void pick(DrawContext dc,
java.awt.Point pickPoint,
Layer layer)
preRender
public void preRender(DrawContext dc)
render
public void render(DrawContext dc)
renderBoundingSectors
protected void renderBoundingSectors(DrawContext dc,
java.lang.Iterable<? extends SurfaceObject> surfaceObjects,
Sector sector,
int x,
int y,
int width,
int height)
resolvePick
protected void resolvePick(DrawContext dc,
java.awt.Point pickPoint,
Layer layer)
setDrawBoundingSectors
public void setDrawBoundingSectors(boolean draw)
setPickEnabled
public void setPickEnabled(boolean enabled)
setShowTileOutlines
public void setShowTileOutlines(boolean show)
setSurfaceObjects
public void setSurfaceObjects(java.lang.Iterable<? extends SurfaceObject> objects)
setTexelToPixelRatio
public void setTexelToPixelRatio(double ratio)
- Sets the surface object texel to screen pixel ratio.
- If
ratio is 1, the renderer will
attempt to create tiles whose texels have approximately the same size as a screen pixel. - If
ratio is less than 1, the renderer will attempt to create tiles whose texels are smaller than a
screen pixel. For example, specifying ratio=0.5 indicates that a surface object texel should be half the size of
a screen pixel. - If
ratio is greater than 1, the renderer will attempt to create tiles
whose texels are larger than a screen pixel. For example, specifying ratio=2 indicates that a surface object
texel should be twice the size of a screen pixel.
- Parameters:
ratio - surface object texel to screen pixel ratio.
- Throws:
java.lang.IllegalArgumentException - if ratio is less than or equal to zero.
setTileBackgroundColor
public void setTileBackgroundColor(java.awt.Color color)
setTileState
protected void setTileState(TextureTile tile,
TiledSurfaceObjectRenderer.SurfaceObjectState state)
setupTextureTile
protected com.sun.opengl.util.texture.Texture setupTextureTile(DrawContext dc,
TextureTile tile,
boolean useMipmaps)
setUseMipmaps
public void setUseMipmaps(boolean useMipmaps)
updatePickTile
protected void updatePickTile(DrawContext dc,
TiledSurfaceObjectRenderer.PickTile tile,
java.awt.Rectangle viewport)
updatePickTileData
protected void updatePickTileData(DrawContext dc,
TiledSurfaceObjectRenderer.PickTile tile,
java.awt.Rectangle viewport)
updateTile
protected void updateTile(DrawContext dc,
TextureTile tile,
java.awt.Rectangle viewport)
updateTileData
protected void updateTileData(DrawContext dc,
TextureTile tile,
TiledSurfaceObjectRenderer.SurfaceObjectState state,
java.awt.Rectangle viewport)
updateTiles
protected void updateTiles(DrawContext dc,
LevelSet levelSet)