Package gov.nasa.worldwind.util
Class SurfaceTileDrawContext
- java.lang.Object
-
- gov.nasa.worldwind.util.SurfaceTileDrawContext
-
public class SurfaceTileDrawContext extends java.lang.Object
SurfaceTileDrawContext defines a context for rendering into off-screen surface tiles. SurfaceTileDrawContext is defined by a geographic sector, a screen viewport, and a collection of pick candidates. The sector maps geographic coordinates to pixels in an abstract off-screen tile. The pick candidates provide registration of picked objects drawn into the surface tile.
-
-
Field Summary
Fields Modifier and Type Field Description protected Matrix
modelview
protected java.util.Collection<PickedObject>
pickCandidates
protected Sector
sector
protected java.awt.Rectangle
viewport
-
Constructor Summary
Constructors Constructor Description SurfaceTileDrawContext(Tile tile, java.util.Collection<PickedObject> pickCandidates)
Creates a new SurfaceTileDrawContext from the specified tile and collection of pick candidates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPickCandidate(PickedObject pickedObject)
Adds the specified picked object to this context's the collection of pick candidates.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.java.util.Collection<PickedObject>
getPickCandidates()
Returns the collection of pick candidates associated with this context.Sector
getSector()
Returns this context's sector.java.awt.Rectangle
getViewport()
Returns this context's viewport.
-
-
-
Field Detail
-
sector
protected Sector sector
-
viewport
protected java.awt.Rectangle viewport
-
modelview
protected Matrix modelview
-
pickCandidates
protected java.util.Collection<PickedObject> pickCandidates
-
-
Constructor Detail
-
SurfaceTileDrawContext
public SurfaceTileDrawContext(Tile tile, java.util.Collection<PickedObject> pickCandidates)
Creates a new SurfaceTileDrawContext from the specified tile and collection of pick candidates. The tile defines this context's geographic extent and screen viewport. The pick candidate collection is used to register picked objects drawn into the surface tile.- Parameters:
tile
- the context's tile.pickCandidates
- the context's list of pick candidates.- Throws:
java.lang.IllegalArgumentException
- if any argument is null.
-
-
Method Detail
-
getSector
public Sector getSector()
Returns this context's sector.- Returns:
- this's sector.
-
getViewport
public java.awt.Rectangle getViewport()
Returns this context's viewport.- Returns:
- this context's viewport.
-
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:
java.lang.IllegalArgumentException
- if the reference location is null.
-
getPickCandidates
public java.util.Collection<PickedObject> getPickCandidates()
Returns the collection of pick candidates associated with this context. This collection provides a registration of picked objects drawn into the surface tile.- Returns:
- this context's pick candidates.
-
addPickCandidate
public void addPickCandidate(PickedObject pickedObject)
Adds the specified picked object to this context's the collection of pick candidates. This collection can be accessed by callinggetPickCandidates()
.- Parameters:
pickedObject
- the object to add.- Throws:
java.lang.IllegalArgumentException
- if the object is null.
-
-