NASA World Wind

gov.nasa.worldwindx.applications.antenna
Class AntennaAxes

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.render.AbstractShape
              extended by gov.nasa.worldwindx.applications.antenna.AntennaAxes
All Implemented Interfaces:
AVList, MessageListener, Exportable, ExtentHolder, Movable, GeographicExtent, Highlightable, OrderedRenderable, Renderable, Restorable, WWObject, PropertyChangeListener, EventListener

public class AntennaAxes
extends AbstractShape

Provides axes for AntennaModel. The axes are positioned by a Position, an azimuth and ane elevation angle. The azimuth orients the axes clockwise from north. The elevation angle rotates the axes vertically counterclockwise from the horizon.


Nested Class Summary
protected static class AntennaAxes.ShapeData
          This class holds globe-specific data for this shape.
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.AbstractShape
AbstractShape.AbstractShapeData
 
Field Summary
protected  Angle azimuth
           
static int DISPLAY_MODE_FILL
           
static int DISPLAY_MODE_LINE
           
protected  Angle elevationAngle
           
protected  Font labelFont
           
protected  double length
           
protected  int nHeightIntervals
           
protected  int nThetaIntervals
           
protected  Position position
           
protected  double radius
           
protected  String xAxisLabel
           
protected  String yAxisLabel
           
protected  String zAxisLabel
           
 
Fields inherited from class gov.nasa.worldwind.render.AbstractShape
activeAttributes, altitudeMode, BEogsh, currentData, DEFAULT_ALTITUDE_MODE, DEFAULT_GEOMETRY_GENERATION_INTERVAL, DEFAULT_HIGHLIGHT_MATERIAL, DEFAULT_INTERIOR_MATERIAL, DEFAULT_OUTLINE_MATERIAL, DEFAULT_OUTLINE_PICK_WIDTH, defaultAttributes, delegateOwner, enableBatchPicking, enableBatchRendering, enableDepthOffset, highlightAttrs, highlighted, maxExpiryTime, minExpiryTime, normalAttrs, outlinePickWidth, outlineShapeRenderer, pickLayer, pickSupport, referencePosition, sector, shapeDataCache, VBO_THRESHOLD, viewDistanceExpiration, visible
 
Fields inherited from interface gov.nasa.worldwind.Exportable
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
 
Constructor Summary
AntennaAxes()
           
 
Method Summary
protected  AbstractShape.AbstractShapeData createCacheEntry(DrawContext dc)
          Creates and returns a new cache entry specific to the subclass.
protected  void doDrawInterior(DrawContext dc)
          Draws this shape's interior.
protected  void doDrawOutline(DrawContext dc)
          Draws this shape's outline.
protected  void doExportAsKML(XMLStreamWriter xmlWriter)
          Exports shape-specific fields.
protected  boolean doMakeOrderedRenderable(DrawContext dc)
          Produces the geometry and other state necessary to represent this shape as an ordered renderable.
 void drawAxes(DrawContext dc)
           
protected  void drawCone(DrawContext dc, AntennaAxes.ShapeData shapeData)
           
protected  void drawCylinder(DrawContext dc, AntennaAxes.ShapeData shapeData)
           
protected  void drawLabel(TextRenderer textRenderer, String text, Vec4 screenPoint, Color textColor, Color bgColor)
           
protected  void drawLabels(DrawContext dc)
           
protected  void fillVBO(DrawContext dc)
          Fill this shape's vertex buffer objects.
 Angle getAzimuth()
           
