NASA World Wind

gov.nasa.worldwindx.examples.shapebuilder
Class ExtrudedPolygonEditor

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.layers.AbstractLayer
              extended by gov.nasa.worldwindx.examples.shapebuilder.AbstractShapeEditor
                  extended by gov.nasa.worldwindx.examples.shapebuilder.ExtrudedPolygonEditor
All Implemented Interfaces:
AVList, Disposable, MessageListener, Layer, Restorable, WWObject, MouseListener, MouseMotionListener, PropertyChangeListener, EventListener

public class ExtrudedPolygonEditor
extends AbstractShapeEditor


Nested Class Summary
protected static class ExtrudedPolygonEditor.ControlPointMarker
           
 
Field Summary
protected  ExtrudedPolygonEditor.ControlPointMarker activeControlPoint
           
protected  int activeControlPointIndex
           
static String CHANGE_HEIGHT_ACTION
           
protected  BasicMarkerAttributes heightControlAttributes
           
protected  MarkerRenderer markerRenderer
           
static String MOVE_POLYGON_ACTION
           
static String MOVE_VERTEX_ACTION
           
protected  ExtrudedPolygon polygon
           
protected  BasicMarkerAttributes vertexControlAttributes
           
 
Fields inherited from class gov.nasa.worldwindx.examples.shapebuilder.AbstractShapeEditor
aboveGround, ACCUMULATED_LABEL, activeAction, ALTITUDE_LABEL, altitudeMode, ANGLE_LABEL, annotation, annotationAttributes, AREA_LABEL, armed, CENTER_ALTITUDE_LABEL, CENTER_LATITUDE_LABEL, CENTER_LONGITUDE_LABEL, EAST_SKEW_LABEL, editMode, frameTimestamp, HEADING_LABEL, HEIGHT_LABEL, LATITUDE_LABEL, LENGTH_LABEL, LONGITUDE_LABEL, MAJOR_AXIS_LABEL, MINOR_AXIS_LABEL, mousePoint, NORTH_SKEW_LABEL, PERIMETER_LABEL, RADIUS_LABEL, ROLL_LABEL, showAnnotation, TILT_LABEL, unitsFormat, WIDTH_LABEL, wwd
 
Constructor Summary
ExtrudedPolygonEditor()
           
 
Method Summary
protected  void addVertex(Point mousePoint)
          Add a vertex to the polygon's outer boundary.
protected  void assembleControlPoints(DrawContext dc)
           
protected  void assembleHeightControlPoints()
           
protected  void assembleMarkerAttributes()
           
protected  void assembleVertexControlPoints(DrawContext dc)
           
protected  Vec4 computeAnnotationPosition(Position pos)
           
protected  void doPick(DrawContext dc, Point point)
           
protected  void doRender(DrawContext dc)
           
protected  String formatMeasurements(Position pos)
           
protected  String getDisplayString(Position pos)
           
 String getEditMode()
           
 ExtrudedPolygon getPolygon()
           
protected  Vec4 intersectPolygonAltitudeAt(Line ray)
          Determine the point at which a ray intersects a the globe at the elevation of the polygon.
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
protected  void moveControlPoint(ExtrudedPolygonEditor.ControlPointMarker controlPoint, Point lastMousePoint, Point moveToPoint)
           
protected  void movePolygon(Point previousMousePoint, Point mousePoint)
           
protected  void removeVertex(ExtrudedPolygonEditor.ControlPointMarker vertexToRemove)
          Remove a vertex from the polygon.
 void setEditMode(String editMode)
           
 void setPolygon(ExtrudedPolygon polygon)
           
protected  void setPolygonHeight(Point previousMousePoint, Point mousePoint)
           
 void setShape(AbstractShape shape)
           
 void updateAnnotation(Position pos)
           
 
Methods inherited from class gov.nasa.worldwindx.examples.shapebuilder.AbstractShapeEditor
arePositionsRedundant, getAltitudeMode, getAnnotationAttributes, getLabel, getWorldWindow, initializeAnnotation, isAboveGround, isArmed, isShowAnnotation, setAboveGround, setAltitudeMode, setAnnotationAttributes, setArmed, setInitialLabels, setLabel, setShowAnnotation, setWorldWindow
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
createLayerConfigElements, dispose, doPreRender, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMaxEffectiveAltitude, getMinActiveAltitude, getMinEffectiveAltitude, getName, getOpacity, getRestorableState, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerConfigDocument, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit, toString
 
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, finalize, getClass, hashCode, notify, notifyAll, 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 java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
 

