Package gov.nasa.worldwind.render
Interface SurfaceShape
-
- All Superinterfaces:
Attributable
,AVList
,ExtentHolder
,Highlightable
,MeasurableArea
,MeasurableLength
,OrderedRenderable
,PreRenderable
,Renderable
,Restorable
,SurfaceObject
,SurfaceRenderable
- All Known Implementing Classes:
AbstractSurfaceShape
,DirectedSurfacePolyline
,KMLSurfacePolygonImpl
,SectorSelector.RegionShape
,SurfaceBox
,SurfaceCircle
,SurfaceEllipse
,SurfaceMultiPolygon
,SurfacePolygon
,SurfacePolygons
,SurfacePolyline
,SurfacePolylines
,SurfaceQuad
,SurfaceSector
,SurfaceSquare
public interface SurfaceShape extends SurfaceObject, Highlightable, ExtentHolder, MeasurableArea, MeasurableLength, Restorable, Attributable
Common interface for surface conforming shapes such asSurfacePolygon
,SurfacePolyline
,SurfaceEllipse
,SurfaceQuad
, andSurfaceSector
.SurfaceShape extends the
SurfaceObject
interface, and inherits SurfaceObject's batch rendering capabilities.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
getArea(Globe globe, boolean terrainConformant)
Returns the shapes's area in square meters.ShapeAttributes
getAttributes()
Returns the surface shape's normal (as opposed to highlight) attributes.ShapeAttributes
getHighlightAttributes()
Returns the surface shape's highlight attributes.java.lang.Iterable<? extends LatLon>
getLocations(Globe globe)
Returns the shape's locations as they appear on the specifiedglobe
, or null if the shape has no locations.int[]
getMinAndMaxEdgeIntervals()
Returns the minimum and maximum number of interpolated intervals that may be added to each shape edge.java.lang.String
getPathType()
Returns the path type used to interpolate between locations on this SurfaceShape.double
getTexelsPerEdgeInterval()
Returns the number of texels per shape edge interval.boolean
isHighlighted()
Indicates whether to highlight the surface shape.void
setAttributes(ShapeAttributes normalAttrs)
Specifies the surface shape's normal (as opposed to highlight) attributes.void
setHighlightAttributes(ShapeAttributes highlightAttrs)
Specifies the surface shape's highlight attributes.void
setHighlighted(boolean highlighted)
Specifies whether the surface shape is highlighted.void
setMinAndMaxEdgeIntervals(int minEdgeIntervals, int maxEdgeIntervals)
Sets the minimum and maximum number of interpolated intervals that may be added to each shape edge.void
setPathType(java.lang.String pathType)
Sets the path type used to interpolate between locations on this SurfaceShape.void
setTexelsPerEdgeInterval(double texelsPerEdgeInterval)
Sets the number of texels per shape edge interval.-
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
-
Methods inherited from interface gov.nasa.worldwind.geom.ExtentHolder
getExtent
-
Methods inherited from interface gov.nasa.worldwind.geom.MeasurableArea
getArea, getHeight, getPerimeter, getWidth
-
Methods inherited from interface gov.nasa.worldwind.geom.MeasurableLength
getLength
-
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
-
Methods inherited from interface gov.nasa.worldwind.Restorable
getRestorableState, restoreState
-
Methods inherited from interface gov.nasa.worldwind.render.SurfaceObject
getDelegateOwner, getDistanceFromEye, getExtent, isEnableBatchPicking, isVisible, pick, preRender, setDelegateOwner, setEnableBatchPicking, setVisible
-
Methods inherited from interface gov.nasa.worldwind.render.SurfaceRenderable
getSectors, getStateKey
-
-
-
-
Method Detail
-
isHighlighted
boolean isHighlighted()
Indicates whether to highlight the surface shape.- Specified by:
isHighlighted
in interfaceHighlightable
- Returns:
- true if highlighted, otherwise false.
- See Also:
setHighlighted(boolean)
,setHighlightAttributes(ShapeAttributes)
-
setHighlighted
void setHighlighted(boolean highlighted)
Specifies whether the surface shape is highlighted.- Specified by:
setHighlighted
in interfaceHighlightable
- Parameters:
highlighted
- true to highlight the surface shape, otherwise false. The default value is false.- See Also:
setHighlightAttributes(ShapeAttributes)
-
getAttributes
ShapeAttributes getAttributes()
Returns the surface shape's normal (as opposed to highlight) attributes. Modifying the contents of the returned reference causes this shape's appearance to change accordingly.- Specified by:
getAttributes
in interfaceAttributable
- Returns:
- the surface shape's normal attributes. May be null.
-
setAttributes
void setAttributes(ShapeAttributes normalAttrs)
Specifies the surface shape's normal (as opposed to highlight) attributes. Modifying the attribute reference after calling setAttributes() causes this shape's appearance to change accordingly.- Specified by:
setAttributes
in interfaceAttributable
- Parameters:
normalAttrs
- the normal attributes. May be null, in which case default attributes are used.
-
getHighlightAttributes
ShapeAttributes getHighlightAttributes()
Returns the surface shape's highlight attributes. Modifying the contents of the returned reference causes this shape's appearance to change accordingly.- Specified by:
getHighlightAttributes
in interfaceAttributable
- Returns:
- the surface shape's highlight attributes. May be null.
-
setHighlightAttributes
void setHighlightAttributes(ShapeAttributes highlightAttrs)
Specifies the surface shape's highlight attributes. Modifying the attribute reference after calling setHighlightAttributes() causes this shape's appearance to change accordingly.- Specified by:
setHighlightAttributes
in interfaceAttributable
- Parameters:
highlightAttrs
- the highlight attributes. May be null, in which case default attributes are used.
-
getPathType
java.lang.String getPathType()
Returns the path type used to interpolate between locations on this SurfaceShape.- Returns:
- path interpolation type.
-
setPathType
void setPathType(java.lang.String pathType)
Sets the path type used to interpolate between locations on this SurfaceShape. This should be one of- gov.nasa.worldwind.avlist.AVKey.GREAT_CIRCLE
- gov.nasa.worldwind.avlist.AVKey.LINEAR
- gov.nasa.worldwind.avlist.AVKey.LOXODROME
- gov.nasa.worldwind.avlist.AVKey.RHUMB
- Parameters:
pathType
- path interpolation type.- Throws:
java.lang.IllegalArgumentException
- ifpathType
is null.
-
getTexelsPerEdgeInterval
double getTexelsPerEdgeInterval()
Returns the number of texels per shape edge interval.- Returns:
- texels per shape edge interval.
- See Also:
setTexelsPerEdgeInterval(double)
-
setTexelsPerEdgeInterval
void setTexelsPerEdgeInterval(double texelsPerEdgeInterval)
Sets the number of texels per shape edge interval. This value controls how many interpolated intervals are added to each shape edge, depending on size of the original edge in texels. Each shape is responsible for defining what an edge is, though for most shapes it is defined as the edge between implicit or caller-specified shape locations. The number of interpolated intervals is limited by the values set in a call tosetMinAndMaxEdgeIntervals(int, int)
.- Parameters:
texelsPerEdgeInterval
- the size, in texels, of each interpolated edge interval.- Throws:
java.lang.IllegalArgumentException
- iftexelsPerEdgeInterval
is less than or equal to zero.- See Also:
setMinAndMaxEdgeIntervals(int, int)
-
getMinAndMaxEdgeIntervals
int[] getMinAndMaxEdgeIntervals()
Returns the minimum and maximum number of interpolated intervals that may be added to each shape edge.- Returns:
- array of two elements, the first element is minEdgeIntervals, the second element is maxEdgeIntervals.
- See Also:
setMinAndMaxEdgeIntervals(int, int)
-
setMinAndMaxEdgeIntervals
void setMinAndMaxEdgeIntervals(int minEdgeIntervals, int maxEdgeIntervals)
Sets the minimum and maximum number of interpolated intervals that may be added to each shape edge. The minimum and maximum values may be 0, or any positive integer. Note that Setting either ofminEdgeIntervals
ormaxEdgeIntervals
too large may adversely impact surface shape rendering performance.- Parameters:
minEdgeIntervals
- the minimum number of interpolated edge intervals.maxEdgeIntervals
- the maximum number of interpolated edge intervals.- Throws:
java.lang.IllegalArgumentException
- if either ofminEdgeIntervals
ormaxEdgeIntervals
is less than or equal to zero.- See Also:
setTexelsPerEdgeInterval(double)
-
getLocations
java.lang.Iterable<? extends LatLon> getLocations(Globe globe)
Returns the shape's locations as they appear on the specifiedglobe
, or null if the shape has no locations.- Parameters:
globe
- the globe the shape is related to.- Returns:
- the shapes locations on the globe, or null if the shape has no locations.
- Throws:
java.lang.IllegalArgumentException
- ifglobe
is null.
-
getArea
double getArea(Globe globe, boolean terrainConformant)
Returns the shapes's area in square meters. IfterrainConformant
is true, the area returned is the surface area of the terrain, including its hillsides and other undulations.- Parameters:
globe
- the globe the shape is related to.terrainConformant
- whether or not the returned area should treat the shape as conforming to the terrain.- Returns:
- the shape's area in square meters. Returns -1 if the object does not form an area due to an insufficient number of vertices or any other condition.
- Throws:
java.lang.IllegalArgumentException
- ifglobe
is null.
-
-