NASA World Wind

gov.nasa.worldwind.terrain
Class RectangularTessellator.RectTile

java.lang.Object
  extended by gov.nasa.worldwind.terrain.RectangularTessellator.RectTile
All Implemented Interfaces:
Renderable, SectorGeometry
Enclosing class:
RectangularTessellator

protected static class RectangularTessellator.RectTile
extends Object
implements SectorGeometry


Nested Class Summary
 
Nested classes/interfaces inherited from interface gov.nasa.worldwind.terrain.SectorGeometry
SectorGeometry.GeographicTextureCoordinateComputer
 
Field Summary
protected  double cellSize
           
protected  int density
           
protected  Extent extent
           
protected  int level
           
protected  int maxColorCode
           
protected  int minColorCode
           
protected  RectangularTessellator.RenderInfo ri
           
protected  Sector sector
           
protected  RectangularTessellator tessellator
           
 
Constructor Summary
RectangularTessellator.RectTile(RectangularTessellator tessellator, Extent extent, int level, int density, Sector sector)
           
 
Method Summary
 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 by SectorGeometry.beginRendering(gov.nasa.worldwind.render.DrawContext, int).
 double getCellSize()
           
 int getDensity()
           
 Extent getExtent()
          Returns this sector geometry's extent.
 int getLevel()
           
 int getMaxColorCode()
           
 int getMinColorCode()
           
 double getResolution()
           
 RectangularTessellator.RenderInfo getRi()
           
 Sector getSector()
          Indicates the Sector 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.
 RectangularTessellator getTessellator()
           
 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.
 DoubleBuffer makeTextureCoordinates(SectorGeometry.GeographicTextureCoordinateComputer computer)
          Computes texture coordinates for the geometry.
 PickedObject[] pick(DrawContext dc, List<? extends Point> pickPoints)
          Performs a pick on the geometry.
 void pick(DrawContext dc, Point pickPoint)
          Performs a pick on the geometry.
 void render(DrawContext dc)
          Causes this Renderable to render itself using the provided draw context.
 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 showTriangles, boolean showTileBoundary)
          Displays the geometry's tessellation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cellSize

protected final double cellSize

density

protected final int density

extent

protected Extent extent

level

protected final int level

maxColorCode

protected int maxColorCode

minColorCode

protected int minColorCode

ri

protected RectangularTessellator.RenderInfo ri

sector

protected final Sector sector

tessellator

protected final RectangularTessellator tessellator
Constructor Detail

RectangularTessellator.RectTile

public RectangularTessellator.RectTile(RectangularTessellator tessellator,
                                       Extent extent,
                                       int level,
                                       int density,
                                       Sector sector)
Method Detail

beginRendering

public void beginRendering(DrawContext dc,
                           int numTextureUnits)
Description copied from interface: SectorGeometry
Indicates that this sector geometry is about to be rendered one or more times. When rendering is complete, the SectorGeometry.endRendering(gov.nasa.worldwind.render.DrawContext) method must be called.

Specified by:
beginRendering in interface SectorGeometry
Parameters:
dc - the current draw context.
numTextureUnits - the number of texture units to use.

endRendering

public void endRendering(DrawContext dc)
Description copied from interface: SectorGeometry
Restores state established by SectorGeometry.beginRendering(gov.nasa.worldwind.render.DrawContext, int).

Specified by:
endRendering in interface SectorGeometry
Parameters:
dc - the current draw context.

getCellSize

public double getCellSize()

getDensity

public int getDensity()

getExtent

public Extent getExtent()
Description copied from interface: SectorGeometry
Returns this sector geometry's extent.

Specified by:
getExtent in interface SectorGeometry
Returns:
this sector geometry's extent, or null if the extent has not been computed.

getLevel

public int getLevel()

getMaxColorCode

public int getMaxColorCode()

getMinColorCode

public int getMinColorCode()

getResolution

public double getResolution()

getRi

public RectangularTessellator.RenderInfo getRi()

getSector

public Sector getSector()
Description copied from interface: SectorGeometry
Indicates the Sector covered by this sector geometry.

Specified by:
getSector in interface SectorGeometry
Returns:
this sector geometry's sector.

