Package gov.nasa.worldwind.ogc.kml.impl
Class KMLSurfacePolygonImpl
- 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.SurfacePolygon
-
- gov.nasa.worldwind.ogc.kml.impl.KMLSurfacePolygonImpl
-
- All Implemented Interfaces:
AVList,Draggable,MessageListener,Exportable,ExtentHolder,MeasurableArea,MeasurableLength,Movable,Movable2,KMLRenderable,Attributable,Highlightable,OrderedRenderable,PreRenderable,Renderable,SurfaceObject,SurfaceRenderable,SurfaceShape,Restorable,Combinable,WWObject,java.beans.PropertyChangeListener,java.util.EventListener
public class KMLSurfacePolygonImpl extends SurfacePolygon implements KMLRenderable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.SurfacePolygon
SurfacePolygon.ShapeData, SurfacePolygon.Vertex
-
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 booleanhighlightAttributesResolvedprotected booleanmustApplyRotationFlag to indicate the rotation must be applied to the SurfaceImage.protected booleannormalAttributesResolvedprotected KMLAbstractFeatureparent-
Fields inherited from class gov.nasa.worldwind.render.SurfacePolygon
boundaries, explicitTexture, explicitTextureCoords, shapeDataCache, tess, tessCallback
-
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
-
Fields inherited from interface gov.nasa.worldwind.Exportable
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
-
-
Constructor Summary
Constructors Constructor Description KMLSurfacePolygonImpl(KMLTraversalContext tc, KMLGroundOverlay overlay)Create a surface polygon from a KML GroundOverlay.KMLSurfacePolygonImpl(KMLTraversalContext tc, KMLPlacemark placemark, KMLAbstractGeometry geom)Create an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyRotation(DrawContext dc)Apply a rotation to the corner points of the overlay.protected PickedObjectcreatePickedObject(DrawContext dc, java.awt.Color pickColor)Create aPickedObjectfor this surface object.protected ShapeAttributesgetInitialAttributes(java.lang.String attrType)protected ShapeAttributesmakeAttributesCurrent(java.lang.String attrType)Determine and set thePathhighlight attributes from the KML Feature fields.voidonMessage(Message message)Empty implementation of MessageListener.voidpreRender(KMLTraversalContext tc, DrawContext dc)Pre-render this element.voidrender(KMLTraversalContext tc, DrawContext dc)Render this element.-
Methods inherited from class gov.nasa.worldwind.render.SurfacePolygon
addInnerBoundary, applyInteriorState, assembleContours, clearCaches, clipWithDateline, clipWithPole, closeContour, createGeometry, doDrawGeographic, doGetRestorableState, doMoveTo, doMoveTo, doRestoreState, exportAsKML, getBoundaries, getLocations, getLocations, getOuterBoundary, getReferencePosition, getTextureCoords, getTextureImageSource, handleUnsuccessfulInteriorTessellation, legacyRestoreState, setLocations, setOuterBoundary, setTextureImageSource, subdivideContour, subdivideEdge, tessellateContours, uvWeightedAverage
-
Methods inherited from class gov.nasa.worldwind.render.AbstractSurfaceShape
addIntermediateLocations, applyInteriorTextureState, applyModelviewTransform, applyOutlineState, beginDrawing, canContainPole, combine, combineBounds, combineContours, computeEdgeIntervalsPerDegree, computeEdgeIntervalsPerDegree, computeSectors, computeSectors, containsPole, createActiveAttributes, createGeometry, createGeometryKey, cutAlongDateLine, determineActiveAttributes, determineActiveGeometry, doCombineContour, doCombineContours, doDrag, doTessellateInterior, drag, drawGeographic, drawInterior, drawLineStrip, drawOutline, endDrawing, export, generateIntermediateLocations, getActiveAttributes, getActiveGeometry, getArea, getArea, getAttributes, getCachedGeometry, getExtent, getHeight, getHighlightAttributes, getInteriorTexture, getLength, getMinAndMaxEdgeIntervals, getPathType, getPerimeter, getRestorableState, getSectors, getStateKey, getTexelsPerEdgeInterval, getWidth, isDragEnabled, isExportFormatSupported, isHighlighted, isSectorEmpty, 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, 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
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.Exportable
export, isExportFormatSupported
-
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
-
parent
protected final KMLAbstractFeature parent
-
highlightAttributesResolved
protected boolean highlightAttributesResolved
-
normalAttributesResolved
protected boolean normalAttributesResolved
-
mustApplyRotation
protected boolean mustApplyRotation
Flag to indicate the rotation must be applied to the SurfaceImage. Rotation is applied the first time that the image is rendered.
-
-
Constructor Detail
-
KMLSurfacePolygonImpl
public KMLSurfacePolygonImpl(KMLTraversalContext tc, KMLPlacemark placemark, KMLAbstractGeometry geom)
Create an instance.- Parameters:
tc- the currentKMLTraversalContext.placemark- the Placemark element containing the LineString.geom- theKMLPolygongeometry.- Throws:
java.lang.NullPointerException- if the geometry is null.java.lang.IllegalArgumentException- if the parent placemark or the traversal context is null.
-
KMLSurfacePolygonImpl
public KMLSurfacePolygonImpl(KMLTraversalContext tc, KMLGroundOverlay overlay)
Create a surface polygon from a KML GroundOverlay.- Parameters:
tc- the currentKMLTraversalContext.overlay- theKMLGroundOverlayto render as a polygon.- Throws:
java.lang.NullPointerException- if the geometry is null.java.lang.IllegalArgumentException- if the parent placemark or the traversal context is null.
-
-
Method Detail
-
preRender
public void preRender(KMLTraversalContext tc, DrawContext dc)
Description copied from interface:KMLRenderablePre-render this element.- Specified by:
preRenderin interfaceKMLRenderable- Parameters:
tc- the current KML traversal context.dc- the current draw context.
-
render
public void render(KMLTraversalContext tc, DrawContext dc)
Description copied from interface:KMLRenderableRender this element.- Specified by:
renderin interfaceKMLRenderable- Parameters:
tc- the current KML traversal context.dc- the current draw context.
-
createPickedObject
protected PickedObject createPickedObject(DrawContext dc, java.awt.Color pickColor)
Create aPickedObjectfor this surface object. The PickedObject created by this method will be added to the pick list to represent the current surface object.- Overrides:
createPickedObjectin classAbstractSurfaceObject- Parameters:
dc- Active draw context.pickColor- Unique color for this PickedObject.- Returns:
- A new picked object.
-
makeAttributesCurrent
protected ShapeAttributes makeAttributesCurrent(java.lang.String attrType)
Determine and set thePathhighlight attributes from the KML Feature fields.- Parameters:
attrType- the type of attributes, eitherKMLConstants.NORMALorKMLConstants.HIGHLIGHT.- Returns:
- the new attributes.
-
getInitialAttributes
protected ShapeAttributes getInitialAttributes(java.lang.String attrType)
-
onMessage
public void onMessage(Message message)
Description copied from class:WWObjectImplEmpty implementation of MessageListener.- Specified by:
onMessagein interfaceMessageListener- Overrides:
onMessagein classWWObjectImpl- Parameters:
message- The message that was received.
-
applyRotation
protected void applyRotation(DrawContext dc)
Apply a rotation to the corner points of the overlay. This method is called the first time the polygon is rendered, if the position is specified using a rotated LatLon box.- Parameters:
dc- Current draw context.
-
-