protected  AntennaAxes.ShapeData getCurrent()
          Returns the current shape data cache entry.
 Angle getElevationAngle()
           
 Extent getExtent(Globe globe, double verticalExaggeration)
          Returns the objects enclosing volume as an Extent in model coordinates, given a specified Globe and vertical exaggeration (see SceneController.getVerticalExaggeration().
 Font getLabelFont()
           
 double getLength()
           
 Position getPosition()
           
 double getRadius()
           
 Position getReferencePosition()
          A position associated with the object that indicates its aggregate geographic position.
 Sector getSector()
          Returns the object's geographic extent.
 String getXAxisLabel()
           
 String getYAxisLabel()
           
 String getZAxisLabel()
           
protected  void initialize()
          Called during construction to establish any subclass-specific state such as different default values than those set by this class.
 List<Intersection> intersect(Line line, Terrain terrain)
          Compute the intersections of a specified line with this shape.
 String isExportFormatSupported(String mimeType)
          Does this object support a certain export format?
protected  boolean isOrderedRenderableValid(DrawContext dc)
          Determines whether this shape's ordered renderable state is valid and can be rendered.
protected  void makeCone()
           
protected  void makeCylinderIndices()
           
protected  void makeCylinderNormals()
           
protected  void makeCylinderVertices(DrawContext dc)
           
 void moveTo(Position position)
          Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
protected  boolean mustApplyTexture(DrawContext dc)
          Indicates whether texture should be applied to this shape.
protected  boolean mustDrawOutline()
          Indicates whether this shape's outline must be drawn.
protected  boolean mustRegenerateGeometry(DrawContext dc)
          Indicates whether this shape's renderable geometry must be recomputed, either as a result of an attribute or property change or the expiration of the geometry regeneration interval.
 void render(DrawContext dc)
          Causes this Renderable to render itself using the provided draw context.
 void setAzimuth(Angle azimuth)
          Specifies an angle clockwise from north by which to rotate the axes.
 void setElevationAngle(Angle elevationAngle)
          Specifies an angle to rotate the axes vertically counterclockwise from the horizon.
 void setLabelFont(Font labelFont)
           
 void setLength(double length)
          Specifies the length of the axes, in meters.
 void setPosition(Position position)
          Specifies the position of the axes' origin.
 void setRadius(double radius)
           
 void setXAxisLabel(String xAxisLabel)
           
 void setYAxisLabel(String yAxisLabel)
           
 void setZAxisLabel(String zAxisLabel)
           
protected  boolean shouldUseVBOs(DrawContext dc)
          Indicates whether this shape should use OpenGL vertex buffer objects.
 
Methods inherited from class gov.nasa.worldwind.render.AbstractShape
addOrderedRenderable, beginDrawing, checkViewDistanceExpiration, clearCachedVbos, computeExtentFromPositions, computePoint, countTriangleVertices, createPickedObject, determineActiveAttributes, doDrawOrderedRenderable, doGetRestorableState, doRestoreState, drawBatched, drawInterior, drawOrderedRenderable, drawOutline, endDrawing, export, exportAsKML, getActiveAttributes, getAltitudeMode, getAttributes, getCurrentData, getDelegateOwner, getDistanceFromEye, getExtent, getGeometryRegenerationInterval, getHighlightAttributes, getOutlinePickWidth, getReferencePoint, getRestorableState, getVboIds, intersectsFrustum, isEnableBatchPicking, isEnableBatchRendering, isEnableDepthOffset, isHighlighted, isTerrainDependent, isViewDistanceExpiration, isVisible, makeOrderedRenderable, makeTexture, move, mustApplyLighting, mustApplyLighting, mustCreateNormals, mustCreateNormals, mustDrawInterior, pick, prepareToDrawInterior, prepareToDrawOutline, reset, restoreState, setAltitudeMode, setAttributes, setDelegateOwner, setEnableBatchPicking, setEnableBatchRendering, setEnableDepthOffset, setGeometryRegenerationInterval, setHighlightAttributes, setHighlighted, setOutlinePickWidth, setReferencePosition, setViewDistanceExpiration, setVisible
 
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, 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

azimuth

protected Angle azimuth

DISPLAY_MODE_FILL

public static final int DISPLAY_MODE_FILL
See Also:
Constant Field Values

DISPLAY_MODE_LINE

public static final int DISPLAY_MODE_LINE
See Also:
Constant Field Values

elevationAngle

protected Angle elevationAngle

labelFont

protected Font labelFont

length

protected double length

nHeightIntervals

protected int nHeightIntervals

nThetaIntervals

protected int nThetaIntervals

position

protected Position position

radius

protected double radius

xAxisLabel

protected String xAxisLabel

yAxisLabel

protected String yAxisLabel

zAxisLabel

protected String zAxisLabel
Constructor Detail

AntennaAxes

public AntennaAxes()
Method Detail

createCacheEntry

protected AbstractShape.AbstractShapeData createCacheEntry(DrawContext dc)
Description copied from class: AbstractShape
Creates and returns a new cache entry specific to the subclass.

Specified by:
createCacheEntry in class AbstractShape
Parameters:
dc - the current draw context.
Returns:
a data cache entry for the state in the specified draw context.

doDrawInterior

protected void doDrawInterior(DrawContext dc)
Description copied from class: AbstractShape
Draws this shape's interior. Called immediately after calling AbstractShape.prepareToDrawInterior(DrawContext, ShapeAttributes, ShapeAttributes), which establishes OpenGL state for lighting, blending, pick color and interior attributes. Subclasses should execute the drawing commands specific to the type of shape.

A AbstractShape.AbstractShapeData must be current when this method is called.

Specified by:
doDrawInterior in class AbstractShape
Parameters:
dc - the current draw context.

doDrawOutline

protected void doDrawOutline(DrawContext dc)
Description copied from class: AbstractShape
Draws this shape's outline. Called immediately after calling AbstractShape.prepareToDrawOutline(DrawContext, ShapeAttributes, ShapeAttributes), which establishes OpenGL state for lighting, blending, pick color and line attributes. Subclasses should execute the drawing commands specific to the type of shape.

A AbstractShape.AbstractShapeData must be current when this method is called.

Specified by:
doDrawOutline in class AbstractShape
Parameters:
dc - the current draw context.

doExportAsKML

protected void doExportAsKML(XMLStreamWriter xmlWriter)
                      throws IOException,
                             XMLStreamException
Description copied from class: AbstractShape
Exports shape-specific fields.

Specified by:
doExportAsKML in class AbstractShape
Parameters:
xmlWriter - the export writer to write to.
Throws:
IOException - if an IO error occurs while writing to the output destination.
XMLStreamException - if an exception occurs converting this shape's fields to XML.

doMakeOrderedRenderable

protected boolean doMakeOrderedRenderable(DrawContext dc)
Description copied from class: AbstractShape
Produces the geometry and other state necessary to represent this shape as an ordered renderable. Places this shape on the draw context's ordered renderable list for subsequent rendering. This method is called during AbstractShape.pick(DrawContext, java.awt.Point) and AbstractShape.render(DrawContext) when it's been determined that the shape is likely to be visible.

Specified by:
doMakeOrderedRenderable in class AbstractShape
Parameters:
dc - the current draw context.
Returns:
true if the ordered renderable state was successfully computed, otherwise false, in which case the current pick or render pass is terminated for this shape. Subclasses should return false if it is not possible to create the ordered renderable state.
See Also:
AbstractShape.pick(DrawContext, java.awt.Point), AbstractShape.render(DrawContext)

drawAxes

public void drawAxes(DrawContext dc)

drawCone

protected void drawCone(DrawContext dc,
                        AntennaAxes.ShapeData shapeData)

drawCylinder

protected void drawCylinder(DrawContext dc,
                            AntennaAxes.ShapeData shapeData)

drawLabel

protected void drawLabel(TextRenderer textRenderer,
                         String text,
                         Vec4 screenPoint,
                         Color textColor,
                         Color bgColor)

drawLabels

protected void drawLabels(DrawContext dc)

fillVBO

protected void fillVBO(DrawContext dc)
Description copied from class: AbstractShape
Fill this shape's vertex buffer objects. If the vertex buffer object resource IDs don't yet exist, create them.

A AbstractShape.AbstractShapeData must be current when this method is called.

Specified by:
fillVBO in class AbstractShape
Parameters:
dc - the current draw context.

getAzimuth

public Angle getAzimuth()

getCurrent

protected AntennaAxes.ShapeData getCurrent()
Returns the current shape data cache entry.

Returns:
the current data cache entry.

getElevationAngle

public Angle getElevationAngle()

getExtent

public Extent getExtent(Globe globe,
                        double verticalExaggeration)
Description copied from interface: ExtentHolder
Returns the objects enclosing volume as an Extent in model coordinates, given a specified Globe and vertical exaggeration (see SceneController.getVerticalExaggeration().

Specified by:
getExtent in interface ExtentHolder
Overrides:
getExtent in class AbstractShape
Parameters:
globe - the Globe the object is related to.
verticalExaggeration - the vertical exaggeration of the scene containing this object.
Returns:
the object's Extent in model coordinates.

getLabelFont

public Font getLabelFont()

getLength

public double getLength()

getPosition

public Position getPosition()

getRadius

public double getRadius()

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.

getSector

public Sector getSector()
Description copied from interface: GeographicExtent
Returns the object's geographic extent.

Returns:
the object's geographic extent.

getXAxisLabel

public String getXAxisLabel()

getYAxisLabel

public String getYAxisLabel()

getZAxisLabel

public String getZAxisLabel()

initialize

protected void initialize()
Description copied from class: AbstractShape
Called during construction to establish any subclass-specific state such as different default values than those set by this class.

Specified by:
initialize in class AbstractShape

intersect

public List<Intersection> intersect(Line line,
                                    Terrain terrain)
                             throws InterruptedException
Description copied from class: AbstractShape
Compute the intersections of a specified line with this shape. If the shape's altitude mode is other than WorldWind.ABSOLUTE, the shape's geometry is created relative to the specified terrain rather than the terrain used during rendering, which may be at lower level of detail than required for accurate intersection determination.

Specified by:
intersect in class AbstractShape
Parameters:
line - the line to intersect.
terrain - the Terrain to use when computing the shape's geometry.
Returns:
a list of intersections identifying where the line intersects the shape, or null if the line does not intersect the shape.
Throws:
InterruptedException - if the operation is interrupted.
See Also:
Terrain

isExportFormatSupported

public String isExportFormatSupported(String mimeType)
Description copied from interface: Exportable
Does this object support a certain export format?

Specified by:
isExportFormatSupported in interface Exportable
Overrides:
isExportFormatSupported in class AbstractShape
Parameters:
mimeType - Desired export format.
Returns:
One of Exportable.FORMAT_SUPPORTED, Exportable.FORMAT_NOT_SUPPORTED, or Exportable.FORMAT_PARTIALLY_SUPPORTED.
See Also:
Exportable.export(String, Object)

isOrderedRenderableValid

protected boolean isOrderedRenderableValid(DrawContext dc)
Description copied from class: AbstractShape
Determines whether this shape's ordered renderable state is valid and can be rendered. Called by AbstractShape.makeOrderedRenderable(DrawContext)just prior to adding the shape to the ordered renderable list.

Specified by:
isOrderedRenderableValid in class AbstractShape
Parameters:
dc - the current draw context.
Returns:
true if this shape is ready to be rendered as an ordered renderable.

makeCone

protected void makeCone()

makeCylinderIndices

protected void makeCylinderIndices()

makeCylinderNormals

protected void makeCylinderNormals()

makeCylinderVertices

protected void makeCylinderVertices(DrawContext dc)

moveTo

public void moveTo(Position position)
Description copied from interface: Movable
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.

Parameters:
position - the new position of the shape's reference position.

mustApplyTexture

protected boolean mustApplyTexture(DrawContext dc)
Description copied from class: AbstractShape
Indicates whether texture should be applied to this shape. Called during rendering to determine whether texture state should be established during preparation for interior drawing.

Note: This method always returns false during the pick pass.

Specified by:
mustApplyTexture in class AbstractShape
Parameters:
dc - the current draw context
Returns:
true if texture should be applied, otherwise false.

mustDrawOutline

protected boolean mustDrawOutline()
Description copied from class: AbstractShape
Indicates whether this shape's outline must be drawn.

Overrides:
mustDrawOutline in class AbstractShape
Returns:
true if the outline should be drawn, otherwise false.

mustRegenerateGeometry

protected boolean mustRegenerateGeometry(DrawContext dc)
Description copied from class: AbstractShape
Indicates whether this shape's renderable geometry must be recomputed, either as a result of an attribute or property change or the expiration of the geometry regeneration interval.

A AbstractShape.AbstractShapeData must be current when this method is called.

Overrides:
mustRegenerateGeometry in class AbstractShape
Parameters:
dc - the current draw context.
Returns:
true if this shape's geometry must be regenerated, otherwise false.

render

public void render(DrawContext dc)
Description copied from interface: Renderable
Causes this Renderable to render itself using the provided draw context.

Specified by:
render in interface Renderable
Overrides:
render in class AbstractShape
Parameters:
dc - the DrawContext to be used
See Also:
DrawContext

setAzimuth

public void setAzimuth(Angle azimuth)
Specifies an angle clockwise from north by which to rotate the axes.

Parameters:
azimuth - the angle from north.

setElevationAngle

public void setElevationAngle(Angle elevationAngle)
Specifies an angle to rotate the axes vertically counterclockwise from the horizon. The rotation is a right-handed rotation relative to the X axis.

Parameters:
elevationAngle - the elevation angle.

setLabelFont

public void setLabelFont(Font labelFont)

setLength

public void setLength(double length)
Specifies the length of the axes, in meters.

Parameters:
length - the axes length in meters.

setPosition

public void setPosition(Position position)
Specifies the position of the axes' origin.

Parameters:
position - the position of the axes' origin.

setRadius

public void setRadius(double radius)

setXAxisLabel

public void setXAxisLabel(String xAxisLabel)

setYAxisLabel

public void setYAxisLabel(String yAxisLabel)

setZAxisLabel

public void setZAxisLabel(String zAxisLabel)

shouldUseVBOs

protected boolean shouldUseVBOs(DrawContext dc)
Description copied from class: AbstractShape
Indicates whether this shape should use OpenGL vertex buffer objects.

Overrides:
shouldUseVBOs in class AbstractShape
Parameters:
dc - the current draw context.
Returns:
true if this shape should use vertex buffer objects, otherwise false.

NASA World Wind