Package gov.nasa.worldwind.render
Class SurfacePolylines
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.render.AbstractSurfaceObject
-
- gov.nasa.worldwind.render.AbstractSurfaceShape
-
- gov.nasa.worldwind.render.SurfacePolylines
-
- All Implemented Interfaces:
AVList,Draggable,MessageListener,ExtentHolder,MeasurableArea,MeasurableLength,Movable,Movable2,Attributable,Highlightable,OrderedRenderable,PreRenderable,Renderable,SurfaceObject,SurfaceRenderable,SurfaceShape,Restorable,Combinable,WWObject,java.beans.PropertyChangeListener,java.util.EventListener
- Direct Known Subclasses:
SurfacePolygons
public class SurfacePolylines extends AbstractSurfaceShape
This class renders fast multiple surface polylines in one pass. It relies on aCompoundVecBuffer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.AbstractSurfaceShape
AbstractSurfaceShape.GeometryKey, AbstractSurfaceShape.SurfaceShapeStateKey
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.AbstractSurfaceObject
AbstractSurfaceObject.CacheEntry, AbstractSurfaceObject.SurfaceObjectStateKey
-
-
Field Summary
Fields Modifier and Type Field Description protected CompoundVecBufferbufferprotected booleancrossesDateLineprotected booleanneedsOutlineTessellationprotected java.lang.ObjectoutlineDisplayListCacheKeyprotected java.util.List<Sector>sectors-
Fields inherited from class gov.nasa.worldwind.render.AbstractSurfaceShape
activeAttrs, activeGeometry, activeOutlineGeometry, areaMeasurer, areaMeasurerLastModifiedTime, DEFAULT_HIGHLIGHT_MATERIAL, DEFAULT_INTERIOR_MATERIAL, DEFAULT_MAX_EDGE_INTERVALS, DEFAULT_MIN_EDGE_INTERVALS, DEFAULT_OUTLINE_MATERIAL, DEFAULT_PATH_TYPE, DEFAULT_TEXELS_PER_EDGE_INTERVAL, defaultAttrs, dragEnabled, draggableSupport, geometryCache, highlightAttrs, highlighted, maxEdgeIntervals, minEdgeIntervals, normalAttrs, pathType, sectorCache, stackHandler, texelsPerEdgeInterval, texture, vertexBuffer
-
Fields inherited from class gov.nasa.worldwind.render.AbstractSurfaceObject
delegateOwner, drawBoundingSectors, enableBatchPicking, extentCache, lastModifiedTime, nextUniqueId, pickLayer, pickSupport, pickTileBuilder, uniqueId, visible
-
-
Constructor Summary
Constructors Constructor Description SurfacePolylines(Sector sector, CompoundVecBuffer buffer)SurfacePolylines(CompoundVecBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanContainPole()Indicates whether the shape is a closed polygon that can enclose a pole, or an open path that cannot.protected java.util.List<java.util.List<LatLon>>createGeometry(Globe globe, double edgeIntervalsPerDegree)protected java.util.List<java.util.List<LatLon>>createGeometry(Globe globe, SurfaceTileDrawContext sdc)protected voiddetermineActiveGeometry(DrawContext dc, SurfaceTileDrawContext sdc)protected voiddoMoveTo(Position oldReferencePosition, Position newReferencePosition)protected voiddoMoveTo(Globe globe, Position oldReferencePosition, Position newReferencePosition)protected voiddrawInterior(DrawContext dc, SurfaceTileDrawContext sdc)protected voiddrawOutline(DrawContext dc, SurfaceTileDrawContext sdc)CompoundVecBuffergetBuffer()Get the underlyingCompoundVecBufferdescribing the geometry.java.lang.Iterable<? extends LatLon>getLocations()java.lang.Iterable<? extends LatLon>getLocations(Globe globe)Returns the shape's locations as they appear on the specifiedglobe, or null if the shape has no locations.PositiongetReferencePosition()A position associated with the object that indicates its aggregate geographic position.java.util.List<Sector>getSectors(DrawContext dc)Returns a list of sectors indicating the geographic region that bounds this renderable for the specified draw context.protected voidonGeometryChanged()voidsetLocations(java.lang.Iterable<? extends LatLon> iterable)protected int[]tessellateOutline(DrawContext dc, LatLon referenceLocation)protected booleantessellatePart(com.jogamp.opengl.GL2 gl, VecBuffer vecBuffer, LatLon referenceLocation)-
Methods inherited from class gov.nasa.worldwind.render.AbstractSurfaceShape
addIntermediateLocations, applyInteriorState, applyInteriorTextureState, applyModelviewTransform, applyOutlineState, beginDrawing, clearCaches, combine, combineBounds, combineContours, computeEdgeIntervalsPerDegree, computeEdgeIntervalsPerDegree, computeSectors, computeSectors, containsPole, createActiveAttributes, createGeometryKey, cutAlongDateLine, determineActiveAttributes, doCombineContour, doCombineContours, doDrag, doDrawGeographic, doGetRestorableState, doRestoreState, doTessellateInterior, drag, drawGeographic, drawLineStrip, endDrawing, export, exportAsKML, generateIntermediateLocations, getActiveAttributes, getActiveGeometry, getArea, getArea, getAttributes, getCachedGeometry, getExtent, getHeight, getHighlightAttributes, getInteriorTexture, getLength, getMinAndMaxEdgeIntervals, getPathType, getPerimeter, getRestorableState, getStateKey, getTexelsPerEdgeInterval, getWidth, handleUnsuccessfulInteriorTessellation, isDragEnabled, isExportFormatSupported, isHighlighted, isSectorEmpty, legacyRestoreState, makeOrderedPreRenderable, move, moveTo, moveTo, pathTypeFromString, repeatAroundDateline, restoreState, setAttributes, setDragEnabled, setHighlightAttributes, setHighlighted, setMinAndMaxEdgeIntervals, setPathType, setTexelsPerEdgeInterval, setupAreaMeasurer, tessellateInterior, tessellateInteriorVertices
-
Methods inherited from class gov.nasa.worldwind.render.AbstractSurfaceObject
buildPickRepresentation, computeExtent, computeExtent, createPickedObject, createPickTileBuilder, drawBoundingSectors, drawOrderedRenderable, drawPickRepresentation, getDelegateOwner, getDistanceFromEye, getExtent, getUniqueId, intersectsFrustum, intersectsPickFrustum, intersectsVisibleSector, isDrawBoundingSectors, isEnableBatchPicking, isVisible, makeOrderedRenderable, nextUniqueId, onShapeChanged, pick, pickBatched, pickOrderedRenderable, preRender, render, setDelegateOwner, setDrawBoundingSectors, setEnableBatchPicking, setVisible, updateModifiedTime
-
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
-
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
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
-
Methods inherited from interface gov.nasa.worldwind.render.SurfaceObject
getDelegateOwner, getDistanceFromEye, getExtent, isEnableBatchPicking, isVisible, pick, preRender, setDelegateOwner, setEnableBatchPicking, setVisible
-
-
-
-
Field Detail
-
sectors
protected java.util.List<Sector> sectors
-
buffer
protected CompoundVecBuffer buffer
-
needsOutlineTessellation
protected boolean needsOutlineTessellation
-
crossesDateLine
protected boolean crossesDateLine
-
outlineDisplayListCacheKey
protected java.lang.Object outlineDisplayListCacheKey
-
-
Constructor Detail
-
SurfacePolylines
public SurfacePolylines(CompoundVecBuffer buffer)
-
SurfacePolylines
public SurfacePolylines(Sector sector, CompoundVecBuffer buffer)
-
-
Method Detail
-
getBuffer
public CompoundVecBuffer getBuffer()
Get the underlyingCompoundVecBufferdescribing the geometry.- Returns:
- the underlying
CompoundVecBuffer.
-
getSectors
public java.util.List<Sector> getSectors(DrawContext dc)
Description copied from interface:SurfaceRenderableReturns a list of sectors indicating the geographic region that bounds this renderable for the specified draw context.The returned list typically contains one sector that bounds this renderable in geographic coordinates. When this renderable spans the anti-meridian - the +/- 180 degree meridian - the returned list contains two sectors, one on either side of the anti-meridian.
- Specified by:
getSectorsin interfaceSurfaceRenderable- Overrides:
getSectorsin classAbstractSurfaceShape- Parameters:
dc- the draw context for which to determine this renderable's geographic bounds.- Returns:
- a list of one or two sectors that bound this renderable.
-
getLocations
public java.lang.Iterable<? extends LatLon> getLocations(Globe globe)
Description copied from interface:SurfaceShapeReturns the shape's locations as they appear on the specifiedglobe, or null if the shape has no locations.- Parameters:
globe- the globe the shape is related to.- Returns:
- the shapes locations on the globe, or null if the shape has no locations.
-
createGeometry
protected java.util.List<java.util.List<LatLon>> createGeometry(Globe globe, SurfaceTileDrawContext sdc)
- Overrides:
createGeometryin classAbstractSurfaceShape
-
createGeometry
protected java.util.List<java.util.List<LatLon>> createGeometry(Globe globe, double edgeIntervalsPerDegree)
- Specified by:
createGeometryin classAbstractSurfaceShape
-
getLocations
public java.lang.Iterable<? extends LatLon> getLocations()
-
setLocations
public void setLocations(java.lang.Iterable<? extends LatLon> iterable)
-
getReferencePosition
public Position getReferencePosition()
Description copied from interface:MovableA position associated with the object that indicates its aggregate geographic position. The chosen position varies among implementers of this interface. For objects defined by a list of positions, the reference position is typically the first position in the list. For symmetric objects the reference position is often the center of the object. In many cases the object's reference position may be explicitly specified by the application.- Specified by:
getReferencePositionin interfaceMovable- Specified by:
getReferencePositionin interfaceMovable2- Specified by:
getReferencePositionin classAbstractSurfaceShape- Returns:
- the object's reference position, or null if no reference position is available.
-
canContainPole
protected boolean canContainPole()
Indicates whether the shape is a closed polygon that can enclose a pole, or an open path that cannot. This makes a difference when computing the bounding sector for a shape. For example, consider the positions (-100, 85), (0, 80), (100, 80). If these positions are treated as a closed polygon (a triangle over the North Pole) then the bounding sector is 80 to 90 lat, -180 to 180 lon. But if they are treated as an open path (a line wrapping partway around the pole) then the bounding sector is 80 to 85 lat, -100 to 100 lon. Overridden to treat the polylines as open paths rather than closed polygons.- Overrides:
canContainPolein classAbstractSurfaceShape- Returns:
- True if the shape is a closed polygon that can contain a pole, or false if it is treated as an open path that cannot contain a pole.
-
doMoveTo
protected void doMoveTo(Position oldReferencePosition, Position newReferencePosition)
- Specified by:
doMoveToin classAbstractSurfaceShape
-
doMoveTo
protected void doMoveTo(Globe globe, Position oldReferencePosition, Position newReferencePosition)
- Specified by:
doMoveToin classAbstractSurfaceShape
-
onGeometryChanged
protected void onGeometryChanged()
-
determineActiveGeometry
protected void determineActiveGeometry(DrawContext dc, SurfaceTileDrawContext sdc)
- Overrides:
determineActiveGeometryin classAbstractSurfaceShape
-
drawInterior
protected void drawInterior(DrawContext dc, SurfaceTileDrawContext sdc)
- Overrides:
drawInteriorin classAbstractSurfaceShape
-
drawOutline
protected void drawOutline(DrawContext dc, SurfaceTileDrawContext sdc)
- Overrides:
drawOutlinein classAbstractSurfaceShape
-
tessellateOutline
protected int[] tessellateOutline(DrawContext dc, LatLon referenceLocation)
-
-