Interface SectorGeometry
-
- All Superinterfaces:
Renderable
- All Known Implementing Classes:
RectangularTessellator.RectTile
public interface SectorGeometry extends Renderable
This interface provides access to individual terrain tiles, which are contained in aSectorGeometryList
.Note: Three methods of this class assume that the
SectorGeometryList.beginRendering(gov.nasa.worldwind.render.DrawContext)
method of the containing sector geometry list has been called prior to calling them. They arepick(gov.nasa.worldwind.render.DrawContext, java.awt.Point)
,pick(gov.nasa.worldwind.render.DrawContext, java.util.List)
, andrenderMultiTexture(gov.nasa.worldwind.render.DrawContext, int)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SectorGeometry.GeographicTextureCoordinateComputer
An interface for computing texture coordinates for a given location.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
beginRendering(DrawContext dc, int numTextureUnits)
Indicates that this sector geometry is about to be rendered one or more times.void
endRendering(DrawContext dc)
Restores state established bybeginRendering(gov.nasa.worldwind.render.DrawContext, int)
.Extent
getExtent()
Returns this sector geometry's extent.Sector
getSector()
Indicates theSector
covered by this sector geometry.Vec4
getSurfacePoint(Angle latitude, Angle longitude, double metersOffset)
Computes the Cartesian coordinates of a location on the geometry's surface.Intersection[]
intersect(double elevation)
Computes the geometry's intersections with a globe at a specified elevation.Intersection[]
intersect(Line line)
Computes the Cartesian coordinates of a line's intersections with the geometry.java.nio.DoubleBuffer
makeTextureCoordinates(SectorGeometry.GeographicTextureCoordinateComputer computer)
Computes texture coordinates for the geometry.void
pick(DrawContext dc, java.awt.Point pickPoint)
Performs a pick on the geometry.PickedObject[]
pick(DrawContext dc, java.util.List<? extends java.awt.Point> pickPoints)
Performs a pick on the geometry.void
render(DrawContext dc, boolean beginRenderingCalled)
Displays the geometry.void
renderBoundingVolume(DrawContext dc)
Displays the geometry's bounding volume.void
renderMultiTexture(DrawContext dc, int numTextureUnits)
Displays the geometry.void
renderMultiTexture(DrawContext dc, int numTextureUnits, boolean beginRenderingCalled)
Displays the geometry.void
renderTileID(DrawContext dc)
Displays on the geometry's surface the tessellator level and the minimum and maximum elevations of the sector.void
renderWireframe(DrawContext dc, boolean interior, boolean exterior)
Displays the geometry's tessellation.-
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
-
-
-
-
Method Detail
-
getExtent
Extent getExtent()
Returns this sector geometry's extent.- Returns:
- this sector geometry's extent, or null if the extent has not been computed.
-
getSector
Sector getSector()
Indicates theSector
covered by this sector geometry.- Returns:
- this sector geometry's sector.
-
pick
void pick(DrawContext dc, java.awt.Point pickPoint)
Performs a pick on the geometry. The result, if any, is added to the draw context's picked-object list. SeeDrawContext.getPickedObjects()
.Note: This method assumes that
SectorGeometryList.beginRendering(gov.nasa.worldwind.render.DrawContext)
was called prior to this method.- Parameters:
dc
- the current draw context.pickPoint
- a screen coordinate points to pick test.- Throws:
java.lang.IllegalArgumentException
- if either the draw context or list of pick points is null.
-
getSurfacePoint
Vec4 getSurfacePoint(Angle latitude, Angle longitude, double metersOffset)
Computes the Cartesian coordinates of a location on the geometry's surface.- Parameters:
latitude
- the position's latitude.longitude
- the position's longitude.metersOffset
- the number of meters to offset the computed position from the geometry's surface.- Returns:
- the computed Cartesian coordinates, or null if the specified location is not within the geometry's sector or no internal geometry exists (has not yet been created).
- Throws:
java.lang.IllegalArgumentException
- if either the latitude or longitude are null.
-
beginRendering
void beginRendering(DrawContext dc, int numTextureUnits)
Indicates that this sector geometry is about to be rendered one or more times. When rendering is complete, theendRendering(gov.nasa.worldwind.render.DrawContext)
method must be called.- Parameters:
dc
- the current draw context.numTextureUnits
- the number of texture units to use.
-
endRendering
void endRendering(DrawContext dc)
Restores state established bybeginRendering(gov.nasa.worldwind.render.DrawContext, int)
.- Parameters:
dc
- the current draw context.
-
renderMultiTexture
void renderMultiTexture(DrawContext dc, int numTextureUnits)
Displays the geometry. The number of texture units to use may be specified, but at most only the number of available units are used.Note: This method assumes that
SectorGeometryList.beginRendering(gov.nasa.worldwind.render.DrawContext)
was called prior to this method.- Parameters:
dc
- the current draw context.numTextureUnits
- the number of texture units to attempt to use.- Throws:
java.lang.IllegalArgumentException
- if the draw context is null or the number of texture units is less than one.
-
renderWireframe
void renderWireframe(DrawContext dc, boolean interior, boolean exterior)
Displays the geometry's tessellation. Option parameters control whether to display the interior triangles, the geometry's exterior boundary, or both.- Parameters:
dc
- the current draw context.interior
- if true, displays the interior triangles.exterior
- if true, displays the exterior boundary.- Throws:
java.lang.IllegalArgumentException
- if the draw context is null.
-
renderBoundingVolume
void renderBoundingVolume(DrawContext dc)
Displays the geometry's bounding volume.- Parameters:
dc
- the current draw context.- Throws:
java.lang.IllegalArgumentException
- if the draw context is null.
-
renderTileID
void renderTileID(DrawContext dc)
Displays on the geometry's surface the tessellator level and the minimum and maximum elevations of the sector.- Parameters:
dc
- the current draw context.- Throws:
java.lang.IllegalArgumentException
- if the draw context is null.
-
pick
PickedObject[] pick(DrawContext dc, java.util.List<? extends java.awt.Point> pickPoints)
Performs a pick on the geometry.Note: This method assumes that
SectorGeometryList.beginRendering(gov.nasa.worldwind.render.DrawContext)
was called prior to this method.- Parameters:
dc
- the current draw context.pickPoints
- a list of screen coordinate points to pick test.- Returns:
- an array of resolved pick objects corresponding to the specified pick points. Null is returned as the picked object for points not on the geometry or otherwise not resolvable. Returns null if the pick point list's size is zero.
- Throws:
java.lang.IllegalArgumentException
- if either the draw context or list of pick points is null.
-
intersect
Intersection[] intersect(Line line)
Computes the Cartesian coordinates of a line's intersections with the geometry.- Parameters:
line
- the line to intersect.- Returns:
- the Cartesian coordinates of each intersection, or null if there is no intersection or no internal geometry has been computed.
- Throws:
java.lang.IllegalArgumentException
- if the line is null.
-
intersect
Intersection[] intersect(double elevation)
Computes the geometry's intersections with a globe at a specified elevation.- Parameters:
elevation
- the elevation for which intersection points are to be found.- Returns:
- an array of intersection pairs, or null if no intersections were found. The returned array of
intersections describes a list of individual segments - two
Intersection
elements for each, corresponding to each geometry triangle that intersects the given elevation.
-
makeTextureCoordinates
java.nio.DoubleBuffer makeTextureCoordinates(SectorGeometry.GeographicTextureCoordinateComputer computer)
Computes texture coordinates for the geometry. Specific coordinate values are computed by a specified computer implementing theSectorGeometry.GeographicTextureCoordinateComputer
interface. The computer is invoked once for each tessellation vertex of the geometry. The latitude and longitude of the location is specified in that invocation.- Parameters:
computer
- the texture coordinate computer.- Returns:
- the computed texture coordinates. The first entry in the buffer corresponds to the lower left corner of the geometry (minimum latitude and longitude). The entries are then ordered by increasing longitude and then increasing latitude (typically called row-major order).
- Throws:
java.lang.IllegalArgumentException
- if the computer is null.
-
renderMultiTexture
void renderMultiTexture(DrawContext dc, int numTextureUnits, boolean beginRenderingCalled)
Displays the geometry. The number of texture units to use may be specified, but at most only the number of available units are used.Note: This method allows but does not require that
SectorGeometryList.beginRendering(gov.nasa.worldwind.render.DrawContext)
was called prior to this method. See the description of thebeginRenderingCalled
argument.- Parameters:
dc
- the current draw context.numTextureUnits
- the number of texture units to attempt to use.beginRenderingCalled
- indicates whether this sector geometry'sbeginRendering
method has been called prior to calling this method. True indicated it was called, false indicates that it was not. Calling <beginRendering> eliminates redundant rendering set-up and is used when this sector geometry is rendered several times in succession.- Throws:
java.lang.IllegalArgumentException
- if the draw context is null or the number of texture units is less than one.- See Also:
beginRendering(gov.nasa.worldwind.render.DrawContext, int)
-
render
void render(DrawContext dc, boolean beginRenderingCalled)
Displays the geometry.Note: This method allows but does not require that
SectorGeometryList.beginRendering(gov.nasa.worldwind.render.DrawContext)
was called prior to this method. See the description of thebeginRenderingCalled
argument.- Parameters:
dc
- the current draw context.beginRenderingCalled
- indicates whether this sector geometry'sbeginRendering
method has been called prior to calling this method. True indicated it was called, false indicates that it was not. Calling <beginRendering> eliminates redundant rendering set-up and is used when this sector geometry is rendered several times in succession.- Throws:
java.lang.IllegalArgumentException
- if the draw context is null or the number of texture units is less than one.- See Also:
beginRendering(gov.nasa.worldwind.render.DrawContext, int)
-
-