Class RectangularTessellator.RectTile
- java.lang.Object
-
- gov.nasa.worldwind.terrain.RectangularTessellator.RectTile
-
- All Implemented Interfaces:
Renderable,SectorGeometry
- Enclosing class:
- RectangularTessellator
protected static class RectangularTessellator.RectTile extends java.lang.Object implements SectorGeometry
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gov.nasa.worldwind.terrain.SectorGeometry
SectorGeometry.GeographicTextureCoordinateComputer
-
-
Field Summary
Fields Modifier and Type Field Description protected doublecellSizeprotected intdensityprotected Extentextentprotected intlevelprotected intmaxColorCodeprotected intminColorCodeprotected RectangularTessellator.RenderInforiprotected Sectorsectorprotected RectangularTessellatortessellator
-
Constructor Summary
Constructors Constructor Description RectTile(RectangularTessellator tessellator, Extent extent, int level, int density, Sector sector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginRendering(DrawContext dc, int numTextureUnits)Indicates that this sector geometry is about to be rendered one or more times.voidendRendering(DrawContext dc)Restores state established bySectorGeometry.beginRendering(gov.nasa.worldwind.render.DrawContext, int).doublegetCellSize()intgetDensity()ExtentgetExtent()Returns this sector geometry's extent.intgetLevel()intgetMaxColorCode()intgetMinColorCode()doublegetResolution()RectangularTessellator.RenderInfogetRi()SectorgetSector()Indicates theSectorcovered by this sector geometry.Vec4getSurfacePoint(Angle latitude, Angle longitude, double metersOffset)Computes the Cartesian coordinates of a location on the geometry's surface.RectangularTessellatorgetTessellator()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.DoubleBuffermakeTextureCoordinates(SectorGeometry.GeographicTextureCoordinateComputer computer)Computes texture coordinates for the geometry.voidpick(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.voidrender(DrawContext dc)Causes thisRenderableto render itself using the provided draw context.voidrender(DrawContext dc, boolean beginRenderingCalled)Displays the geometry.voidrenderBoundingVolume(DrawContext dc)Displays the geometry's bounding volume.voidrenderMultiTexture(DrawContext dc, int numTextureUnits)Displays the geometry.voidrenderMultiTexture(DrawContext dc, int numTextureUnits, boolean beginRenderingCalled)Displays the geometry.voidrenderTileID(DrawContext dc)Displays on the geometry's surface the tessellator level and the minimum and maximum elevations of the sector.voidrenderWireframe(DrawContext dc, boolean showTriangles, boolean showTileBoundary)Displays the geometry's tessellation.
-
-
-
Field Detail
-
tessellator
protected final RectangularTessellator tessellator
-
level
protected final int level
-
sector
protected final Sector sector
-
density
protected final int density
-
cellSize
protected final double cellSize
-
extent
protected Extent extent
-
ri
protected RectangularTessellator.RenderInfo ri
-
minColorCode
protected int minColorCode
-
maxColorCode
protected int maxColorCode
-
-
Constructor Detail
-
RectTile
public RectTile(RectangularTessellator tessellator, Extent extent, int level, int density, Sector sector)
-
-
Method Detail
-
getSector
public Sector getSector()
Description copied from interface:SectorGeometryIndicates theSectorcovered by this sector geometry.- Specified by:
getSectorin interfaceSectorGeometry- Returns:
- this sector geometry's sector.
-
getExtent
public Extent getExtent()
Description copied from interface:SectorGeometryReturns this sector geometry's extent.- Specified by:
getExtentin interfaceSectorGeometry- Returns:
- this sector geometry's extent, or null if the extent has not been computed.
-
getTessellator
public RectangularTessellator getTessellator()
-
getLevel
public int getLevel()
-
getDensity
public int getDensity()
-
getCellSize
public double getCellSize()
-
getRi
public RectangularTessellator.RenderInfo getRi()
-
getMinColorCode
public int getMinColorCode()
-
getMaxColorCode
public int getMaxColorCode()
-
beginRendering
public void beginRendering(DrawContext dc, int numTextureUnits)
Description copied from interface:SectorGeometryIndicates that this sector geometry is about to be rendered one or more times. When rendering is complete, theSectorGeometry.endRendering(gov.nasa.worldwind.render.DrawContext)method must be called.- Specified by:
beginRenderingin interfaceSectorGeometry- Parameters:
dc- the current draw context.numTextureUnits- the number of texture units to use.
-
endRendering
public void endRendering(DrawContext dc)
Description copied from interface:SectorGeometryRestores state established bySectorGeometry.beginRendering(gov.nasa.worldwind.render.DrawContext, int).- Specified by:
endRenderingin interfaceSectorGeometry- Parameters:
dc- the current draw context.
-
renderMultiTexture
public void renderMultiTexture(DrawContext dc, int numTextureUnits)
Description copied from interface:SectorGeometryDisplays 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.- Specified by:
renderMultiTexturein interfaceSectorGeometry- Parameters:
dc- the current draw context.numTextureUnits- the number of texture units to attempt to use.
-
renderMultiTexture
public void renderMultiTexture(DrawContext dc, int numTextureUnits, boolean beginRenderingCalled)
Description copied from interface:SectorGeometryDisplays 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 thebeginRenderingCalledargument.- Specified by:
renderMultiTexturein interfaceSectorGeometry- Parameters:
dc- the current draw context.numTextureUnits- the number of texture units to attempt to use.beginRenderingCalled- indicates whether this sector geometry'sbeginRenderingmethod 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.- See Also:
SectorGeometry.beginRendering(gov.nasa.worldwind.render.DrawContext, int)
-
render
public void render(DrawContext dc)
Description copied from interface:RenderableCauses thisRenderableto render itself using the provided draw context.- Specified by:
renderin interfaceRenderable- Parameters:
dc- theDrawContextto be used- See Also:
DrawContext
-
render
public void render(DrawContext dc, boolean beginRenderingCalled)
Description copied from interface:SectorGeometryDisplays 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 thebeginRenderingCalledargument.- Specified by:
renderin interfaceSectorGeometry- Parameters:
dc- the current draw context.beginRenderingCalled- indicates whether this sector geometry'sbeginRenderingmethod 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.- See Also:
SectorGeometry.beginRendering(gov.nasa.worldwind.render.DrawContext, int)
-
renderWireframe
public void renderWireframe(DrawContext dc, boolean showTriangles, boolean showTileBoundary)
Description copied from interface:SectorGeometryDisplays the geometry's tessellation. Option parameters control whether to display the interior triangles, the geometry's exterior boundary, or both.- Specified by:
renderWireframein interfaceSectorGeometry- Parameters:
dc- the current draw context.showTriangles- if true, displays the interior triangles.showTileBoundary- if true, displays the exterior boundary.
-
renderBoundingVolume
public void renderBoundingVolume(DrawContext dc)
Description copied from interface:SectorGeometryDisplays the geometry's bounding volume.- Specified by:
renderBoundingVolumein interfaceSectorGeometry- Parameters:
dc- the current draw context.
-
renderTileID
public void renderTileID(DrawContext dc)
Description copied from interface:SectorGeometryDisplays on the geometry's surface the tessellator level and the minimum and maximum elevations of the sector.- Specified by:
renderTileIDin interfaceSectorGeometry- Parameters:
dc- the current draw context.
-
pick
public PickedObject[] pick(DrawContext dc, java.util.List<? extends java.awt.Point> pickPoints)
Description copied from interface:SectorGeometryPerforms a pick on the geometry.Note: This method assumes that
SectorGeometryList.beginRendering(gov.nasa.worldwind.render.DrawContext)was called prior to this method.- Specified by:
pickin interfaceSectorGeometry- 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.
-
pick
public void pick(DrawContext dc, java.awt.Point pickPoint)
Description copied from interface:SectorGeometryPerforms 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.- Specified by:
pickin interfaceSectorGeometry- Parameters:
dc- the current draw context.pickPoint- a screen coordinate points to pick test.
-
getSurfacePoint
public Vec4 getSurfacePoint(Angle latitude, Angle longitude, double metersOffset)
Description copied from interface:SectorGeometryComputes the Cartesian coordinates of a location on the geometry's surface.- Specified by:
getSurfacePointin interfaceSectorGeometry- 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).
-
getResolution
public double getResolution()
-
intersect
public Intersection[] intersect(Line line)
Description copied from interface:SectorGeometryComputes the Cartesian coordinates of a line's intersections with the geometry.- Specified by:
intersectin interfaceSectorGeometry- 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.
-
intersect
public Intersection[] intersect(double elevation)
Description copied from interface:SectorGeometryComputes the geometry's intersections with a globe at a specified elevation.- Specified by:
intersectin interfaceSectorGeometry- 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
Intersectionelements for each, corresponding to each geometry triangle that intersects the given elevation.
-
makeTextureCoordinates
public java.nio.DoubleBuffer makeTextureCoordinates(SectorGeometry.GeographicTextureCoordinateComputer computer)
Description copied from interface:SectorGeometryComputes texture coordinates for the geometry. Specific coordinate values are computed by a specified computer implementing theSectorGeometry.GeographicTextureCoordinateComputerinterface. The computer is invoked once for each tessellation vertex of the geometry. The latitude and longitude of the location is specified in that invocation.- Specified by:
makeTextureCoordinatesin interfaceSectorGeometry- 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).
-
-