public class RadarVolume extends AbstractShape
Modifier and Type | Class and Description |
---|---|
protected static class |
RadarVolume.ShapeData
This class holds globe-specific data for this shape.
|
AbstractShape.AbstractShapeData
Modifier and Type | Field and Description |
---|---|
protected boolean |
enableSides |
static int |
EXTERNAL_OBSTRUCTION |
protected int |
height |
static int |
INTERNAL_OBSTRUCTION |
static int |
NO_OBSTRUCTION |
protected int[] |
obstructionFlags |
protected List<Position> |
positions |
protected IntBuffer |
sideIndices |
protected static int |
TRIANGLE_NORMAL |
protected static int |
VERTEX_NORMAL |
protected int |
width |
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, dragEnabled, draggableSupport, enableBatchPicking, enableBatchRendering, enableDepthOffset, highlightAttrs, highlighted, maxExpiryTime, minExpiryTime, normalAttrs, outlinePickWidth, outlineShapeRenderer, pickLayer, pickSupport, referencePosition, sector, shapeDataCache, surfaceShape, VBO_THRESHOLD, viewDistanceExpiration, visible
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
Constructor and Description |
---|
RadarVolume(List<Position> positions,
int[] obstructionFlags,
int width,
int height)
Constructs a radar volume.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeCenterPoint() |
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.
|
protected void |
drawModel(DrawContext dc,
int displayMode) |
protected void |
fillVBO(DrawContext dc)
Fill this shape's vertex buffer objects.
|
protected RadarVolume.ShapeData |
getCurrent()
Returns the current shape data cache entry.
|
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() . |
int |
getHeight()
Indicates the grid height.
|
int[] |
getObstructionFlags()
Returns the inclusion flags as specified to this object's constructor.
|
List<Position> |
getPositions()
Returns the grid positions as specified to this object's constructor.
|
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.
|
Sector |
getSector()
Returns the object's geographic extent.
|
int |
getWidth()
Indicates the grid width.
|
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.
|
boolean |
isEnableSides() |
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 |
makeGridNormals() |
protected void |
makeGridTriangles()
Forms the volume's front, back and bottom vertices and computes appropriate normals.
|
protected void |
makeGridVertices(DrawContext dc) |
protected void |
makeSides() |
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.
|
void |
setEnableSides(boolean enableSides) |
protected void |
setTriangleNormals(int[] flags,
int[] indices) |
protected boolean |
shouldUseVBOs(DrawContext dc)
Indicates whether this shape should use OpenGL vertex buffer objects.
|
protected static FloatBuffer |
trimBuffer(FloatBuffer buffer) |
addOrderedRenderable, beginDrawing, checkViewDistanceExpiration, clearCachedVbos, computeExtentFromPositions, computePoint, computePoint, countTriangleVertices, createPickedObject, createSurfaceShape, determineActiveAttributes, doDrag, doDrawOrderedRenderable, doGetRestorableState, doRestoreState, drag, drawBatched, drawInterior, drawOrderedRenderable, drawOutline, endDrawing, export, exportAsKML, getActiveAttributes, getAltitudeMode, getAttributes, getCurrentData, getDelegateOwner, getDistanceFromEye, getExtent, getGeometryRegenerationInterval, getHighlightAttributes, getOutlinePickWidth, getReferencePoint, getRestorableState, getVboIds, intersectsFrustum, isDragEnabled, isEnableBatchPicking, isEnableBatchRendering, isEnableDepthOffset, isHighlighted, isTerrainDependent, isViewDistanceExpiration, isVisible, makeOrderedRenderable, makeTexture, move, moveTo, mustApplyLighting, mustApplyLighting, mustCreateNormals, mustCreateNormals, mustDrawInterior, mustDrawOutline, mustRegenerateGeometry, pick, prepareToDrawInterior, prepareToDrawOutline, preRender, render, reset, restoreState, setAltitudeMode, setAttributes, setDelegateOwner, setDragEnabled, setEnableBatchPicking, setEnableBatchRendering, setEnableDepthOffset, setGeometryRegenerationInterval, setHighlightAttributes, setHighlighted, setOutlinePickWidth, setReferencePosition, setViewDistanceExpiration, setVisible, updateSurfaceShape
onMessage, propertyChange
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected boolean enableSides
public static final int EXTERNAL_OBSTRUCTION
protected int height
public static final int INTERNAL_OBSTRUCTION
public static final int NO_OBSTRUCTION
protected int[] obstructionFlags
protected IntBuffer sideIndices
protected static final int TRIANGLE_NORMAL
protected static final int VERTEX_NORMAL
protected int width
public RadarVolume(List<Position> positions, int[] obstructionFlags, int width, int height)
positions
- the volume's positions, organized as two grids. The near grid is held in the first width
x height entries, the far grid is held in the next width x height entries. This list is
retained as-is and is not copied.obstructionFlags
- flags indicating the obstruction state of the specified positions. This array is retained
as-is and is not copied. Recognized values are NO_OBSTRUCTION
indicating
that the specified position is unobstructed, INTERNAL_OBSTRUCTION
indicating
that the position is obstructed beyond the near grid but before the far grid,
EXTERNAL_OBSTRUCTION
indicating that the position is obstructed before the
near grid.width
- the horizontal dimension of the grid.height
- the vertical dimension of the grid.IllegalArgumentException
- if the positions list or inclusion flags array is null, the size of
the inclusion flags array is less than the number of grid positions,
the positions list is less than the specified size, or the width or
height are less than 2.protected void computeCenterPoint()
protected AbstractShape.AbstractShapeData createCacheEntry(DrawContext dc)
AbstractShape
createCacheEntry
in class AbstractShape
dc
- the current draw context.protected void doDrawInterior(DrawContext dc)
AbstractShape
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.doDrawInterior
in class AbstractShape
dc
- the current draw context.protected void doDrawOutline(DrawContext dc)
AbstractShape
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.doDrawOutline
in class AbstractShape
dc
- the current draw context.protected void doExportAsKML(XMLStreamWriter xmlWriter) throws IOException, XMLStreamException
AbstractShape
doExportAsKML
in class AbstractShape
xmlWriter
- the export writer to write to.IOException
- if an IO error occurs while writing to the output destination.XMLStreamException
- if an exception occurs converting this shape's fields to XML.protected boolean doMakeOrderedRenderable(DrawContext dc)
AbstractShape
AbstractShape.pick(DrawContext, java.awt.Point)
and AbstractShape.render(DrawContext)
when it's been determined that the shape is
likely to be visible.doMakeOrderedRenderable
in class AbstractShape
dc
- the current draw context.AbstractShape.pick(DrawContext, java.awt.Point)
,
AbstractShape.render(DrawContext)
protected void drawModel(DrawContext dc, int displayMode)
protected void fillVBO(DrawContext dc)
AbstractShape
AbstractShape.AbstractShapeData
must be current when this method is called.fillVBO
in class AbstractShape
dc
- the current draw context.protected RadarVolume.ShapeData getCurrent()
public Extent getExtent(Globe globe, double verticalExaggeration)
ExtentHolder
Extent
in model coordinates, given a
specified Globe
and vertical exaggeration (see SceneController.getVerticalExaggeration()
.getExtent
in interface ExtentHolder
getExtent
in class AbstractShape
globe
- the Globe the object is related to.verticalExaggeration
- the vertical exaggeration of the scene containing this object.public int getHeight()
public int[] getObstructionFlags()
public List<Position> getPositions()
public Position getReferencePosition()
Movable
public Sector getSector()
GeographicExtent
public int getWidth()
protected void initialize()
AbstractShape
initialize
in class AbstractShape
public List<Intersection> intersect(Line line, Terrain terrain) throws InterruptedException
AbstractShape
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.intersect
in class AbstractShape
line
- the line to intersect.terrain
- the Terrain
to use when computing the shape's geometry.InterruptedException
- if the operation is interrupted.Terrain
public boolean isEnableSides()
public String isExportFormatSupported(String mimeType)
Exportable
isExportFormatSupported
in interface Exportable
isExportFormatSupported
in class AbstractShape
mimeType
- Desired export format.Exportable.FORMAT_SUPPORTED
, Exportable.FORMAT_NOT_SUPPORTED
, or Exportable.FORMAT_PARTIALLY_SUPPORTED
.Exportable.export(String, Object)
protected boolean isOrderedRenderableValid(DrawContext dc)
AbstractShape
AbstractShape.makeOrderedRenderable(DrawContext)
just prior to adding the shape to the ordered renderable list.isOrderedRenderableValid
in class AbstractShape
dc
- the current draw context.protected void makeGridNormals()
protected void makeGridTriangles()
protected void makeGridVertices(DrawContext dc)
protected void makeSides()
public void moveTo(Position position)
Movable
position
- the new position of the shape's reference position.protected boolean mustApplyTexture(DrawContext dc)
AbstractShape
mustApplyTexture
in class AbstractShape
dc
- the current draw contextpublic void setEnableSides(boolean enableSides)
protected void setTriangleNormals(int[] flags, int[] indices)
protected boolean shouldUseVBOs(DrawContext dc)
AbstractShape
shouldUseVBOs
in class AbstractShape
dc
- the current draw context.protected static FloatBuffer trimBuffer(FloatBuffer buffer)