|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.render.AbstractShape
gov.nasa.worldwind.render.AbstractGeneralShape
public abstract class AbstractGeneralShape
A shape that is positioned and oriented independently of its defining geometry. This shape typically represents 3D models imported from COLLADA and other 3D file formats. The model's geometry is defined in its own coordinate system; properties of this shape place and orient the model geographically. Specific model types subclass this class to provide their implementation and any additional properties.
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 appliesShapeAttributes 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.
| Nested Class Summary | |
|---|---|
protected static class |
AbstractGeneralShape.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 |
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 Map<String,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. |
| Fields inherited from interface gov.nasa.worldwind.Exportable |
|---|
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED |
| Constructor Summary | |
|---|---|
AbstractGeneralShape()
Constructs a shape at 0 latitude, longitude and altitude. |
|
| Method Summary | |
|---|---|
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(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. |
Map<String,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(Map<String,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. |
| 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 |
|---|
protected Angle heading
protected Position modelPosition
protected Vec4 modelScale
protected Angle pitch
protected Map<String,Object> resourceMap
protected Angle roll
| Constructor Detail |
|---|
public AbstractGeneralShape()
ABSOLUTE, the default altitude is relative to mean sea level.
| Method Detail |
|---|
protected double computeEyeDistance(DrawContext dc,
AbstractGeneralShape.ShapeData shapeData)
AbstractShape.AbstractShapeData must be current when this method is called.
dc - the current draw context.shapeData - the current shape data for this shape.
protected Vec4 computeReferencePoint(Terrain terrain)
protected void doExportAsKML(XMLStreamWriter xmlWriter)
throws IOException,
XMLStreamException
AbstractShape
doExportAsKML in class AbstractShapexmlWriter - 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 AbstractGeneralShape.ShapeData getCurrent()
public Angle getHeading()
public Position getModelPosition()
public Vec4 getModelScale()
public Angle getPitch()
public Position getReferencePosition()
Movable
public Map<String,Object> getResourceMap()
public Angle getRoll()
public Sector getSector()
protected void initialize()
AbstractShape
initialize in class AbstractShapepublic 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.
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(Map<String,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.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||