Package gov.nasa.worldwind.render
Class SurfaceEllipse
- 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.SurfaceEllipse
-
- 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:
SurfaceCircle
public class SurfaceEllipse extends AbstractSurfaceShape
-
-
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 LatLon
center
protected static int
DEFAULT_NUM_INTERVALS
protected Angle
heading
protected double
majorRadius
protected static int
MIN_NUM_INTERVALS
protected double
minorRadius
-
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 SurfaceEllipse()
Constructs a new surface ellipse with the default attributes, default center location, default radii, and default heading.SurfaceEllipse(LatLon center, double majorRadius, double minorRadius)
Constructs a new surface ellipse with the default attributes, the specified center location and radii (in meters).SurfaceEllipse(LatLon center, double majorRadius, double minorRadius, Angle heading)
Constructs a new surface ellipse with the default attributes, the specified center location, radii (in meters), and heading clockwise from North.SurfaceEllipse(LatLon center, double majorRadius, double minorRadius, Angle heading, int intervals)
Constructs a new surface ellipse with the default attributes, the specified center location, radii (in meters), heading clockwise from North, and initial number of geometry intervals.SurfaceEllipse(ShapeAttributes normalAttrs)
Constructs a new surface ellipse with the specified normal (as opposed to highlight) attributes, default center location, default radii, and default heading.SurfaceEllipse(ShapeAttributes normalAttrs, LatLon center, double majorRadius, double minorRadius)
Constructs a new surface ellipse with the specified normal (as opposed to highlight) attributes, the specified center location, and radii (in meters).SurfaceEllipse(ShapeAttributes normalAttrs, LatLon center, double majorRadius, double minorRadius, Angle heading)
Constructs a new surface ellipse with the specified normal (as opposed to highlight) attributes, the specified center location, radii (in meters), and heading clockwise from North.SurfaceEllipse(ShapeAttributes normalAttrs, LatLon center, double majorRadius, double minorRadius, Angle heading, int intervals)
Constructs a new surface ellipse with the specified normal (as opposed to highlight) attributes, the specified center location, radii (in meters), heading clockwise from North, and initial number of geometry intervals.SurfaceEllipse(SurfaceEllipse source)
Creates a shallow copy of the specified source shape.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<LatLon>
computeLocations(Globe globe, int intervals)
protected int
computeNumEdgeIntervals(Globe globe, double edgeIntervalsPerDegree)
protected int
computeNumIntervals(Globe globe, double edgeIntervalsPerDegree)
protected java.util.List<java.util.List<LatLon>>
createGeometry(Globe globe, double edgeIntervalsPerDegree)
protected void
doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
protected void
doMoveTo(Position oldReferencePosition, Position newReferencePosition)
protected void
doMoveTo(Globe globe, Position oldReferencePosition, Position newReferencePosition)
protected void
doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
LatLon
getCenter()
Angle
getHeading()
int
getIntervals()
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.double
getMajorRadius()
double
getMinorRadius()
Position
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.java.lang.Object
getStateKey(DrawContext dc)
Returns an object that uniquely identifies this renderable's state for the specified draw context.protected void
legacyRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
Restores state values from previous versions of the SurfaceShape state XML.void
setCenter(LatLon center)
void
setHeading(Angle heading)
void
setIntervals(int intervals)
void
setMajorRadius(double radius)
void
setMinorRadius(double radius)
void
setRadii(double majorRadius, double minorRadius)
-
Methods inherited from class gov.nasa.worldwind.render.AbstractSurfaceShape
addIntermediateLocations, applyInteriorState, applyInteriorTextureState, applyModelviewTransform, applyOutlineState, beginDrawing, canContainPole, clearCaches, combine, combineBounds, combineContours, computeEdgeIntervalsPerDegree, computeEdgeIntervalsPerDegree, computeSectors, computeSectors, containsPole, createActiveAttributes, createGeometry, createGeometryKey, cutAlongDateLine, determineActiveAttributes, determineActiveGeometry, doCombineContour, doCombineContours, doDrag, doDrawGeographic, doTessellateInterior, drag, drawGeographic, drawInterior, drawLineStrip, drawOutline, endDrawing, export, exportAsKML, generateIntermediateLocations, getActiveAttributes, getActiveGeometry, getArea, getArea, getAttributes, getCachedGeometry, getExtent, getHeight, getHighlightAttributes, getInteriorTexture, getLength, getMinAndMaxEdgeIntervals, getPathType, getPerimeter, getRestorableState, getSectors, getTexelsPerEdgeInterval, getWidth, handleUnsuccessfulInteriorTessellation, 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, 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
-
MIN_NUM_INTERVALS
protected static final int MIN_NUM_INTERVALS
- See Also:
- Constant Field Values
-
DEFAULT_NUM_INTERVALS
protected static final int DEFAULT_NUM_INTERVALS
- See Also:
- Constant Field Values
-
center
protected LatLon center
-
majorRadius
protected double majorRadius
-
minorRadius
protected double minorRadius
-
heading
protected Angle heading
-
-
Constructor Detail
-
SurfaceEllipse
public SurfaceEllipse()
Constructs a new surface ellipse with the default attributes, default center location, default radii, and default heading.
-
SurfaceEllipse
public SurfaceEllipse(SurfaceEllipse source)
Creates a shallow copy of the specified source shape.- Parameters:
source
- the shape to copy.
-
SurfaceEllipse
public SurfaceEllipse(ShapeAttributes normalAttrs)
Constructs a new surface ellipse with the specified normal (as opposed to highlight) attributes, default center location, default radii, and default heading. Modifying the attribute reference after calling this constructor causes this shape's appearance to change accordingly.- Parameters:
normalAttrs
- the normal attributes. May be null, in which case default attributes are used.
-
SurfaceEllipse
public SurfaceEllipse(LatLon center, double majorRadius, double minorRadius)
Constructs a new surface ellipse with the default attributes, the specified center location and radii (in meters).- Parameters:
center
- the ellipse's center location.majorRadius
- the ellipse's major radius, in meters.minorRadius
- the ellipse's minor radius, in meters.- Throws:
java.lang.IllegalArgumentException
- if the center is null, or if either radii is negative.
-
SurfaceEllipse
public SurfaceEllipse(LatLon center, double majorRadius, double minorRadius, Angle heading)
Constructs a new surface ellipse with the default attributes, the specified center location, radii (in meters), and heading clockwise from North.- Parameters:
center
- the ellipse's center location.majorRadius
- the ellipse's major radius, in meters.minorRadius
- the ellipse's minor radius, in meters.heading
- the ellipse's heading, clockwise from North.- Throws:
java.lang.IllegalArgumentException
- if the center or heading are null, or if either radii is negative.
-
SurfaceEllipse
public SurfaceEllipse(LatLon center, double majorRadius, double minorRadius, Angle heading, int intervals)
Constructs a new surface ellipse with the default attributes, the specified center location, radii (in meters), heading clockwise from North, and initial number of geometry intervals.- Parameters:
center
- the ellipse's center location.majorRadius
- the ellipse's major radius, in meters.minorRadius
- the ellipse's minor radius, in meters.heading
- the ellipse's heading, clockwise from North.intervals
- the initial number of intervals (or slices) defining the ellipse's geometry.- Throws:
java.lang.IllegalArgumentException
- if the center or heading are null, if either radii is negative, or if the number of intervals is less than 8.
-
SurfaceEllipse
public SurfaceEllipse(ShapeAttributes normalAttrs, LatLon center, double majorRadius, double minorRadius)
Constructs a new surface ellipse with the specified normal (as opposed to highlight) attributes, the specified center location, and radii (in meters). Modifying the attribute reference after calling this constructor causes this shape's appearance to change accordingly.- Parameters:
normalAttrs
- the normal attributes. May be null, in which case default attributes are used.center
- the ellipse's center location.majorRadius
- the ellipse's major radius, in meters.minorRadius
- the ellipse's minor radius, in meters.- Throws:
java.lang.IllegalArgumentException
- if the center is null, or if either radii is negative.
-
SurfaceEllipse
public SurfaceEllipse(ShapeAttributes normalAttrs, LatLon center, double majorRadius, double minorRadius, Angle heading)
Constructs a new surface ellipse with the specified normal (as opposed to highlight) attributes, the specified center location, radii (in meters), and heading clockwise from North. Modifying the attribute reference after calling this constructor causes this shape's appearance to change accordingly.- Parameters:
normalAttrs
- the normal attributes. May be null, in which case default attributes are used.center
- the ellipse's center location.majorRadius
- the ellipse's major radius, in meters.minorRadius
- the ellipse's minor radius, in meters.heading
- the ellipse's heading, clockwise from North.- Throws:
java.lang.IllegalArgumentException
- if the center or heading are null, or if either radii is negative.
-
SurfaceEllipse
public SurfaceEllipse(ShapeAttributes normalAttrs, LatLon center, double majorRadius, double minorRadius, Angle heading, int intervals)
Constructs a new surface ellipse with the specified normal (as opposed to highlight) attributes, the specified center location, radii (in meters), heading clockwise from North, and initial number of geometry intervals. Modifying the attribute reference after calling this constructor causes this shape's appearance to change accordingly.- Parameters:
normalAttrs
- the normal attributes. May be null, in which case default attributes are used.center
- the ellipse's center location.majorRadius
- the ellipse's major radius, in meters.minorRadius
- the ellipse's minor radius, in meters.heading
- the ellipse's heading, clockwise from North.intervals
- the initial number of intervals (or slices) defining the ellipse's geometry.- Throws:
java.lang.IllegalArgumentException
- if the center or heading are null, if either radii is negative, or if the number of intervals is less than 8.
-
-
Method Detail
-
getCenter
public LatLon getCenter()
-
setCenter
public void setCenter(LatLon center)
-
getMajorRadius
public double getMajorRadius()
-
getMinorRadius
public double getMinorRadius()
-
setMajorRadius
public void setMajorRadius(double radius)
-
setMinorRadius
public void setMinorRadius(double radius)
-
setRadii
public void setRadii(double majorRadius, double minorRadius)
-
getHeading
public Angle getHeading()
-
setHeading
public void setHeading(Angle heading)
-
getIntervals
public int getIntervals()
-
setIntervals
public void setIntervals(int intervals)
-
getStateKey
public java.lang.Object getStateKey(DrawContext dc)
Returns an object that uniquely identifies this renderable's state for the specified draw context.Callers can perform an equality test on two state keys using
Object.equals(Object)
in order to determine whether or not a renderable has changed. The returned object is guaranteed to be globally unique with respect to other SurfaceRenderable state keys; an equality test with a state key from another renderable always returns false.The returned state key is constructed the SurfaceShape's unique ID, last modified time, and its active attributes. The returned state key has no dependency on the
Globe
. Subclasses that depend on the Globe should return a state key that include the globe's state key.Overridden to include the globe's state key in the returned state key.
- Specified by:
getStateKey
in interfaceSurfaceRenderable
- Overrides:
getStateKey
in classAbstractSurfaceShape
- Parameters:
dc
- the draw context for which to determine this renderable's current state.- Returns:
- an object representing this renderable's current state.
- See Also:
Globe.getStateKey(DrawContext)
-
getLocations
public java.lang.Iterable<? extends LatLon> getLocations(Globe globe)
Description copied from interface:SurfaceShape
Returns 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.
-
getReferencePosition
public Position getReferencePosition()
Description copied from interface:Movable
A 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:
getReferencePosition
in interfaceMovable
- Specified by:
getReferencePosition
in interfaceMovable2
- Specified by:
getReferencePosition
in classAbstractSurfaceShape
- Returns:
- the object's reference position, or null if no reference position is available.
-
doMoveTo
protected void doMoveTo(Position oldReferencePosition, Position newReferencePosition)
- Specified by:
doMoveTo
in classAbstractSurfaceShape
-
doMoveTo
protected void doMoveTo(Globe globe, Position oldReferencePosition, Position newReferencePosition)
- Specified by:
doMoveTo
in classAbstractSurfaceShape
-
createGeometry
protected java.util.List<java.util.List<LatLon>> createGeometry(Globe globe, double edgeIntervalsPerDegree)
- Specified by:
createGeometry
in classAbstractSurfaceShape
-
computeNumIntervals
protected int computeNumIntervals(Globe globe, double edgeIntervalsPerDegree)
-
computeNumEdgeIntervals
protected int computeNumEdgeIntervals(Globe globe, double edgeIntervalsPerDegree)
-
doGetRestorableState
protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doGetRestorableState
in classAbstractSurfaceShape
-
doRestoreState
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doRestoreState
in classAbstractSurfaceShape
-
legacyRestoreState
protected void legacyRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
Description copied from class:AbstractSurfaceShape
Restores state values from previous versions of the SurfaceShape state XML. These values are stored or named differently than the current implementation. Those values which have not changed are ignored here, and will restored inAbstractSurfaceShape.doRestoreState(gov.nasa.worldwind.util.RestorableSupport, gov.nasa.worldwind.util.RestorableSupport.StateObject)
.- Overrides:
legacyRestoreState
in classAbstractSurfaceShape
- Parameters:
rs
- RestorableSupport object which contains the state value properties.context
- active context in the RestorableSupport to read state from.
-
-