Class CappedEllipticalCylinder
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.render.airspaces.AbstractAirspace
-
- gov.nasa.worldwind.render.airspaces.CappedEllipticalCylinder
-
- All Implemented Interfaces:
AVList
,Draggable
,MessageListener
,ExtentHolder
,Movable
,Movable2
,Airspace
,Attributable
,Highlightable
,OrderedRenderable
,PreRenderable
,Renderable
,Restorable
,WWObject
,java.beans.PropertyChangeListener
,java.util.EventListener
public class CappedEllipticalCylinder extends AbstractAirspace
An elliptical cylinder defined by a geographic position, major and minor radii in meters, and minimum and maximum altitudes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace
AbstractAirspace.AirspaceInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected LatLon
center
protected static int
DEFAULT_LOOPS
protected static int
DEFAULT_SLICES
protected static int
DEFAULT_STACKS
protected boolean
enableCaps
protected Angle
heading
protected double
innerMajorRadius
protected double
innerMinorRadius
protected int
loops
protected static int
MINIMAL_GEOMETRY_LOOPS
protected static int
MINIMAL_GEOMETRY_SLICES
protected double
outerMajorRadius
protected double
outerMinorRadius
protected int
slices
protected int
stacks
-
Fields inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace
activeAttributes, airspaceInfo, alwaysOnTop, ARC_SLICES, attributes, currentInfo, DEFAULT_HIGHLIGHT_MATERIAL, DEFAULT_INTERIOR_MATERIAL, DEFAULT_OUTLINE_MATERIAL, DEFAULT_OUTLINE_PICK_WIDTH, defaultAttributes, delegateOwner, detailLevels, DISABLE_TERRAIN_CONFORMANCE, dragEnabled, draggableSupport, drawSurfaceShape, elevationMap, enableBatchPicking, enableBatchRendering, enableDepthOffset, enableLevelOfDetail, EXPIRY_TIME, expiryTime, frameTimeStamp, GEOMETRY_CACHE_KEY, GEOMETRY_CACHE_NAME, geometryBuilder, GLOBE_KEY, groundReference, highlightAttributes, highlighted, LENGTH_SLICES, LOOPS, lowerAltitude, lowerAltitudeDatum, lowerTerrainConforming, maxExpiryTime, minExpiryTime, mustRegenerateSurfaceShape, outlinePickWidth, outlineShapeRenderer, pickLayer, pickSupport, PILLARS, rand, SLICES, SPLIT_THRESHOLD, STACKS, SUBDIVISIONS, surfaceShape, upperAltitude, upperAltitudeDatum, upperTerrainConforming, VERTICAL_EXAGGERATION, visible
-
Fields inherited from interface gov.nasa.worldwind.render.airspaces.Airspace
DRAW_STYLE_FILL, DRAW_STYLE_OUTLINE
-
-
Constructor Summary
Constructors Constructor Description CappedEllipticalCylinder()
CappedEllipticalCylinder(LatLon location, double minorRadius, double majorRadius, Angle heading)
CappedEllipticalCylinder(AirspaceAttributes attributes)
CappedEllipticalCylinder(CappedEllipticalCylinder source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Extent
computeExtent(Globe globe, double verticalExaggeration)
protected java.util.List<Vec4>
computeMinimalGeometry(Globe globe, double verticalExaggeration)
protected Vec4
computeReferenceCenter(DrawContext dc)
protected SurfaceShape
createSurfaceShape()
Returns aSurfaceShape
that corresponds to this Airspace and is used for drawing on 2D globes.protected void
doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
protected void
doMoveTo(Position oldRef, Position newRef)
protected void
doMoveTo(Globe globe, Position oldRef, Position newRef)
protected void
doRenderGeometry(DrawContext dc, java.lang.String drawStyle)
protected void
doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
LatLon
getCenter()
Returns the geographic location of the cylinder's center.Angle
getHeading()
Returns this cylinder's heading, in degrees.int
getLoops()
double[]
getRadii()
Returns the cylinder's radii, in meters.Position
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.int
getSlices()
int
getStacks()
boolean
isEnableCaps()
protected void
regenerateSurfaceShape(DrawContext dc, SurfaceShape shape)
Regenerates surface shape geometry prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes.void
setCenter(LatLon location)
Sets the cylinder's center.void
setEnableCaps(boolean enable)
void
setHeading(Angle heading)
Sets this cylinder's heading, in degrees.void
setLoops(int loops)
void
setRadii(double outerMinorRadius, double outerMajorRadius)
Sets the cylinder's outer radii.void
setRadii(double innerMinorRadius, double innerMajorRadius, double outerMinorRadius, double outerMajorRadius)
Sets the cylinder's radii.void
setSlices(int slices)
protected void
updateSurfaceShape(DrawContext dc, SurfaceShape shape)
Sets surface shape parameters prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes.-
Methods inherited from class gov.nasa.worldwind.render.airspaces.AbstractAirspace
addDetailLevels, adjustForGroundReference, beginRendering, clearElevationMap, computeDetailLevel, computeElevationAt, computeExtent, computeEyeDistance, computeMinimalGeometry, computePointFromPosition, computeReferencePosition, createPickedObject, determineActiveAttributes, doDrag, doDrawOrderedRenderable, drag, drawBatched, drawGeometry, drawInterior, drawOrderedRenderable, drawOutline, endRendering, getActiveAttributes, getAirspaceInfo, getAltitudeDatum, getAltitudes, getAltitudes, getAttributes, getDelegateOwner, getDetailLevels, getDistanceFromEye, getExpiryRange, getExpiryTime, getExtent, getExtent, getGeometryBuilder, getGeometryCache, getGroundReference, getHighlightAttributes, getOutlinePickWidth, getRestorableState, invalidateAirspaceData, isAirspaceCollapsed, isAirspaceVisible, isAlwaysOnTop, isDragEnabled, isDrawSurfaceShape, isEnableBatchPicking, isEnableBatchRendering, isEnableDepthOffset, isEnableLevelOfDetail, isExpired, isHighlighted, isTerrainConforming, isVisible, makeExtremePoints, makeOrderedRenderable, move, moveTo, moveTo, mustDrawInterior, mustDrawOutline, nextExpiryTime, pick, preRender, render, restoreState, setAltitude, setAltitudeDatum, setAltitudes, setAlwaysOnTop, setAttributes, setAttributes, setDelegateOwner, setDetailLevels, setDragEnabled, setDrawSurfaceShape, setEnableBatchPicking, setEnableBatchRendering, setEnableDepthOffset, setEnableLevelOfDetail, setExpiryRange, setExpiryTime, setGeometryBuilder, setGroundReference, setHighlightAttributes, setHighlightAttributes, setHighlighted, setOutlinePickWidth, setTerrainConforming, setTerrainConforming, setVisible, updateExpiryCriteria
-
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
-
-
-
-
Field Detail
-
DEFAULT_SLICES
protected static final int DEFAULT_SLICES
- See Also:
- Constant Field Values
-
DEFAULT_STACKS
protected static final int DEFAULT_STACKS
- See Also:
- Constant Field Values
-
DEFAULT_LOOPS
protected static final int DEFAULT_LOOPS
- See Also:
- Constant Field Values
-
MINIMAL_GEOMETRY_SLICES
protected static final int MINIMAL_GEOMETRY_SLICES
- See Also:
- Constant Field Values
-
MINIMAL_GEOMETRY_LOOPS
protected static final int MINIMAL_GEOMETRY_LOOPS
- See Also:
- Constant Field Values
-
center
protected LatLon center
-
innerMinorRadius
protected double innerMinorRadius
-
outerMinorRadius
protected double outerMinorRadius
-
innerMajorRadius
protected double innerMajorRadius
-
outerMajorRadius
protected double outerMajorRadius
-
heading
protected Angle heading
-
enableCaps
protected boolean enableCaps
-
slices
protected int slices
-
stacks
protected final int stacks
- See Also:
- Constant Field Values
-
loops
protected int loops
-
-
Constructor Detail
-
CappedEllipticalCylinder
public CappedEllipticalCylinder(LatLon location, double minorRadius, double majorRadius, Angle heading)
-
CappedEllipticalCylinder
public CappedEllipticalCylinder(CappedEllipticalCylinder source)
-
CappedEllipticalCylinder
public CappedEllipticalCylinder(AirspaceAttributes attributes)
-
CappedEllipticalCylinder
public CappedEllipticalCylinder()
-
-
Method Detail
-
getCenter
public LatLon getCenter()
Returns the geographic location of the cylinder's center.- Returns:
- the cylinder's center
-
setCenter
public void setCenter(LatLon location)
Sets the cylinder's center.- Parameters:
location
- the geographic position (latitude and longitude) of the cylinder's center.- Throws:
java.lang.IllegalArgumentException
- if the location is null.
-
getRadii
public double[] getRadii()
Returns the cylinder's radii, in meters.- Returns:
- the cylinder's radii, in meters. The returned array contains the inner minor radius, inner major radius, outer minor radius and outer major radius, in that order.
-
setRadii
public void setRadii(double innerMinorRadius, double innerMajorRadius, double outerMinorRadius, double outerMajorRadius)
Sets the cylinder's radii.- Parameters:
innerMinorRadius
- the cylinder's inner minor radius, in meters.innerMajorRadius
- The cylinder's inner major radius, in meters.outerMinorRadius
- the cylinder's outer minor radius, in meters.outerMajorRadius
- The cylinder's outer major radius, in meters.- Throws:
java.lang.IllegalArgumentException
- if either radius is less than zero.
-
setRadii
public void setRadii(double outerMinorRadius, double outerMajorRadius)
Sets the cylinder's outer radii.- Parameters:
outerMinorRadius
- the cylinder's outer minor radius, in meters.outerMajorRadius
- the cylinder's outer major radius, in meters.- Throws:
java.lang.IllegalArgumentException
- if either radius is less than zero.
-
getHeading
public Angle getHeading()
Returns this cylinder's heading, in degrees.- Returns:
- This cylinder's heading, in degrees.
-
setHeading
public void setHeading(Angle heading)
Sets this cylinder's heading, in degrees.- Parameters:
heading
- This cylinder's heading, in degrees.
-
isEnableCaps
public boolean isEnableCaps()
-
setEnableCaps
public void setEnableCaps(boolean enable)
-
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.- Returns:
- the object's reference position, or null if no reference position is available.
-
computeExtent
protected Extent computeExtent(Globe globe, double verticalExaggeration)
- Specified by:
computeExtent
in classAbstractAirspace
-
computeMinimalGeometry
protected java.util.List<Vec4> computeMinimalGeometry(Globe globe, double verticalExaggeration)
- Specified by:
computeMinimalGeometry
in classAbstractAirspace
-
doMoveTo
protected void doMoveTo(Globe globe, Position oldRef, Position newRef)
- Overrides:
doMoveTo
in classAbstractAirspace
-
doMoveTo
protected void doMoveTo(Position oldRef, Position newRef)
- Overrides:
doMoveTo
in classAbstractAirspace
-
createSurfaceShape
protected SurfaceShape createSurfaceShape()
Description copied from class:AbstractAirspace
Returns aSurfaceShape
that corresponds to this Airspace and is used for drawing on 2D globes.- Overrides:
createSurfaceShape
in classAbstractAirspace
- Returns:
- The surface shape to represent this Airspace on a 2D globe.
-
updateSurfaceShape
protected void updateSurfaceShape(DrawContext dc, SurfaceShape shape)
Description copied from class:AbstractAirspace
Sets surface shape parameters prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes. Subclasses should override this method if they need to update more than the attributes and the delegate owner.- Overrides:
updateSurfaceShape
in classAbstractAirspace
- Parameters:
dc
- the current drawing context.shape
- the surface shape to update.
-
regenerateSurfaceShape
protected void regenerateSurfaceShape(DrawContext dc, SurfaceShape shape)
Description copied from class:AbstractAirspace
Regenerates surface shape geometry prior to picking and rendering the 2D shape used to represent this Airspace on 2D globes.- Overrides:
regenerateSurfaceShape
in classAbstractAirspace
- Parameters:
dc
- the current drawing context.shape
- the surface shape to regenerate.
-
getSlices
public int getSlices()
-
setSlices
public void setSlices(int slices)
-
getStacks
public int getStacks()
-
getLoops
public int getLoops()
-
setLoops
public void setLoops(int loops)
-
computeReferenceCenter
protected Vec4 computeReferenceCenter(DrawContext dc)
-
doRenderGeometry
protected void doRenderGeometry(DrawContext dc, java.lang.String drawStyle)
- Specified by:
doRenderGeometry
in classAbstractAirspace
-
doGetRestorableState
protected void doGetRestorableState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doGetRestorableState
in classAbstractAirspace
-
doRestoreState
protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context)
- Overrides:
doRestoreState
in classAbstractAirspace
-
-