Package gov.nasa.worldwind.render
Class Path.PathData
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.cache.ShapeDataCache.ShapeDataCacheEntry
-
- gov.nasa.worldwind.render.AbstractShape.AbstractShapeData
-
- gov.nasa.worldwind.render.Path.PathData
-
- All Implemented Interfaces:
AVList
- Direct Known Subclasses:
MultiResolutionPath.MultiResolutionPathData
- Enclosing class:
- Path
protected static class Path.PathData extends AbstractShape.AbstractShapeData
Maintains globe-dependent computed data such as Cartesian vertices and extents. One entry exists for each distinct globe that this shape encounters in calls toAbstractShape.render(DrawContext)
. SeeAbstractShape
.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
colorOffset
Indicates the offset in number of floats to the first RGBA color tuple inrenderedPath
.protected boolean
hasExtrusionPoints
Indicates whether the rendered path has extrusion points in addition to path points.protected java.nio.IntBuffer
path2DIndices
Indices of tessellated path lines when using 2D globe and the path crosses the dateline.protected java.nio.IntBuffer
polePositions
Indices to therenderedPath
identifying the vertices of the originally specified boundary positions and their corresponding terrain point.protected java.nio.IntBuffer
positionPoints
Indices to therenderedPath
identifying the vertices of the originally specified boundary positions.protected java.nio.FloatBuffer
renderedPath
The model coordinate vertices to render, all relative to this shape data's reference center.protected java.util.ArrayList<java.lang.Integer>
splitPositions
Indices of the tessellated positions at which new lines must be formed rather than continuing the previous line.protected java.util.ArrayList<java.awt.Color>
tessellatedColors
The colors corresponding to each tessellated position, ornull
if the path'spositionColors
isnull
.protected java.util.ArrayList<Position>
tessellatedPositions
The positions formed from applying path type and terrain conformance.protected int
vertexCount
Indicates the number of vertices represented byrenderedPath
.protected int
vertexStride
Indicates the stride in number of floats between the first element of consecutive vertices inrenderedPath
.-
Fields inherited from class gov.nasa.worldwind.render.AbstractShape.AbstractShapeData
frameNumber, referenceDistance, referencePoint, vboCacheKey
-
Fields inherited from class gov.nasa.worldwind.cache.ShapeDataCache.ShapeDataCacheEntry
extent, eyeDistance, globeStateKey, lastUsed, timer, timerAdjustedEyeDistance, verticalExaggeration
-
-
Constructor Summary
Constructors Constructor Description PathData(DrawContext dc, Path shape)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColorOffset()
Indicates the offset in number of floats to the first RGBA color tuple inrenderedPath
.java.nio.IntBuffer
getPolePositions()
Returns a buffer of indices into the rendered path (renderedPath
that identify the top and bottom vertices of this path's vertical line segments.java.nio.IntBuffer
getPositionPoints()
Returns a buffer of indices into the rendered path (renderedPath
that identify the originally specified positions that remain after tessellation.java.nio.FloatBuffer
getRenderedPath()
The Cartesian coordinates of the tessellated positions.java.util.List<java.awt.Color>
getTessellatedColors()
Indicates the colors corresponding to each position intessellatedPositions
, ornull
if the path does not have per-position colors.java.util.List<Position>
getTessellatedPositions()
The positions resulting from tessellating this path.int
getVertexCount()
Indicates the number of vertices inrenderedPath
.int
getVertexStride()
Indicates the stride in number of floats between the first element of consecutive vertices inrenderedPath
.boolean
isHasExtrusionPoints()
Indicates whether this path is extruded and the extrusion points have been computed.void
setColorOffset(int offset)
Specifies the offset in number of floats to the first RGBA color tuple inrenderedPath
.void
setHasExtrusionPoints(boolean hasExtrusionPoints)
void
setPolePositions(java.nio.IntBuffer polePositions)
void
setPositionPoints(java.nio.IntBuffer posPoints)
void
setRenderedPath(java.nio.FloatBuffer renderedPath)
void
setTessellatedColors(java.util.ArrayList<java.awt.Color> tessellatedColors)
Specifies the colors corresponding to each position intessellatedPositions
, ornull
to specify that the path does not have per-position colors.void
setTessellatedPositions(java.util.ArrayList<Position> tessellatedPositions)
void
setVertexCount(int count)
Specifies the number of vertices inrenderedPath
.void
setVertexStride(int stride)
Specifies the stride in number of floats between the first element of consecutive vertices inrenderedPath
.-
Methods inherited from class gov.nasa.worldwind.render.AbstractShape.AbstractShapeData
getFrameNumber, getReferenceDistance, getReferencePoint, getVboCacheKey, setFrameNumber, setReferenceDistance, setReferencePoint, setVboCacheKey
-
Methods inherited from class gov.nasa.worldwind.cache.ShapeDataCache.ShapeDataCacheEntry
adjustTimer, getExtent, getEyeDistance, getGlobeStateKey, getTimer, getVerticalExaggeration, isExpired, isValid, restartTimer, setExpired, setExtent, setEyeDistance, setGlobeStateKey, setTimer, setVerticalExaggeration
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
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
-
-
-
-
Field Detail
-
tessellatedPositions
protected java.util.ArrayList<Position> tessellatedPositions
The positions formed from applying path type and terrain conformance.
-
tessellatedColors
protected java.util.ArrayList<java.awt.Color> tessellatedColors
The colors corresponding to each tessellated position, ornull
if the path'spositionColors
isnull
.
-
renderedPath
protected java.nio.FloatBuffer renderedPath
The model coordinate vertices to render, all relative to this shape data's reference center. If the path is extruded, the base vertices are interleaved: Vcap, Vbase, Vcap, Vbase, ...
-
polePositions
protected java.nio.IntBuffer polePositions
Indices to therenderedPath
identifying the vertices of the originally specified boundary positions and their corresponding terrain point. This is used to draw vertical lines at those positions when the path is extruded.
-
positionPoints
protected java.nio.IntBuffer positionPoints
Indices to therenderedPath
identifying the vertices of the originally specified boundary positions. (Not their terrain points as well, aspolePositions
does.)
-
path2DIndices
protected java.nio.IntBuffer path2DIndices
Indices of tessellated path lines when using 2D globe and the path crosses the dateline.
-
splitPositions
protected java.util.ArrayList<java.lang.Integer> splitPositions
Indices of the tessellated positions at which new lines must be formed rather than continuing the previous line. Used only when the path's positions span the dateline and a 2D globe is being used.
-
hasExtrusionPoints
protected boolean hasExtrusionPoints
Indicates whether the rendered path has extrusion points in addition to path points.
-
colorOffset
protected int colorOffset
Indicates the offset in number of floats to the first RGBA color tuple inrenderedPath
. This is0
ifrenderedPath
has no RGBA color tuples.
-
vertexStride
protected int vertexStride
Indicates the stride in number of floats between the first element of consecutive vertices inrenderedPath
.
-
vertexCount
protected int vertexCount
Indicates the number of vertices represented byrenderedPath
.
-
-
Constructor Detail
-
PathData
public PathData(DrawContext dc, Path shape)
-
-
Method Detail
-
getTessellatedPositions
public java.util.List<Position> getTessellatedPositions()
The positions resulting from tessellating this path. If the path's attributes don't cause tessellation, then the positions returned are those originally specified.- Returns:
- the positions computed by path tessellation.
-
setTessellatedPositions
public void setTessellatedPositions(java.util.ArrayList<Position> tessellatedPositions)
-
getTessellatedColors
public java.util.List<java.awt.Color> getTessellatedColors()
Indicates the colors corresponding to each position intessellatedPositions
, ornull
if the path does not have per-position colors.- Returns:
- the colors corresponding to each path position, or
null
if the path does not have per-position colors.
-
setTessellatedColors
public void setTessellatedColors(java.util.ArrayList<java.awt.Color> tessellatedColors)
Specifies the colors corresponding to each position intessellatedPositions
, ornull
to specify that the path does not have per-position colors. The entries in the specified list must have a one-to-one correspondence with the entries intessellatedPositions
.- Parameters:
tessellatedColors
- the colors corresponding to each path position, ornull
if the path does not have per-position colors.
-
getRenderedPath
public java.nio.FloatBuffer getRenderedPath()
The Cartesian coordinates of the tessellated positions. If path verticals are enabled, this path also contains the ground points corresponding to the path positions.- Returns:
- the Cartesian coordinates of the tessellated positions.
-
setRenderedPath
public void setRenderedPath(java.nio.FloatBuffer renderedPath)
-
getPositionPoints
public java.nio.IntBuffer getPositionPoints()
Returns a buffer of indices into the rendered path (renderedPath
that identify the originally specified positions that remain after tessellation. These positions are those of the position dots, if drawn.- Returns:
- the path's originally specified positions that survived tessellation.
-
setPositionPoints
public void setPositionPoints(java.nio.IntBuffer posPoints)
-
getPolePositions
public java.nio.IntBuffer getPolePositions()
Returns a buffer of indices into the rendered path (renderedPath
that identify the top and bottom vertices of this path's vertical line segments.- Returns:
- the path's pole positions.
-
setPolePositions
public void setPolePositions(java.nio.IntBuffer polePositions)
-
isHasExtrusionPoints
public boolean isHasExtrusionPoints()
Indicates whether this path is extruded and the extrusion points have been computed.- Returns:
- true if the path is extruded and the extrusion points are computed, otherwise false.
-
setHasExtrusionPoints
public void setHasExtrusionPoints(boolean hasExtrusionPoints)
-
getColorOffset
public int getColorOffset()
Indicates the offset in number of floats to the first RGBA color tuple inrenderedPath
. This returns0
ifrenderedPath
has no RGBA color tuples.- Returns:
- the offset in number of floats to the first RGBA color tuple in
renderedPath
.
-
setColorOffset
public void setColorOffset(int offset)
Specifies the offset in number of floats to the first RGBA color tuple inrenderedPath
. Specify 0 ifrenderedPath
has no RGBA color tuples.- Parameters:
offset
- the offset in number of floats to the first RGBA color tuple inrenderedPath
.
-
getVertexStride
public int getVertexStride()
Indicates the stride in number of floats between the first element of consecutive vertices inrenderedPath
.- Returns:
- the stride in number of floats between vertices in in
renderedPath
.
-
setVertexStride
public void setVertexStride(int stride)
Specifies the stride in number of floats between the first element of consecutive vertices inrenderedPath
.- Parameters:
stride
- the stride in number of floats between vertices in inrenderedPath
.
-
getVertexCount
public int getVertexCount()
Indicates the number of vertices inrenderedPath
.- Returns:
- the the number of verices in
renderedPath
.
-
setVertexCount
public void setVertexCount(int count)
Specifies the number of vertices inrenderedPath
. Specify 0 ifrenderedPath
contains no vertices.- Parameters:
count
- the the number of vertices inrenderedPath
.
-
-