NASA World Wind

gov.nasa.worldwind.ogc.kml.impl
Class KMLSurfacePolygonImpl

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.render.AbstractSurfaceObject
              extended by gov.nasa.worldwind.render.AbstractSurfaceShape
                  extended by gov.nasa.worldwind.render.SurfacePolygon
                      extended by gov.nasa.worldwind.ogc.kml.impl.KMLSurfacePolygonImpl
All Implemented Interfaces:
AVList, MessageListener, Exportable, ExtentHolder, MeasurableArea, MeasurableLength, Movable, KMLRenderable, Highlightable, OrderedRenderable, PreRenderable, Renderable, SurfaceObject, SurfaceShape, Restorable, WWObject, PropertyChangeListener, EventListener

public class KMLSurfacePolygonImpl
extends SurfacePolygon
implements KMLRenderable


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
protected  boolean highlightAttributesResolved
           
protected  boolean mustApplyRotation
          Flag to indicate the rotation must be applied to the SurfaceImage.
protected  boolean normalAttributesResolved
           
protected  KMLAbstractFeature parent
           
 
Fields inherited from class gov.nasa.worldwind.render.SurfacePolygon
boundaries
 
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, 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, pickTiles, uniqueId, visible
 
Fields inherited from interface gov.nasa.worldwind.Exportable
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
 
Constructor Summary
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
protected  void applyRotation(DrawContext dc)
          Apply a rotation to the corner points of the overlay.
protected  PickedObject createPickedObject(DrawContext dc, Color pickColor)
          Create a PickedObject for this surface object.
protected  ShapeAttributes getInitialAttributes(String attrType)
           
protected  ShapeAttributes makeAttributesCurrent(String attrType)
          Determine and set the Path highlight attributes from the KML Feature fields.
 void onMessage(Message message)
          Empty implementation of MessageListener.
 void preRender(KMLTraversalContext tc, DrawContext dc)
          Pre-render this element.
 void render(KMLTraversalContext tc, DrawContext dc)
          Render this element.
 
Methods inherited from class gov.nasa.worldwind.render.SurfacePolygon
addInnerBoundary, createGeometry, doGetRestorableState, doMoveTo, doRestoreState, exportAsKML, getBoundaries, getLocations, getLocations, getOuterBoundary, getReferencePosition, handleUnsuccessfulInteriorTessellation, legacyRestoreState, setLocations, setOuterBoundary
 
Methods inherited from class gov.nasa.worldwind.render.AbstractSurfaceShape
addIntermediateLocations, applyInteriorState, applyInteriorTextureState, applyModelviewTransform, applyOutlineState, beginDrawing, canContainPole, clearCaches, computeEdgeIntervalsPerDegree, computeSectors, computeSectors, containsPole, createActiveAttributes, createGeometryKey, cutAlongDateLine, determineActiveAttributes, determineActiveGeometry, doDrawGeographic, doTessellateInterior, drawGeographic, drawInterior, drawOutline, endDrawing, export, generateIntermediateLocations, getActiveAttributes, getActiveGeometry, getArea, getArea, getAttributes, getCachedGeometry, getExtent, getHeight, getHighlightAttributes, getInteriorTexture, getLength, getMinAndMaxEdgeIntervals, getPathType, getPerimeter, getRestorableState, getSectors, getStateKey, getTexelsPerEdgeInterval, getWidth, intersectionWithMeridian, isExportFormatSupported, isHighlighted, isSectorEmpty, makeOrderedPreRenderable, move, moveTo, onShapeChanged, pathTypeFromString, repeatAroundDateline, restoreState, setAttributes, 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, 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.Exportable
export, isExportFormatSupported
 
Methods inherited from interface gov.nasa.worldwind.render.SurfaceObject
getDelegateOwner, getDistanceFromEye, getExtent, isVisible, pick, preRender, render, setDelegateOwner, setVisible
 
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
 

Field Detail

highlightAttributesResolved

protected boolean highlightAttributesResolved

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.


normalAttributesResolved

protected boolean normalAttributesResolved

parent

protected final KMLAbstractFeature parent
Constructor Detail

KMLSurfacePolygonImpl

public KMLSurfacePolygonImpl(KMLTraversalContext tc,
                             KMLGroundOverlay overlay)
Create a surface polygon from a KML GroundOverlay.

Parameters:
tc - the current KMLTraversalContext.
overlay - the KMLGroundOverlay to render as a polygon.
Throws:
NullPointerException - if the geometry is null.
IllegalArgumentException - if the parent placemark or the traversal context is null.

KMLSurfacePolygonImpl

public KMLSurfacePolygonImpl(KMLTraversalContext tc,
                             KMLPlacemark placemark,
                             KMLAbstractGeometry geom)
Create an instance.

Parameters:
tc - the current KMLTraversalContext.
placemark - the Placemark element containing the LineString.
geom - the KMLPolygon geometry.
Throws:
NullPointerException - if the geometry is null.
IllegalArgumentException - if the parent placemark or the traversal context is null.
Method Detail

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.

createPickedObject

protected PickedObject createPickedObject(DrawContext dc,
                                          Color pickColor)
Create a PickedObject for this surface object. The PickedObject created by this method will be added to the pick list to represent the current surface object.

Overrides:
createPickedObject in class AbstractSurfaceObject
Parameters:
dc - Active draw context.
pickColor - Unique color for this PickedObject.
Returns:
A new picked object.

getInitialAttributes

protected ShapeAttributes getInitialAttributes(String attrType)

makeAttributesCurrent

protected ShapeAttributes makeAttributesCurrent(String attrType)
Determine and set the Path highlight attributes from the KML Feature fields.

Parameters:
attrType - the type of attributes, either KMLConstants.NORMAL or KMLConstants.HIGHLIGHT.
Returns:
the new attributes.

onMessage

public void onMessage(Message message)
Description copied from class: WWObjectImpl
Empty implementation of MessageListener.

Specified by:
onMessage in interface MessageListener
Overrides:
onMessage in class WWObjectImpl
Parameters:
message - The message that was received.

preRender

public void preRender(KMLTraversalContext tc,
                      DrawContext dc)
Description copied from interface: KMLRenderable
Pre-render this element.

Specified by:
preRender in interface KMLRenderable
Parameters:
tc - the current KML traversal context.
dc - the current draw context.

render

public void render(KMLTraversalContext tc,
                   DrawContext dc)
Description copied from interface: KMLRenderable
Render this element.

Specified by:
render in interface KMLRenderable
Parameters:
tc - the current KML traversal context.
dc - the current draw context.

NASA World Wind