Field Detail

activeControlPoint

protected ExtrudedPolygonEditor.ControlPointMarker activeControlPoint

activeControlPointIndex

protected int activeControlPointIndex

CHANGE_HEIGHT_ACTION

public static final String CHANGE_HEIGHT_ACTION
See Also:
Constant Field Values

heightControlAttributes

protected BasicMarkerAttributes heightControlAttributes

markerRenderer

protected MarkerRenderer markerRenderer

MOVE_POLYGON_ACTION

public static final String MOVE_POLYGON_ACTION
See Also:
Constant Field Values

MOVE_VERTEX_ACTION

public static final String MOVE_VERTEX_ACTION
See Also:
Constant Field Values

polygon

protected ExtrudedPolygon polygon

vertexControlAttributes

protected BasicMarkerAttributes vertexControlAttributes
Constructor Detail

ExtrudedPolygonEditor

public ExtrudedPolygonEditor()
Method Detail

addVertex

protected void addVertex(Point mousePoint)
Add a vertex to the polygon's outer boundary.

Parameters:
mousePoint - the point at which the mouse was clicked. The new vertex will be placed as near as possible to this point, at the elevation of the polygon.

assembleControlPoints

protected void assembleControlPoints(DrawContext dc)

assembleHeightControlPoints

protected void assembleHeightControlPoints()

assembleMarkerAttributes

protected void assembleMarkerAttributes()

assembleVertexControlPoints

protected void assembleVertexControlPoints(DrawContext dc)

computeAnnotationPosition

protected Vec4 computeAnnotationPosition(Position pos)

doPick

protected void doPick(DrawContext dc,
                      Point point)
Overrides:
doPick in class AbstractLayer

doRender

protected void doRender(DrawContext dc)
Specified by:
doRender in class AbstractLayer

formatMeasurements

protected String formatMeasurements(Position pos)

getDisplayString

protected String getDisplayString(Position pos)

getEditMode

public String getEditMode()
Specified by:
getEditMode in class AbstractShapeEditor

getPolygon

public ExtrudedPolygon getPolygon()

intersectPolygonAltitudeAt

protected Vec4 intersectPolygonAltitudeAt(Line ray)
Determine the point at which a ray intersects a the globe at the elevation of the polygon.

Parameters:
ray - Ray to intersect with the globe.
Returns:
The point at which the ray intersects the globe at the elevation of the polygon.

mouseClicked

public void mouseClicked(MouseEvent e)

mouseDragged

public void mouseDragged(MouseEvent e)

mouseEntered

public void mouseEntered(MouseEvent e)

mouseExited

public void mouseExited(MouseEvent e)

mouseMoved

public void mouseMoved(MouseEvent e)

mousePressed

public void mousePressed(MouseEvent e)

mouseReleased

public void mouseReleased(MouseEvent e)

moveControlPoint

protected void moveControlPoint(ExtrudedPolygonEditor.ControlPointMarker controlPoint,
                                Point lastMousePoint,
                                Point moveToPoint)

movePolygon

protected void movePolygon(Point previousMousePoint,
                           Point mousePoint)

removeVertex

protected void removeVertex(ExtrudedPolygonEditor.ControlPointMarker vertexToRemove)
Remove a vertex from the polygon.

Parameters:
vertexToRemove - the vertex to remove.

setEditMode

public void setEditMode(String editMode)
Specified by:
setEditMode in class AbstractShapeEditor

setPolygon

public void setPolygon(ExtrudedPolygon polygon)

setPolygonHeight

protected void setPolygonHeight(Point previousMousePoint,
                                Point mousePoint)

setShape

public void setShape(AbstractShape shape)
Specified by:
setShape in class AbstractShapeEditor

updateAnnotation

public void updateAnnotation(Position pos)
Specified by:
updateAnnotation in class AbstractShapeEditor

NASA World Wind