|
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.render.Polyline
public class Polyline
| Nested Class Summary | |
|---|---|
protected static class |
Polyline.ExtentInfo
|
| Field Summary | |
|---|---|
static int |
ANTIALIAS_DONT_CARE
|
static int |
ANTIALIAS_FASTEST
|
static int |
ANTIALIAS_NICEST
|
protected int |
antiAliasHint
|
protected boolean |
closed
|
protected Color |
color
|
protected List<List<Vec4>> |
currentSpans
|
protected Object |
delegateOwner
|
protected HashMap<Globe,Polyline.ExtentInfo> |
extents
|
protected double |
eyeDistance
|
protected boolean |
filled
|
protected boolean |
followTerrain
|
protected long |
frameNumber
|
protected long |
geomGenTimeStamp
|
protected double |
geomGenVE
|
static int |
GREAT_CIRCLE
|
protected Color |
highlightColor
|
protected boolean |
highlighted
|
static int |
LINEAR
|
protected double |
lineWidth
|
static int |
LOXODROME
|
protected LengthMeasurer |
measurer
|
protected int |
numSubsegments
|
protected double |
offset
|
protected int |
pathType
|
protected Layer |
pickLayer
|
protected PickSupport |
pickSupport
|
protected ArrayList<Position> |
positions
|
protected Vec4 |
referenceCenterPoint
|
static int |
RHUMB_LINE
|
protected int |
stippleFactor
|
protected short |
stipplePattern
|
protected double |
terrainConformance
|
| Constructor Summary | |
|---|---|
Polyline()
|
|
Polyline(Iterable<? extends LatLon> positions,
double elevation)
|
|
Polyline(Iterable<? extends Position> positions)
|
|
| Method Summary | |
|---|---|
protected ArrayList<Vec4> |
addPointToSpan(Vec4 p,
ArrayList<Vec4> span)
|
protected void |
addSpan(ArrayList<Vec4> span)
|
protected ArrayList<Vec4> |
clipAndAdd(DrawContext dc,
Vec4 ptA,
Vec4 ptB,
ArrayList<Vec4> span)
|
protected static double[] |
computeElevationExtremes(Iterable<? extends Position> positions)
|
protected Extent |
computeExtent(DrawContext dc)
|
protected Extent |
computeExtent(Globe globe,
double verticalExaggeration)
|
protected Vec4 |
computePoint(DrawContext dc,
Position pos,
boolean applyOffset)
|
protected void |
computeReferenceCenter(DrawContext dc)
|
protected double |
computeSegmentLength(DrawContext dc,
Position posA,
Position posB)
|
protected void |
draw(DrawContext dc)
If the scene controller is rendering ordered renderables, this method draws this placemark's image as an ordered renderable. |
protected void |
drawOrderedRenderable(DrawContext dc)
|
int |
getAntiAliasHint()
|
Color |
getColor()
|
Object |
getDelegateOwner()
Returns the delegate owner of this Polyline. |
double |
getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point. |
Extent |
getExtent(DrawContext dc)
Returns this Polyline's enclosing volume as an Extent in model coordinates, given
a specified DrawContext. |
Extent |
getExtent(Globe globe,
double verticalExaggeration)
Returns this Polyline's enclosing volume as an Extent in model coordinates, given
a specified Globe and vertical exaggeration (see SceneController.getVerticalExaggeration(). |
Color |
getHighlightColor()
|
double |
getLength()
Returns the length of the line as drawn. |
double |
getLength(Globe globe)
Returns the object's length in meters. |
double |
getLineWidth()
|
LengthMeasurer |
getMeasurer()
|
int |
getNumSubsegments()
|
double |
getOffset()
|
int |
getPathType()
|
String |
getPathTypeString()
|
Iterable<Position> |
getPositions()
|
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position. |
String |
getRestorableState()
Returns an XML state document String describing the public attributes of this Polyline. |
int |
getStippleFactor()
|
short |
getStipplePattern()
|
double |
getTerrainConformance()
|
protected boolean |
intersectsFrustum(DrawContext dc)
Indicates whether the shape is visible in the current view. |
boolean |
isClosed()
|
boolean |
isFilled()
|
boolean |
isFollowTerrain()
|
boolean |
isHighlighted()
|
protected boolean |
isSegmentVisible(DrawContext dc,
Position posA,
Position posB,
Vec4 ptA,
Vec4 ptB)
|
protected ArrayList<Vec4> |
makeSegment(DrawContext dc,
Position posA,
Position posB,
Vec4 ptA,
Vec4 ptB)
|
protected void |
makeVertices(DrawContext dc)
|
void |
move(Position delta)
Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North. |
void |
moveTo(Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North. |
void |
pick(DrawContext dc,
Point pickPoint)
Executes a pick of the ordered renderable. |
void |
render(DrawContext dc)
Causes this Renderable to render itself using the provided draw context. |
void |
restoreState(String stateInXml)
Restores publicly settable attribute values found in the specified XML state document String. |
void |
setAntiAliasHint(int hint)
|
void |
setClosed(boolean closed)
|
void |
setColor(Color color)
|
void |
setDelegateOwner(Object owner)
Specifies the delegate owner of this Polyline. |
void |
setFilled(boolean filled)
|
void |
setFollowTerrain(boolean followTerrain)
Indicates whether the path should follow the terrain's surface. |
void |
setHighlightColor(Color highlightColor)
|
void |
setHighlighted(boolean highlighted)
|
void |
setLineWidth(double lineWidth)
|
void |
setNumSubsegments(int numSubsegments)
Specifies the number of intermediate segments to draw for each segment between positions. |
void |
setOffset(double offset)
Specifies an offset, in meters, to add to the path points when the path's follow-terrain attribute is true. |
void |
setPathType(int pathType)
Sets the type of path to draw, one of GREAT_CIRCLE, which draws each segment of the path as a great
circle, LINEAR, which determines the intermediate positions between segments by interpolating the
segment endpoints, or RHUMB_LINE, which draws each segment of the path as a line of constant heading. |
void |
setPathType(String pathType)
Sets the type of path to draw, one of AVKey.GREAT_CIRCLE, which draws each segment of the path as a great
circle, AVKey.LINEAR, which determines the intermediate positions between segments by interpolating the
segment endpoints, or AVKey.RHUMB_LINE, which draws each segment of the path as a line of constant
heading. |
void |
setPositions(Iterable<? extends LatLon> inPositions,
double altitude)
Sets the paths positions as latitude and longitude values at a constant altitude. |
void |
setPositions(Iterable<? extends Position> inPositions)
Specifies the path's positions. |
void |
setStippleFactor(int stippleFactor)
Sets the stipple factor for specifying line types other than solid. |
void |
setStipplePattern(short stipplePattern)
Sets the stipple pattern for specifying line types other than solid. |
void |
setTerrainConformance(double terrainConformance)
Specifies the precision to which the path follows the terrain when the follow-terrain attribute is true. |
| 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 |
| Field Detail |
|---|
public static final int ANTIALIAS_DONT_CARE
public static final int ANTIALIAS_FASTEST
public static final int ANTIALIAS_NICEST
protected int antiAliasHint
protected boolean closed
protected Color color
protected List<List<Vec4>> currentSpans
protected Object delegateOwner
protected HashMap<Globe,Polyline.ExtentInfo> extents
protected double eyeDistance
protected boolean filled
protected boolean followTerrain
protected long frameNumber
protected long geomGenTimeStamp
protected double geomGenVE
public static final int GREAT_CIRCLE
protected Color highlightColor
protected boolean highlighted
public static final int LINEAR
protected double lineWidth
public static final int LOXODROME
protected LengthMeasurer measurer
protected int numSubsegments
protected double offset
protected int pathType
protected Layer pickLayer
protected PickSupport pickSupport
protected ArrayList<Position> positions
protected Vec4 referenceCenterPoint
public static final int RHUMB_LINE
protected int stippleFactor
protected short stipplePattern
protected double terrainConformance
| Constructor Detail |
|---|
public Polyline()
public Polyline(Iterable<? extends LatLon> positions,
double elevation)
public Polyline(Iterable<? extends Position> positions)
| Method Detail |
|---|
protected ArrayList<Vec4> addPointToSpan(Vec4 p,
ArrayList<Vec4> span)
protected void addSpan(ArrayList<Vec4> span)
protected ArrayList<Vec4> clipAndAdd(DrawContext dc,
Vec4 ptA,
Vec4 ptB,
ArrayList<Vec4> span)
protected static double[] computeElevationExtremes(Iterable<? extends Position> positions)
protected Extent computeExtent(DrawContext dc)
protected Extent computeExtent(Globe globe,
double verticalExaggeration)
protected Vec4 computePoint(DrawContext dc,
Position pos,
boolean applyOffset)
protected void computeReferenceCenter(DrawContext dc)
protected double computeSegmentLength(DrawContext dc,
Position posA,
Position posB)
protected void draw(DrawContext dc)
dc - the current draw context.protected void drawOrderedRenderable(DrawContext dc)
public int getAntiAliasHint()
public Color getColor()
public Object getDelegateOwner()
public double getDistanceFromEye()
OrderedRenderable
getDistanceFromEye in interface OrderedRenderablepublic Extent getExtent(DrawContext dc)
Extent in model coordinates, given
a specified DrawContext. The returned Extent may be different than the Extent
returned by calling getExtent(gov.nasa.worldwind.globes.Globe, double) with the DrawContext's Globe and
vertical exaggeration. Additionally, this may cache the computed extent and is therefore potentially faster than
calling getExtent(gov.nasa.worldwind.globes.Globe, double).
dc - the current DrawContext.
IllegalArgumentException - if the DrawContext is null, or if the Globe held by the DrawContext is null.
public Extent getExtent(Globe globe,
double verticalExaggeration)
Extent in model coordinates, given
a specified Globe and vertical exaggeration (see SceneController.getVerticalExaggeration().
getExtent in interface ExtentHolderglobe - the Globe this Polyline is related to.verticalExaggeration - the vertical exaggeration to apply.
IllegalArgumentException - if the Globe is null.public Color getHighlightColor()
public double getLength()
public double getLength(Globe globe)
MeasurableLength
getLength in interface MeasurableLengthglobe - The globe the object is related to.
public double getLineWidth()
public LengthMeasurer getMeasurer()
public int getNumSubsegments()
public double getOffset()
public int getPathType()
public String getPathTypeString()
public Iterable<Position> getPositions()
public Position getReferencePosition()
Movable
getReferencePosition in interface Movablepublic String getRestorableState()
getRestorableState in interface Restorablepublic int getStippleFactor()
public short getStipplePattern()
public double getTerrainConformance()
protected boolean intersectsFrustum(DrawContext dc)
dc - the draw context.
public boolean isClosed()
public boolean isFilled()
public boolean isFollowTerrain()
public boolean isHighlighted()
protected boolean isSegmentVisible(DrawContext dc,
Position posA,
Position posB,
Vec4 ptA,
Vec4 ptB)
protected ArrayList<Vec4> makeSegment(DrawContext dc,
Position posA,
Position posB,
Vec4 ptA,
Vec4 ptB)
protected void makeVertices(DrawContext dc)
public void move(Position delta)
Movable
move in interface Movabledelta - the latitude and longitude to add to the shape's reference position.public void moveTo(Position position)
Movable
moveTo in interface Movableposition - the new position of the shape's reference position.
public void pick(DrawContext dc,
Point pickPoint)
OrderedRenderable
pick in interface OrderedRenderabledc - the current draw context.pickPoint - the pick point.public void render(DrawContext dc)
RenderableRenderable to render itself using the provided draw context.
render in interface Renderabledc - the DrawContext to be usedDrawContextpublic void restoreState(String stateInXml)
stateInXml must be a well formed XML document String, or this will throw an
IllegalArgumentException. Unknown structures in stateInXml are benign, because they will simply be
ignored.
restoreState in interface RestorablestateInXml - an XML document String describing a Polyline.
IllegalArgumentException - If stateInXml is null, or if stateInXml is not a well
formed XML document String.public void setAntiAliasHint(int hint)
public void setClosed(boolean closed)
public void setColor(Color color)
public void setDelegateOwner(Object owner)
owner - the object to use as the pickable object returned during picking, or null to return the Polyline.public void setFilled(boolean filled)
public void setFollowTerrain(boolean followTerrain)
true, the elevation
values in this path's positions are ignored and the path is drawn on the terrain surface. Otherwise the path is
drawn according to the elevations given in the path's positions. If following the terrain, the path may also have
an offset. See setOffset(double);
followTerrain - true to follow the terrain, otherwise false.public void setHighlightColor(Color highlightColor)
public void setHighlighted(boolean highlighted)
public void setLineWidth(double lineWidth)
public void setNumSubsegments(int numSubsegments)
numSubsegments - the number of intermediate subsegments.public void setOffset(double offset)
setFollowTerrain(boolean).
offset - the path pffset in meters.public void setPathType(int pathType)
GREAT_CIRCLE, which draws each segment of the path as a great
circle, LINEAR, which determines the intermediate positions between segments by interpolating the
segment endpoints, or RHUMB_LINE, which draws each segment of the path as a line of constant heading.
pathType - the type of path to draw.public void setPathType(String pathType)
AVKey.GREAT_CIRCLE, which draws each segment of the path as a great
circle, AVKey.LINEAR, which determines the intermediate positions between segments by interpolating the
segment endpoints, or AVKey.RHUMB_LINE, which draws each segment of the path as a line of constant
heading.
pathType - the type of path to draw.
public void setPositions(Iterable<? extends LatLon> inPositions,
double altitude)
inPositions - the latitudes and longitudes of the positions.altitude - the elevation to assign each position.public void setPositions(Iterable<? extends Position> inPositions)
inPositions - the path positions.public void setStippleFactor(int stippleFactor)
setStipplePattern(short).
stippleFactor - the stipple factor.public void setStipplePattern(short stipplePattern)
setStippleFactor(int).
stipplePattern - the stipple pattern.public void setTerrainConformance(double terrainConformance)
terrainConformance - the path conformance in pixels.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||