getSurfacePoint

public Vec4 getSurfacePoint(Angle latitude,
                            Angle longitude,
                            double metersOffset)
Description copied from interface: SectorGeometry
Computes the Cartesian coordinates of a location on the geometry's surface.

Specified by:
getSurfacePoint in interface SectorGeometry
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).

getTessellator

public RectangularTessellator getTessellator()

intersect

public Intersection[] intersect(double elevation)
Description copied from interface: SectorGeometry
Computes the geometry's intersections with a globe at a specified elevation.

Specified by:
intersect in interface SectorGeometry
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.

intersect

public Intersection[] intersect(Line line)
Description copied from interface: SectorGeometry
Computes the Cartesian coordinates of a line's intersections with the geometry.

Specified by:
intersect in interface SectorGeometry
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.

makeTextureCoordinates

public DoubleBuffer makeTextureCoordinates(SectorGeometry.GeographicTextureCoordinateComputer computer)
Description copied from interface: SectorGeometry
Computes texture coordinates for the geometry. Specific coordinate values are computed by a specified computer implementing the SectorGeometry.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.

Specified by:
makeTextureCoordinates in interface SectorGeometry
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).

pick

public PickedObject[] pick(DrawContext dc,
                           List<? extends Point> pickPoints)
Description copied from interface: SectorGeometry
Performs 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:
pick in interface SectorGeometry
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,
                 Point pickPoint)
Description copied from interface: SectorGeometry
Performs a pick on the geometry. The result, if any, is added to the draw context's picked-object list. See DrawContext.getPickedObjects().

Note: This method assumes that SectorGeometryList.beginRendering(gov.nasa.worldwind.render.DrawContext) was called prior to this method.

Specified by:
pick in interface SectorGeometry
Parameters:
dc - the current draw context.
pickPoint - a screen coordinate points to pick test.

render

public void render(DrawContext dc)
Description copied from interface: Renderable
Causes this Renderable to render itself using the provided draw context.

Specified by:
render in interface Renderable
Parameters:
dc - the DrawContext to be used
See Also:
DrawContext

render

public void render(DrawContext dc,
                   boolean beginRenderingCalled)
Description copied from interface: SectorGeometry
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 the beginRenderingCalled argument.

Specified by:
render in interface SectorGeometry
Parameters:
dc - the current draw context.
beginRenderingCalled - indicates whether this sector geometry's beginRendering method has been called prior to calling this method. True indicated it was called, false indicates that it was not. Calling 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)

renderBoundingVolume

public void renderBoundingVolume(DrawContext dc)
Description copied from interface: SectorGeometry
Displays the geometry's bounding volume.

Specified by:
renderBoundingVolume in interface SectorGeometry
Parameters:
dc - the current draw context.

renderMultiTexture

public void renderMultiTexture(DrawContext dc,
                               int numTextureUnits)
Description copied from interface: SectorGeometry
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.

Specified by:
renderMultiTexture in interface SectorGeometry
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: SectorGeometry
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 the beginRenderingCalled argument.

Specified by:
renderMultiTexture in interface SectorGeometry
Parameters:
dc - the current draw context.
numTextureUnits - the number of texture units to attempt to use.
beginRenderingCalled - indicates whether this sector geometry's beginRendering method has been called prior to calling this method. True indicated it was called, false indicates that it was not. Calling 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)

renderTileID

public void renderTileID(DrawContext dc)
Description copied from interface: SectorGeometry
Displays on the geometry's surface the tessellator level and the minimum and maximum elevations of the sector.

Specified by:
renderTileID in interface SectorGeometry
Parameters:
dc - the current draw context.

renderWireframe

public void renderWireframe(DrawContext dc,
                            boolean showTriangles,
                            boolean showTileBoundary)
Description copied from interface: SectorGeometry
Displays the geometry's tessellation. Option parameters control whether to display the interior triangles, the geometry's exterior boundary, or both.

Specified by:
renderWireframe in interface SectorGeometry
Parameters:
dc - the current draw context.
showTriangles - if true, displays the interior triangles.
showTileBoundary - if true, displays the exterior boundary.

NASA World Wind