public class RectangularTessellator extends WWObjectImpl implements Tessellator
Modifier and Type | Class and Description |
---|---|
protected static class |
RectangularTessellator.CacheKey |
protected static class |
RectangularTessellator.RectTile |
protected static class |
RectangularTessellator.RenderInfo |
protected static class |
RectangularTessellator.TopLevelTiles |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CACHE_ID |
protected static java.lang.String |
CACHE_NAME |
protected Sector |
currentCoverage |
protected Frustum |
currentFrustum |
protected int |
currentLevel |
protected SectorGeometryList |
currentTiles |
protected static int |
DEFAULT_DENSITY |
protected static double |
DEFAULT_LOG10_RESOLUTION_TARGET |
protected static int |
DEFAULT_MAX_LEVEL |
protected static int |
DEFAULT_NUM_LAT_SUBDIVISIONS |
protected static int |
DEFAULT_NUM_LON_SUBDIVISIONS |
protected int |
density |
protected static java.util.HashMap<java.lang.Integer,java.nio.ByteBuffer> |
evenRowColorList |
protected Globe |
globe |
protected static java.util.HashMap<java.lang.Integer,java.nio.IntBuffer> |
indexLists |
protected static java.util.HashMap<java.lang.Integer,java.lang.Object> |
indexListsVboCacheKeys |
protected boolean |
makeTileSkirts |
protected int |
maxLevel |
protected int |
numLevel0LatSubdivisions |
protected int |
numLevel0LonSubdivisions |
protected static java.util.HashMap<java.lang.Integer,java.nio.ByteBuffer> |
oddRowColorList |
protected PickSupport |
pickSupport |
protected static java.util.HashMap<java.lang.Integer,java.nio.FloatBuffer> |
textureCoords |
protected static java.util.HashMap<java.lang.Integer,java.lang.Object> |
textureCoordVboCacheKeys |
protected SessionCache |
topLevelTilesCache |
protected long |
updateFrequency |
Constructor and Description |
---|
RectangularTessellator() |
Modifier and Type | Method and Description |
---|---|
protected static Vec4 |
applyOffset(Globe globe,
Vec4 point,
double metersOffset)
Offsets
point by metersOffset meters. |
protected boolean |
atBestResolution(DrawContext dc,
RectangularTessellator.RectTile tile) |
protected static double[] |
baryCentricCoordsRequireInside(Vec4 pnt,
Vec4[] V) |
void |
beginRendering(DrawContext dc) |
protected boolean |
bindVbos(DrawContext dc,
RectangularTessellator.RectTile tile,
int numTextureUnits) |
boolean |
buildVerts(DrawContext dc,
RectangularTessellator.RectTile tile,
boolean makeSkirts) |
protected java.util.ArrayList<LatLon> |
computeLocations(RectangularTessellator.RectTile tile) |
protected double |
computeTileResolutionTarget(DrawContext dc,
RectangularTessellator.RectTile tile) |
protected RectangularTessellator.CacheKey |
createCacheKey(DrawContext dc,
RectangularTessellator.RectTile tile) |
protected static void |
createIndices(int density) |
protected static double |
createPosition(int start,
double decimal,
int density)
Computes from a column (or row) number, and a given offset ranged [0,1] corresponding to the distance along the
edge of this sector, where between this column and the next column the corresponding position will fall, in the
range [0,1].
|
protected static void |
createTextureCoordinates(int density) |
protected RectangularTessellator.RectTile |
createTile(DrawContext dc,
Sector tileSector,
int level) |
protected java.util.ArrayList<RectangularTessellator.RectTile> |
createTopLevelTiles(DrawContext dc) |
protected static double |
distanceFromLine(Vec4 pnt,
Vec4 P,
Vec4 u) |
void |
endRendering(DrawContext dc) |
protected int[] |
fillIndexListVbo(DrawContext dc,
int density,
java.nio.IntBuffer indices) |
protected int[] |
fillTextureCoordsVbo(DrawContext dc,
int density,
java.nio.FloatBuffer texCoords) |
protected Vec4 |
getSurfacePoint(RectangularTessellator.RectTile tile,
Angle latitude,
Angle longitude) |
protected Vec4 |
getSurfacePoint(RectangularTessellator.RectTile tile,
Angle latitude,
Angle longitude,
double metersOffset) |
long |
getUpdateFrequency()
Indicates the maximum amount of time that may elapse between re-tessellation.
|
protected static Vec4 |
interpolate(int row,
int column,
double xDec,
double yDec,
RectangularTessellator.RenderInfo ri)
Calculates a
Point that sits at xDec offset from column to column +
1 and at yDec offset from row to row + 1 . |
protected static Vec4 |
interpolate(Vec4 bL,
Vec4 bR,
Vec4 tR,
Vec4 tL,
double xDec,
double yDec)
Calculates the point at (xDec, yDec) in the two triangles defined by {bL, bR, tL} and {bR, tR, tL}.
|
protected Intersection[] |
intersect(RectangularTessellator.RectTile tile,
double elevation) |
protected Intersection[] |
intersect(RectangularTessellator.RectTile tile,
Line line)
Determines if and where a ray intersects a
RectTile geometry. |
boolean |
isMakeTileSkirts()
Indicates whether the tessellator creates "skirts" around the tiles in order to hide gaps between adjacent tiles
with differing tessellations.
|
protected java.nio.DoubleBuffer |
makeGeographicTexCoords(SectorGeometry sg,
SectorGeometry.GeographicTextureCoordinateComputer computer) |
protected void |
makeVerts(DrawContext dc,
RectangularTessellator.RectTile tile) |
protected boolean |
needToSplit(DrawContext dc,
RectangularTessellator.RectTile tile) |
protected PickedObject[] |
pick(DrawContext dc,
RectangularTessellator.RectTile tile,
java.util.List<? extends java.awt.Point> pickPoints) |
protected void |
pick(DrawContext dc,
RectangularTessellator.RectTile tile,
java.awt.Point pickPoint) |
protected void |
render(DrawContext dc,
RectangularTessellator.RectTile tile) |
protected long |
render(DrawContext dc,
RectangularTessellator.RectTile tile,
int numTextureUnits) |
protected void |
renderBoundingVolume(DrawContext dc,
RectangularTessellator.RectTile tile) |
protected void |
renderMultiTexture(DrawContext dc,
RectangularTessellator.RectTile tile,
int numTextureUnits) |
protected void |
renderPatchBoundary(DrawContext dc,
RectangularTessellator.RectTile tile) |
protected void |
renderTileID(DrawContext dc,
RectangularTessellator.RectTile tile) |
protected void |
renderTrianglesWithUniqueColors(DrawContext dc,
RectangularTessellator.RectTile tile)
Render each triangle of a tile in a unique color.
|
protected void |
renderVA(DrawContext dc,
RectangularTessellator.RectTile tile,
int numTextureUnits) |
protected boolean |
renderVBO(DrawContext dc,
RectangularTessellator.RectTile tile,
int numTextureUnits) |
protected void |
renderWireframe(DrawContext dc,
RectangularTessellator.RectTile tile,
boolean showTriangles,
boolean showTileBoundary) |
protected PickedObject |
resolvePick(DrawContext dc,
RectangularTessellator.RectTile tile,
java.awt.Point pickPoint) |
protected void |
selectVisibleTiles(DrawContext dc,
RectangularTessellator.RectTile tile) |
void |
setMakeTileSkirts(boolean makeTileSkirts)
Specifies whether the tessellator creates "skirts" around the tiles in order to hide gaps between adjacent tiles
with differing tessellations.
|
void |
setUpdateFrequency(long updateFrequency)
Indicates the maximum amount of time that may elapse between re-tessellation.
|
protected boolean |
skipTile(DrawContext dc,
Sector sector)
Determines whether a tile is within a 2D globe's projection limits.
|
protected RectangularTessellator.RectTile[] |
split(DrawContext dc,
RectangularTessellator.RectTile tile) |
SectorGeometryList |
tessellate(DrawContext dc)
Tessellate a globe for the currently visible region.
|
onMessage, propertyChange
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
protected static final java.lang.String CACHE_ID
protected static final java.lang.String CACHE_NAME
protected Sector currentCoverage
protected Frustum currentFrustum
protected int currentLevel
protected SectorGeometryList currentTiles
protected static final int DEFAULT_DENSITY
protected static final double DEFAULT_LOG10_RESOLUTION_TARGET
protected static final int DEFAULT_MAX_LEVEL
protected static final int DEFAULT_NUM_LAT_SUBDIVISIONS
protected static final int DEFAULT_NUM_LON_SUBDIVISIONS
protected int density
protected static final java.util.HashMap<java.lang.Integer,java.nio.ByteBuffer> evenRowColorList
protected Globe globe
protected static final java.util.HashMap<java.lang.Integer,java.nio.IntBuffer> indexLists
protected static final java.util.HashMap<java.lang.Integer,java.lang.Object> indexListsVboCacheKeys
protected boolean makeTileSkirts
protected int maxLevel
protected int numLevel0LatSubdivisions
protected int numLevel0LonSubdivisions
protected static final java.util.HashMap<java.lang.Integer,java.nio.ByteBuffer> oddRowColorList
protected PickSupport pickSupport
protected static final java.util.HashMap<java.lang.Integer,java.nio.FloatBuffer> textureCoords
protected static final java.util.HashMap<java.lang.Integer,java.lang.Object> textureCoordVboCacheKeys
protected SessionCache topLevelTilesCache
protected long updateFrequency
protected static Vec4 applyOffset(Globe globe, Vec4 point, double metersOffset)
point
by metersOffset
meters.globe
- the Globe
from which to offsetpoint
- the Vec4
to offsetmetersOffset
- the magnitude of the offsetpoint
offset along its surface normal as if it were on globe
protected boolean atBestResolution(DrawContext dc, RectangularTessellator.RectTile tile)
protected static double[] baryCentricCoordsRequireInside(Vec4 pnt, Vec4[] V)
public void beginRendering(DrawContext dc)
protected boolean bindVbos(DrawContext dc, RectangularTessellator.RectTile tile, int numTextureUnits)
public boolean buildVerts(DrawContext dc, RectangularTessellator.RectTile tile, boolean makeSkirts)
protected java.util.ArrayList<LatLon> computeLocations(RectangularTessellator.RectTile tile)
protected double computeTileResolutionTarget(DrawContext dc, RectangularTessellator.RectTile tile)
protected RectangularTessellator.CacheKey createCacheKey(DrawContext dc, RectangularTessellator.RectTile tile)
protected static void createIndices(int density)
protected static double createPosition(int start, double decimal, int density)
start
- the number of the column or row to the left, below or on this positiondecimal
- the distance from the left or bottom of the current sector that this position fallsdensity
- the number of intervals along the sector's sideprotected static void createTextureCoordinates(int density)
protected RectangularTessellator.RectTile createTile(DrawContext dc, Sector tileSector, int level)
protected java.util.ArrayList<RectangularTessellator.RectTile> createTopLevelTiles(DrawContext dc)
public void endRendering(DrawContext dc)
protected int[] fillIndexListVbo(DrawContext dc, int density, java.nio.IntBuffer indices)
protected int[] fillTextureCoordsVbo(DrawContext dc, int density, java.nio.FloatBuffer texCoords)
protected Vec4 getSurfacePoint(RectangularTessellator.RectTile tile, Angle latitude, Angle longitude)
protected Vec4 getSurfacePoint(RectangularTessellator.RectTile tile, Angle latitude, Angle longitude, double metersOffset)
public long getUpdateFrequency()
Tessellator
getUpdateFrequency
in interface Tessellator
protected static Vec4 interpolate(int row, int column, double xDec, double yDec, RectangularTessellator.RenderInfo ri)
Point
that sits at xDec
offset from column
to column +
1
and at yDec
offset from row
to row + 1
. Accounts for the
diagonals.row
- represents the row which corresponds to a yDec
value of 0column
- represents the column which corresponds to an xDec
value of 0xDec
- constrained to [0,1]yDec
- constrained to [0,1]ri
- the render info holding the vertices, etc.Point
geometrically within or on the boundary of the quadrilateral whose bottom left
corner is indexed by (row
, column
)protected static Vec4 interpolate(Vec4 bL, Vec4 bR, Vec4 tR, Vec4 tL, double xDec, double yDec)
bL
- the bottom left cornerbR
- the bottom right cornertR
- the top right cornertL
- the top left cornerxDec
- how far along, [0,1] 0 = left edge, 1 = right edgeyDec
- how far along, [0,1] 0 = bottom edge, 1 = top edgeprotected Intersection[] intersect(RectangularTessellator.RectTile tile, double elevation)
protected Intersection[] intersect(RectangularTessellator.RectTile tile, Line line)
RectTile
geometry.tile
- the RectTile
which geometry is to be tested for intersection.line
- the ray for which an intersection is to be found.Intersection
sorted by increasing distance from the line origin, or null if no
intersection was found.public boolean isMakeTileSkirts()
Tessellator
isMakeTileSkirts
in interface Tessellator
protected java.nio.DoubleBuffer makeGeographicTexCoords(SectorGeometry sg, SectorGeometry.GeographicTextureCoordinateComputer computer)
protected void makeVerts(DrawContext dc, RectangularTessellator.RectTile tile)
protected boolean needToSplit(DrawContext dc, RectangularTessellator.RectTile tile)
protected PickedObject[] pick(DrawContext dc, RectangularTessellator.RectTile tile, java.util.List<? extends java.awt.Point> pickPoints)
protected void pick(DrawContext dc, RectangularTessellator.RectTile tile, java.awt.Point pickPoint)
protected void render(DrawContext dc, RectangularTessellator.RectTile tile)
protected long render(DrawContext dc, RectangularTessellator.RectTile tile, int numTextureUnits)
protected void renderBoundingVolume(DrawContext dc, RectangularTessellator.RectTile tile)
protected void renderMultiTexture(DrawContext dc, RectangularTessellator.RectTile tile, int numTextureUnits)
protected void renderPatchBoundary(DrawContext dc, RectangularTessellator.RectTile tile)
protected void renderTileID(DrawContext dc, RectangularTessellator.RectTile tile)
protected void renderTrianglesWithUniqueColors(DrawContext dc, RectangularTessellator.RectTile tile)
Note: This method modifies the GL_VERTEX_ARRAY and GL_COLOR_ARRAY state and does not restore it. Callers should ensure that GL_CLIENT_VERTEX_ARRAY_BIT has been pushed, and eventually pop it when done using this method.
dc
- the current draw context.tile
- the tile to render.protected void renderVA(DrawContext dc, RectangularTessellator.RectTile tile, int numTextureUnits)
protected boolean renderVBO(DrawContext dc, RectangularTessellator.RectTile tile, int numTextureUnits)
protected void renderWireframe(DrawContext dc, RectangularTessellator.RectTile tile, boolean showTriangles, boolean showTileBoundary)
protected PickedObject resolvePick(DrawContext dc, RectangularTessellator.RectTile tile, java.awt.Point pickPoint)
protected void selectVisibleTiles(DrawContext dc, RectangularTessellator.RectTile tile)
public void setMakeTileSkirts(boolean makeTileSkirts)
Tessellator
setMakeTileSkirts
in interface Tessellator
makeTileSkirts
- true if skirts are created, otherwise false.public void setUpdateFrequency(long updateFrequency)
Tessellator
setUpdateFrequency
in interface Tessellator
updateFrequency
- the update frequency, in milliseconds.protected boolean skipTile(DrawContext dc, Sector sector)
dc
- the current draw context. The globe contained in the context must be a Globe2D
.sector
- the tile's sector.true
if the tile should be skipped -- it's outside the globe's projection limits --
otherwise false
.protected RectangularTessellator.RectTile[] split(DrawContext dc, RectangularTessellator.RectTile tile)
public SectorGeometryList tessellate(DrawContext dc)
Tessellator
tessellate
in interface Tessellator
dc
- the current draw context.