NASA World Wind

gov.nasa.worldwind.util
Class SurfaceTileDrawContext

java.lang.Object
  extended by gov.nasa.worldwind.util.SurfaceTileDrawContext

public class SurfaceTileDrawContext
extends Object

SurfaceTileDrawContext contains the context needed to render to an off-screen surface tile. SurfaceTileDrawContext is defined by a geographic Sector and a corresponding tile viewport. The Sector maps geographic coordinates to pixels in an abstract off-screen tile.


Field Summary
protected  Matrix modelview
           
protected  Sector sector
           
protected  Rectangle viewport
           
 
Constructor Summary
SurfaceTileDrawContext(Sector sector, int viewportWidth, int viewportHeight)
          Constructs a SurfaceTileDrawContext with a specified surface Sector and viewport dimension.
SurfaceTileDrawContext(Sector sector, Rectangle viewport)
          Constructs a SurfaceTileDrawContext with a specified surface Sector and viewport.
 
Method Summary
 Matrix getModelviewMatrix()
          Returns a Matrix mapping geographic coordinates to pixels in the off-screen tile.
 Matrix getModelviewMatrix(LatLon referenceLocation)
          Returns a Matrix mapping geographic coordinates to pixels in the off-screen tile.
 Sector getSector()
          Returns the context's Sector.
 Rectangle getViewport()
          Returns the context's viewport.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelview

protected Matrix modelview

sector

protected Sector sector

viewport

protected Rectangle viewport
Constructor Detail

SurfaceTileDrawContext

public SurfaceTileDrawContext(Sector sector,
                              int viewportWidth,
                              int viewportHeight)
Constructs a SurfaceTileDrawContext with a specified surface Sector and viewport dimension. The Sector defines the context's geographic extent, and the viewport defines the context's corresponding viewport's dimension in pixels.

Parameters:
sector - the context's Sector.
viewportWidth - the context's viewport width in pixels.
viewportHeight - the context's viewport height in pixels.
Throws:
IllegalArgumentException - if the sector is null, or if the viewport width or height is less than or equal to zero.

SurfaceTileDrawContext

public SurfaceTileDrawContext(Sector sector,
                              Rectangle viewport)
Constructs a SurfaceTileDrawContext with a specified surface Sector and viewport. The Sector defines the context's geographic extent, and the viewport defines the context's corresponding viewport in pixels.

Parameters:
sector - the context's Sector.
viewport - the context's viewport in pixels.
Throws:
IllegalArgumentException - if either the sector or viewport are null, or if the viewport width or height is less than or equal to zero.
Method Detail

getModelviewMatrix

public Matrix getModelviewMatrix()
Returns a Matrix mapping geographic coordinates to pixels in the off-screen tile.

Returns:
Matrix mapping geographic coordinates to tile coordinates.

getModelviewMatrix

public Matrix getModelviewMatrix(LatLon referenceLocation)
Returns a Matrix mapping geographic coordinates to pixels in the off-screen tile. The reference location defines the geographic coordinate origin.

Parameters:
referenceLocation - the geographic coordinate origin.
Returns:
Matrix mapping geographic coordinates to tile coordinates.
Throws:
IllegalArgumentException - if the reference location is null.

getSector

public Sector getSector()
Returns the context's Sector.

Returns:
the context's Sector.

getViewport

public Rectangle getViewport()
Returns the context's viewport.

Returns:
the context's viewport.

NASA World Wind