public class Polygon extends AbstractShape
Polygons are safe to share among WorldWindows. They should not be shared among layers in the same WorldWindow.
In order to support simultaneous use of this shape with multiple globes (windows), this shape maintains a cache of data computed relative to each globe. During rendering, the data for the currently active globe, as indicated in the draw context, is made current. Subsequently called methods rely on the existence of this current data cache entry.
When drawn on a 2D globe, this shape uses a SurfacePolygon
to represent itself. The following features are
not provided in this case: rotation and texture.
Modifier and Type | Class and Description |
---|---|
protected static class |
Polygon.BoundaryInfo
Holds information for each contour of the polygon.
|
protected static class |
Polygon.ShapeData
This class holds globe-specific data for this shape.
|
AbstractShape.AbstractShapeData
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.util.List<? extends Position>> |
boundaries
The location of each vertex in this shape's boundaries.
|
protected static java.util.HashMap<java.lang.Integer,java.nio.IntBuffer> |
edgeIndexBuffers
This static hash map holds the vertex indices that define the shape's visual outline.
|
protected int |
numPositions
The total number of positions in the entire polygon.
|
protected java.lang.Object |
previousIntersectionGlobeStateKey
The globe state key for the globe used in the most recent intersection calculation.
|
protected Polygon.ShapeData |
previousIntersectionShapeData
The shape data used for the previous intersection calculation.
|
protected Terrain |
previousIntersectionTerrain
The terrain used in the most recent intersection calculations.
|
protected java.lang.Double |
rotation
This shape's rotation, in degrees positive counterclockwise.
|
protected WWTexture |
texture
If an image source was specified, this is the WWTexture form.
|
protected java.nio.FloatBuffer |
textureCoordsBuffer
This shape's texture coordinates.
|
protected static int |
VBO_THRESHOLD
Indicates the number of vertices that must be present in order for VBOs to be used to render this shape.
|
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, viewDistanceExpiration, visible
FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
Constructor and Description |
---|
Polygon()
Construct a polygon with an empty outer boundary.
|
Polygon(java.lang.Iterable<? extends Position> corners)
Construct a polygon for a specified outer boundary.
|
Polygon(Position.PositionList corners)
Construct a polygon for a specified list of outer-boundary positions.
|
Modifier and Type | Method and Description |
---|---|
void |
addInnerBoundary(java.lang.Iterable<? extends Position> corners)
Add an inner boundary to this polygon.
|
protected OGLStackHandler |
beginDrawing(DrawContext dc,
int attrMask)
Establish the OpenGL state needed to draw this shape.
|
void |
clearIntersectionGeometry() |
protected java.nio.FloatBuffer |
computeBoundaryNormals(Polygon.BoundaryInfo boundary,
java.nio.FloatBuffer nBuf)
Compute normal vectors for a boundary's vertices.
|
protected void |
computeBoundaryVertices(Terrain terrain,
Polygon.BoundaryInfo boundary,
Vec4 refPoint,
Matrix rotationMatrix)
Compute the vertices associated with a specified boundary.
|
protected Extent |
computeExtent(Polygon.BoundaryInfo boundary,
Vec4 refPoint)
Computes the Cartesian extent of a polygon boundary.
|
protected double |
computeEyeDistance(DrawContext dc,
Polygon.ShapeData shapeData)
Computes the minimum distance between this polygon and the eye point.
|
protected Vec4 |
computePolygonNormal(DrawContext dc,
Polygon.ShapeData shapeData) |
protected Vec4 |
computeReferencePoint(Terrain terrain,
Matrix rotationMatrix) |
protected Matrix |
computeRotationMatrix(Globe globe) |
protected int |
countPositions()
Counts the total number of positions in this shape, including all positions in all boundaries.
|
protected AbstractShape.AbstractShapeData |
createCacheEntry(DrawContext dc)
Creates and returns a new cache entry specific to the subclass.
|
protected void |
createFullGeometry(DrawContext dc,
Terrain terrain,
Polygon.ShapeData shapeData,
boolean skipOuterBoundary)
Computes a shape's full geometry.
|
protected void |
createGeometry(DrawContext dc,
Polygon.ShapeData shapeData)
Compute the cap geometry.
|
protected Polygon.ShapeData |
createIntersectionGeometry(Terrain terrain) |
protected void |
createMinimalGeometry(DrawContext dc,
Polygon.ShapeData shapeData)
Compute enough geometry to determine this polygon's extent, reference point and eye distance.
|
protected void |
createNormals(Polygon.ShapeData shapeData)
Create this shape's vertex normals.
|
protected SurfaceShape |
createSurfaceShape()
Returns a
SurfaceShape that corresponds to this Path and is used for drawing on 2D globes. |
protected void |
createTessllationGeometry(DrawContext dc,
Polygon.ShapeData shapeData)
Tessellates the polygon.
|
protected void |
createVertices(Terrain terrain,
Polygon.ShapeData shapeData,
boolean skipOuterBoundary)
Computes the Cartesian vertices for this shape.
|
protected void |
doDrawInterior(DrawContext dc)
Draws this shape's interior.
|
protected void |
doDrawInteriorVA(DrawContext dc,
Polygon.ShapeData shapeData) |
protected void |
doDrawInteriorVBO(DrawContext dc,
int[] vboIds,
Polygon.ShapeData shapeData) |
protected void |
doDrawOutline(DrawContext dc)
Draws this shape's outline.
|
protected void |
doDrawOutlineVA(DrawContext dc,
Polygon.ShapeData shapeData) |
protected void |
doDrawOutlineVBO(DrawContext dc,
int[] vboIds,
Polygon.ShapeData shapeData) |
protected void |
doExportAsKML(javax.xml.stream.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 |
exportBoundaryAsLinearRing(javax.xml.stream.XMLStreamWriter xmlWriter,
java.lang.Iterable<? extends LatLon> boundary)
Writes the boundary in KML as either a list of lat, lon, altitude tuples or lat, lon tuples, depending on the
type originally specified.
|
protected java.util.List<? extends Position> |
fillBoundary(java.lang.Iterable<? extends Position> corners)
Copies a boundary's positions to this shape's internal boundary list.
|
protected void |
fillVBO(DrawContext dc)
Fill this shape's vertex buffer objects.
|
protected void |
generateInteriorIndices(Polygon.ShapeData shapeData) |
java.util.List<java.util.List<? extends Position>> |
getBoundaries()
Returns this shape's boundaries.
|
protected Polygon.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() . |
java.lang.Iterable<? extends LatLon> |
getOuterBoundary()
Returns the list of positions defining this polygon's outer boundary.
|
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.
|
java.lang.Double |
getRotation()
Indicates the amount of rotation applied to this polygon.
|
Sector |
getSector()
Returns the object's geographic extent.
|
protected WWTexture |
getTexture()
Get the texture applied to this polygon.
|
float[] |
getTextureCoords()
Returns the texture coordinates for this polygon.
|
java.lang.Object |
getTextureImageSource()
Returns this polygon's texture image source.
|
protected void |
initialize()
Called during construction to establish any subclass-specific state such as different default values than those
set by this class.
|
protected void |
intersect(Line line,
Polygon.ShapeData shapeData,
java.util.List<Intersection> intersections) |
java.util.List<Intersection> |
intersect(Line line,
Terrain terrain)
Compute the intersections of a specified line with this polygon.
|
protected boolean |
isOrderedRenderableValid(DrawContext dc)
Determines whether this shape's ordered renderable state is valid and can be rendered.
|
protected boolean |
isOuterBoundaryValid() |
protected boolean |
isSameAsPreviousTerrain(Terrain terrain) |
void |
moveTo(Globe globe,
Position position)
Move 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.
|
protected boolean |
mustApplyTexture(DrawContext dc)
Indicates whether texture should be applied to this shape.
|
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.
|
java.util.List<? extends Position> |
outerBoundary()
Returns a reference to the outer boundary of this polygon.
|
void |
render(DrawContext dc)
Causes this
Renderable to render itself using the provided draw context. |
protected void |
reset()
Void any computed data.
|
void |
setOuterBoundary(java.lang.Iterable<? extends Position> corners)
Specifies the latitude, longitude and altitude of the outer boundary positions defining this polygon.
|
void |
setRotation(java.lang.Double rotation)
Specifies the amount of rotation applied to this polygon.
|
protected void |
setSurfacePolygonBoundaries(SurfaceShape shape) |
protected void |
setSurfacePolygonTexImageSource(SurfaceShape shape) |
void |
setTextureImageSource(java.lang.Object imageSource,
float[] texCoords,
int texCoordCount)
Specifies the texture to apply to this polygon.
|
protected boolean |
shouldUseVBOs(DrawContext dc)
Indicates whether this shape should use OpenGL vertex buffer objects.
|
protected void |
tessellatePolygon(Polygon.ShapeData shapeData,
Vec4 normal)
Tessellates the polygon from its vertices.
|
protected void |
writeKMLBoundaries(javax.xml.stream.XMLStreamWriter xmlWriter)
Write the boundary of the polygon as KML.
|
addOrderedRenderable, checkViewDistanceExpiration, clearCachedVbos, computeExtentFromPositions, computePoint, computePoint, countTriangleVertices, createPickedObject, 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, isExportFormatSupported, isHighlighted, isTerrainDependent, isViewDistanceExpiration, isVisible, makeOrderedRenderable, makeTexture, move, mustApplyLighting, mustApplyLighting, mustCreateNormals, mustCreateNormals, mustDrawInterior, mustDrawOutline, pick, prepareToDrawInterior, prepareToDrawOutline, preRender, 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 java.util.List<java.util.List<? extends Position>> boundaries
protected static java.util.HashMap<java.lang.Integer,java.nio.IntBuffer> edgeIndexBuffers
protected int numPositions
protected java.lang.Object previousIntersectionGlobeStateKey
protected Polygon.ShapeData previousIntersectionShapeData
protected Terrain previousIntersectionTerrain
protected java.lang.Double rotation
protected WWTexture texture
protected java.nio.FloatBuffer textureCoordsBuffer
protected static final int VBO_THRESHOLD
public Polygon()
public Polygon(java.lang.Iterable<? extends Position> corners)
corners
- the list of locations defining the polygon.java.lang.IllegalArgumentException
- if the location list is null.public Polygon(Position.PositionList corners)
corners
- the list of positions -- latitude longitude and altitude -- defining the polygon. The current
altitude mode determines whether the positions are considered relative to mean sea level (they are
"absolute") or the ground elevation at the associated latitude and longitude.java.lang.IllegalArgumentException
- if the position list is null.public void addInnerBoundary(java.lang.Iterable<? extends Position> corners)
corners
- the new boundary positions. A copy of the list is created and retained, and a duplicate of the
first position is added to the list if the first and last positions are not identical.java.lang.IllegalArgumentException
- if the location list is null or contains fewer than three locations.protected OGLStackHandler beginDrawing(DrawContext dc, int attrMask)
AbstractShape
A AbstractShape.AbstractShapeData
must be current when this method is called.
beginDrawing
in class AbstractShape
dc
- the current draw context.attrMask
- an attribute mask indicating state the caller will set. This base class implementation sets
GL_CURRENT_BIT, GL_LINE_BIT, GL_HINT_BIT, GL_POLYGON_BIT, GL_COLOR_BUFFER_BIT, and
GL_TRANSFORM_BIT
.public void clearIntersectionGeometry()
protected java.nio.FloatBuffer computeBoundaryNormals(Polygon.BoundaryInfo boundary, java.nio.FloatBuffer nBuf)
boundary
- the boundary to compute normals for.nBuf
- the buffer in which to place the computed normals. Must have enough remaining space to hold the
normals.protected void computeBoundaryVertices(Terrain terrain, Polygon.BoundaryInfo boundary, Vec4 refPoint, Matrix rotationMatrix)
terrain
- the terrain to use when calculating vertices relative to the ground.boundary
- the boundary to compute vertices for.refPoint
- the reference point. Vertices are computed relative to this point, which is usually the
shape's reference point.rotationMatrix
- the rotation matrix to apply to the vertices.protected Extent computeExtent(Polygon.BoundaryInfo boundary, Vec4 refPoint)
boundary
- The boundary to compute the extent for.refPoint
- the shape's reference point.protected double computeEyeDistance(DrawContext dc, Polygon.ShapeData shapeData)
A AbstractShape.AbstractShapeData
must be current when this method is called.
dc
- the draw context.shapeData
- the current shape data for this shape.protected Vec4 computePolygonNormal(DrawContext dc, Polygon.ShapeData shapeData)
protected int countPositions()
protected AbstractShape.AbstractShapeData createCacheEntry(DrawContext dc)
AbstractShape
createCacheEntry
in class AbstractShape
dc
- the current draw context.protected void createFullGeometry(DrawContext dc, Terrain terrain, Polygon.ShapeData shapeData, boolean skipOuterBoundary)
dc
- the current draw context.terrain
- the terrain to use when computing the geometry.shapeData
- the current shape data for this shape.skipOuterBoundary
- true if outer boundaries vertices do not need to be calculated, otherwise false.protected void createGeometry(DrawContext dc, Polygon.ShapeData shapeData)
A AbstractShape.AbstractShapeData
must be current when this method is called.
dc
- the current draw context.shapeData
- boundary vertices are calculated during createMinimalGeometry(DrawContext,
gov.nasa.worldwind.render.Polygon.ShapeData)
).protected Polygon.ShapeData createIntersectionGeometry(Terrain terrain)
protected void createMinimalGeometry(DrawContext dc, Polygon.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 createNormals(Polygon.ShapeData shapeData)
shapeData
- the current shape data holding the vertex coordinates and in which the normal vectors are added.
The normal vectors are appended to the vertex coordinates in the same buffer. The shape data's
coordinate buffer must have sufficient capacity to hold the vertex normals.protected SurfaceShape createSurfaceShape()
AbstractShape
SurfaceShape
that corresponds to this Path and is used for drawing on 2D globes.createSurfaceShape
in class AbstractShape
protected void createTessllationGeometry(DrawContext dc, Polygon.ShapeData shapeData)
This method catches OutOfMemoryError
exceptions and if the draw context is not null passes the exception
to the rendering exception listener (see WorldWindow.addRenderingExceptionListener(gov.nasa.worldwind.event.RenderingExceptionListener)
).
dc
- the draw context.shapeData
- the current shape data for this shape.protected void createVertices(Terrain terrain, Polygon.ShapeData shapeData, boolean skipOuterBoundary)
terrain
- the terrain to use if the altitude mode is relative to the terrain.shapeData
- the current shape data for this shape.skipOuterBoundary
- if true, don't calculate the vertices for the outer boundary. This is used when the
outer boundary vertices were computed as minimal geometry.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 doDrawInteriorVA(DrawContext dc, Polygon.ShapeData shapeData)
protected void doDrawInteriorVBO(DrawContext dc, int[] vboIds, Polygon.ShapeData shapeData)
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 doDrawOutlineVA(DrawContext dc, Polygon.ShapeData shapeData)
protected void doDrawOutlineVBO(DrawContext dc, int[] vboIds, Polygon.ShapeData shapeData)
protected void doExportAsKML(javax.xml.stream.XMLStreamWriter xmlWriter) throws java.io.IOException, javax.xml.stream.XMLStreamException
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 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 exportBoundaryAsLinearRing(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.Iterable<? extends LatLon> boundary) throws javax.xml.stream.XMLStreamException
xmlWriter
- the XML writer.boundary
- the boundary to write.javax.xml.stream.XMLStreamException
- if an error occurs during writing.protected java.util.List<? extends Position> fillBoundary(java.lang.Iterable<? extends Position> corners)
corners
- the boundary's positions.protected void fillVBO(DrawContext dc)
fillVBO
in class AbstractShape
dc
- the current draw context.protected void generateInteriorIndices(Polygon.ShapeData shapeData)
public java.util.List<java.util.List<? extends Position>> getBoundaries()
protected Polygon.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 java.lang.Iterable<? extends LatLon> getOuterBoundary()
public Position getReferencePosition()
Movable
public java.lang.Double getRotation()
public Sector getSector()
GeographicExtent
protected WWTexture getTexture()
public float[] getTextureCoords()
public java.lang.Object getTextureImageSource()
protected void initialize()
AbstractShape
initialize
in class AbstractShape
protected void intersect(Line line, Polygon.ShapeData shapeData, java.util.List<Intersection> intersections) throws java.lang.InterruptedException
java.lang.InterruptedException
public java.util.List<Intersection> intersect(Line line, Terrain terrain) throws java.lang.InterruptedException
WorldWind.ABSOLUTE
, the polygon'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 polygon's geometry.java.lang.InterruptedException
- if the operation is interrupted.Terrain
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 boolean isOuterBoundaryValid()
protected boolean isSameAsPreviousTerrain(Terrain terrain)
public void moveTo(Globe globe, Position position)
Note that this method overwrites the boundary locations lists, and therefore no longer refer to the originally specified boundary lists.
moveTo
in interface Movable2
moveTo
in class AbstractShape
globe
- the globe on which to move this shape.position
- the new position of the shape's reference position.java.lang.IllegalArgumentException
- if the globe or position is null.public void moveTo(Position position)
Note that this method overwrites the boundary locations lists, and therefore no longer refer to the originally specified boundary lists.
position
- the new position of the shape's reference position.java.lang.IllegalArgumentException
- if the position is null.protected boolean mustApplyTexture(DrawContext dc)
AbstractShape
Note: This method always returns false during the pick pass.
mustApplyTexture
in class AbstractShape
dc
- the current draw contextprotected boolean mustRegenerateGeometry(DrawContext dc)
AbstractShape
A AbstractShape.AbstractShapeData
must be current when this method is called.
mustRegenerateGeometry
in class AbstractShape
dc
- the current draw context.public java.util.List<? extends Position> outerBoundary()
public void render(DrawContext dc)
Renderable
Renderable
to render itself using the provided draw context.render
in interface Renderable
render
in class AbstractShape
dc
- the DrawContext
to be usedDrawContext
protected void reset()
reset
in class AbstractShape
public void setOuterBoundary(java.lang.Iterable<? extends Position> corners)
corners
- this polygon's positions. A copy of the list is made and retained, and a duplicate of the first
position is appended to the copy if the first and last positions are not identical.java.lang.IllegalArgumentException
- if the location list is null or contains fewer than three locations.public void setRotation(java.lang.Double rotation)
rotation
- the amount of rotation to apply, in degrees, or null to apply no rotation.protected void setSurfacePolygonBoundaries(SurfaceShape shape)
protected void setSurfacePolygonTexImageSource(SurfaceShape shape)
public void setTextureImageSource(java.lang.Object imageSource, float[] texCoords, int texCoordCount)
imageSource
- the texture image source. May be a String
identifying a file path or URL, a File
, or a URL
.texCoords
- the (s, t) texture coordinates aligning the image to the polygon. There must be one texture
coordinate pair, (s, t), for each polygon location in the polygon's outer boundary.texCoordCount
- the number of texture coordinates, (s, v) pairs, specified.java.lang.IllegalArgumentException
- if the image source is not null and either the texture coordinates are null or
inconsistent with the specified texture-coordinate count, or there are fewer
than three texture coordinate pairs.protected boolean shouldUseVBOs(DrawContext dc)
AbstractShape
shouldUseVBOs
in class AbstractShape
dc
- the current draw context.protected void tessellatePolygon(Polygon.ShapeData shapeData, Vec4 normal)
shapeData
- the polygon boundaries.normal
- a unit normal vector for the plane containing the polygon vertices. Even though the the vertices
might not be coplanar, only one representative normal is used for tessellation.protected void writeKMLBoundaries(javax.xml.stream.XMLStreamWriter xmlWriter) throws java.io.IOException, javax.xml.stream.XMLStreamException
xmlWriter
- XML writer to receive the output.java.io.IOException
- If an exception occurs writing the XML stream.javax.xml.stream.XMLStreamException
- If an exception occurs writing the XML stream.