public abstract class AbstractGeneralShape extends AbstractShape
This class also accepts a resource map to independently link resources named in the model definition (the defining model file) to actual resources. Each map entry's key is a resource name as expressed in the model definition. Each map entry's value is the reference to the actual resource. The reference is interpreted by rules specific to the model format, but typically may be a relative or absolute file reference or a URL to a local or remote resource. If the map or an entry referred to by the model definition is not defined, resource references are typically considered relative to the location of the model definition's location.
In the case of a COLLADA file referenced from a KML file, relative references are considered relative to the location of the KML file. If the file is KMZ, relative references are considered references to resources within the KMZ archive.
This class applies ShapeAttributes
to the shape, but the effect of some of those attributes, such as ShapeAttributes.isDrawOutline()
is dependent on the specific implementation of this AbstractGeneralShape
. See
the class description of those shapes to determine how shape attributes are applied.
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractGeneralShape.ShapeData
This class holds globe-specific data for this shape.
|
AbstractShape.AbstractShapeData
Modifier and Type | Field and Description |
---|---|
protected Angle |
heading
This shape's heading, positive values are clockwise from north.
|
protected Position |
modelPosition
This shape's geographic location.
|
protected Vec4 |
modelScale
A scale to apply to the model.
|
protected Angle |
pitch
This shape's pitch (often called tilt), its rotation about the model's X axis.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
resourceMap
A map indicating the actual location of resources named in the model.
|
protected Angle |
roll
This shape's roll, its rotation about the model's Y axis.
|
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 |
---|
AbstractGeneralShape()
Constructs a shape at 0 latitude, longitude and altitude.
|
Modifier and Type | Method and Description |
---|---|
protected double |
computeEyeDistance(DrawContext dc,
AbstractGeneralShape.ShapeData shapeData)
Computes the minimum distance between this shape and the eye point.
|
protected Vec4 |
computeReferencePoint(Terrain terrain) |
protected void |
doExportAsKML(javax.xml.stream.XMLStreamWriter xmlWriter)
Exports shape-specific fields.
|
protected AbstractGeneralShape.ShapeData |
getCurrent()
Returns the current shape data cache entry.
|
Angle |
getHeading()
Indicates this shape's heading, its rotation clockwise from north.
|
Position |
getModelPosition()
Indicates this shape's geographic position.
|
Vec4 |
getModelScale()
Indicates this shape's scale, if any.
|
Angle |
getPitch()
Indicates this shape's pitch -- often referred to as tilt -- the angle to rotate this shape's model about its X
axis.
|
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.
|
java.util.Map<java.lang.String,java.lang.Object> |
getResourceMap()
Returns this shape's resource map.
|
Angle |
getRoll()
Indicates this shape's roll, the angle to rotate this shape's model about its Y axis.
|
Sector |
getSector()
Returns the object's geographic extent.
|
protected void |
initialize()
Called during construction to establish any subclass-specific state such as different default values than those
set by this class.
|
void |
moveTo(Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to
North.
|
void |
setHeading(Angle heading)
Specifies this shape's heading, its rotation clockwise from north.
|
void |
setModelPosition(Position modelPosition)
Specifies this shape's geographic position.
|
void |
setModelScale(Vec4 modelScale)
Specifies this shape's scale.
|
void |
setPitch(Angle pitch)
Specifies this shape's pitch -- often referred to as tilt -- the angle to rotate this shape's model about its X
axis.
|
void |
setResourceMap(java.util.Map<java.lang.String,java.lang.Object> resourceMap)
Specifies this shape's resource map.
|
void |
setRoll(Angle roll)
Specifies this shape's roll, the angle to rotate this shape's model about its Y axis.
|
addOrderedRenderable, beginDrawing, checkViewDistanceExpiration, clearCachedVbos, computeExtentFromPositions, computePoint, computePoint, countTriangleVertices, createCacheEntry, createPickedObject, createSurfaceShape, determineActiveAttributes, doDrag, doDrawInterior, doDrawOrderedRenderable, doDrawOutline, doGetRestorableState, doMakeOrderedRenderable, doRestoreState, drag, drawBatched, drawInterior, drawOrderedRenderable, drawOutline, endDrawing, export, exportAsKML, fillVBO, getActiveAttributes, getAltitudeMode, getAttributes, getCurrentData, getDelegateOwner, getDistanceFromEye, getExtent, getExtent, getGeometryRegenerationInterval, getHighlightAttributes, getOutlinePickWidth, getReferencePoint, getRestorableState, getVboIds, intersect, intersectsFrustum, isDragEnabled, isEnableBatchPicking, isEnableBatchRendering, isEnableDepthOffset, isExportFormatSupported, isHighlighted, isOrderedRenderableValid, isTerrainDependent, isViewDistanceExpiration, isVisible, makeOrderedRenderable, makeTexture, move, moveTo, mustApplyLighting, mustApplyLighting, mustApplyTexture, 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, shouldUseVBOs, 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 Angle heading
protected Position modelPosition
protected Vec4 modelScale
protected Angle pitch
protected java.util.Map<java.lang.String,java.lang.Object> resourceMap
protected Angle roll
public AbstractGeneralShape()
ABSOLUTE
, the default altitude is relative to mean sea level.protected double computeEyeDistance(DrawContext dc, AbstractGeneralShape.ShapeData shapeData)
A AbstractShape.AbstractShapeData
must be current when this method is called.
dc
- the current draw context.shapeData
- the current shape data for this shape.protected void doExportAsKML(javax.xml.stream.XMLStreamWriter xmlWriter) throws java.io.IOException, javax.xml.stream.XMLStreamException
AbstractShape
doExportAsKML
in class AbstractShape
xmlWriter
- the export writer to write to.java.io.IOException
- if an IO error occurs while writing to the output destination.javax.xml.stream.XMLStreamException
- if an exception occurs converting this shape's fields to XML.protected AbstractGeneralShape.ShapeData getCurrent()
public Angle getHeading()
public Position getModelPosition()
public Vec4 getModelScale()
public Angle getPitch()
public Position getReferencePosition()
Movable
public java.util.Map<java.lang.String,java.lang.Object> getResourceMap()
public Angle getRoll()
public Sector getSector()
protected void initialize()
AbstractShape
initialize
in class AbstractShape
public void moveTo(Position position)
Movable
position
- the new position of the shape's reference position.public void setHeading(Angle heading)
heading
- this shape's heading. May be null.public void setModelPosition(Position modelPosition)
modelPosition
- this shape's geographic position.java.lang.IllegalArgumentException
- if the position is null.public void setModelScale(Vec4 modelScale)
modelScale
- this shape's scale. May be null, in which case no scaling is applied.public void setPitch(Angle pitch)
pitch
- this shape's pitch. Positive values are clockwise as observed looking along the model's X axis
toward the model's origin. May be null.public void setResourceMap(java.util.Map<java.lang.String,java.lang.Object> resourceMap)
resourceMap
- the resource map for this shape. May be null, in which case no resource map is used.public void setRoll(Angle roll)
roll
- this shape's roll. May be null. Positive values are clockwise as observed looking along the model's Y
axis toward the origin.