Class KMLRegion.RegionData
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.cache.ShapeDataCache.ShapeDataCacheEntry
-
- gov.nasa.worldwind.ogc.kml.KMLRegion.RegionData
-
- All Implemented Interfaces:
AVList
- Enclosing class:
- KMLRegion
protected static class KMLRegion.RegionData extends ShapeDataCache.ShapeDataCacheEntry
RegionData
holds a Region's computed data used during a single call toRegion.isActive
, and is unique to a particularGlobe
.RegionData entries are places in a Region's
regionDataCache
, and are retrieved during each call toisActive
using the currentGlobe
as the cache key. RegionData's elements depend on theGlobe's
ElevationModel
, and therefore cannot be permanently cached. Each RegionData entry is valid for a random amount of time between itsminExpiryTime
and itsmaxExpiryTime
, after which it must be regenerated. The time is randomized to amortize the cost of regenerating data for multiple Regions over multiple frames.isActive
RegionData'sisActive
property indicates whether the Region associated with a RegionData entry is active. This is used to share the result of computingisActive
among multiple calls during the same frame. For example, the preRender and render passes need not each computeisActive
, and can therefore share the same computation by ensuring that this property is set at most once per frame. Callers determine when to recomputeisActive
by comparing theDrawContext's
current frame number against the RegionData'sactiveFrameNumber
. This property is accessed by callingisActive
andsetActive
.extent
RegionData'sextent
property is anExtent
used to determine if a Region's bounding box is in view. This property is accessed by callinggetExtent
andsetExtent
. May benull
.sector
RegionData'ssector
property is aSector
used to determine if Regions with analtitudeMode
ofclampToGround
are in view. Accessed by callinggetSector
andsetSector
. When a Region'saltitudeMode
isclampToGround
, the Region's sector can be used to determine visibility because the Region is defined to be on theGlobe's
surface.points
RegionData'spoints
property indicates a list of model-coordinate points representing the corners and interior of the Region. These points are used to determine the distance between the Region and theView's
eye point. If the Region has altitude mode ofclampToGround
, this list must contain five points: the model-coordinate points of the Region's four corners and center point on the surface terrain.
-
-
Field Summary
Fields Modifier and Type Field Description protected long
activeFrameNumber
Identifies the frame used to determine if this entry's Region is active.protected int
altitudeMode
Indicates the vertical datum against which the altitudes values in this entry's Region are interpreted.protected long
frameNumber
Identifies the frame used to calculate this entry's values.protected boolean
isActive
Identifies whether this entry's Region is active.protected java.util.List<Vec4>
points
Indicates the model-coordinate points representing the corners and interior of this entry's Region.protected Sector
sector
Indicates theSector
used to determine if a Region who'saltitudeMode
isclampToGround
is visible.-
Fields inherited from class gov.nasa.worldwind.cache.ShapeDataCache.ShapeDataCacheEntry
extent, eyeDistance, globeStateKey, lastUsed, timer, timerAdjustedEyeDistance, verticalExaggeration
-
-
Constructor Summary
Constructors Constructor Description RegionData(DrawContext dc, long minExpiryTime, long maxExpiryTime)
Constructs a newRegionData
entry from theGlobe
and vertical exaggeration of a specified draw context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getActiveFrameNumber()
Identifies the frame used to determine if this entry's Region is active.int
getAltitudeMode()
Indicates the vertical datum against which the altitudes values in this entry's Region are interpreted.long
getFrameNumber()
Identifies the frame used to calculate this entry's values.java.util.List<Vec4>
getPoints()
Indicates the model-coordinate points representing the corners and interior of this entry's Region.Sector
getSector()
Indicates theSector
used to determine if a Region who'saltitudeMode
isclampToGround
is visible.boolean
isActive()
Indicates whether this entry's Region is active.void
setActive(boolean active)
Specifies whether this entry's Region is active.void
setActiveFrameNumber(long frameNumber)
Specifies the frame used to determine if this entry's Region is active.void
setAltitudeMode(int altitudeMode)
Specifies the vertical datum against which the altitudes values in this entry's Region should be interpreted.void
setFrameNumber(long frameNumber)
Specifies the frame used to calculate this entry's values.void
setPoints(java.util.List<Vec4> points)
Specifies the model-coordinate points representing the corners and interior of this entry's Region.void
setSector(Sector sector)
Specifies theSector
that defines a Region's surface sector on theGlobe
.-
Methods inherited from class gov.nasa.worldwind.cache.ShapeDataCache.ShapeDataCacheEntry
adjustTimer, getExtent, getEyeDistance, getGlobeStateKey, getTimer, getVerticalExaggeration, isExpired, isValid, restartTimer, setExpired, setExtent, setEyeDistance, setGlobeStateKey, setTimer, setVerticalExaggeration
-
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
-
-
-
-
Field Detail
-
frameNumber
protected long frameNumber
Identifies the frame used to calculate this entry's values. Initially -1.
-
activeFrameNumber
protected long activeFrameNumber
Identifies the frame used to determine if this entry's Region is active. Initially -1.
-
isActive
protected boolean isActive
Identifies whether this entry's Region is active. Initiallyfalse
.
-
altitudeMode
protected int altitudeMode
Indicates the vertical datum against which the altitudes values in this entry's Region are interpreted. One ofWorldWind.ABSOLUTE
,WorldWind.CLAMP_TO_GROUND
, orWorldWind.RELATIVE_TO_GROUND
. Initially -1.
-
sector
protected Sector sector
Indicates theSector
used to determine if a Region who'saltitudeMode
isclampToGround
is visible. Initiallynull
.
-
points
protected java.util.List<Vec4> points
Indicates the model-coordinate points representing the corners and interior of this entry's Region. These points are used to determine the distance between this entry's Region and theView's
eye point. Initiallynull
.
-
-
Constructor Detail
-
RegionData
public RegionData(DrawContext dc, long minExpiryTime, long maxExpiryTime)
Constructs a newRegionData
entry from theGlobe
and vertical exaggeration of a specified draw context.- Parameters:
dc
- the draw context. Must contain aGlobe
.minExpiryTime
- the minimum expiration duration, in milliseconds.maxExpiryTime
- the maximum expiration duration, in milliseconds.
-
-
Method Detail
-
getFrameNumber
public long getFrameNumber()
Identifies the frame used to calculate this entry's values.- Returns:
- the frame used to calculate this entry's values.
-
setFrameNumber
public void setFrameNumber(long frameNumber)
Specifies the frame used to calculate this entry's values.- Parameters:
frameNumber
- the frame used to calculate this entry's values.
-
getActiveFrameNumber
public long getActiveFrameNumber()
Identifies the frame used to determine if this entry's Region is active.- Returns:
- the frame used to determine if this entry's Region is active.
-
setActiveFrameNumber
public void setActiveFrameNumber(long frameNumber)
Specifies the frame used to determine if this entry's Region is active.- Parameters:
frameNumber
- the frame used to determine if this entry's Region is active.
-
isActive
public boolean isActive()
Indicates whether this entry's Region is active.- Returns:
true
if this entry's Region is active, otherwisefalse
.
-
setActive
public void setActive(boolean active)
Specifies whether this entry's Region is active.- Parameters:
active
-true
to specify that this entry's Region is active, otherwisefalse
.
-
getAltitudeMode
public int getAltitudeMode()
Indicates the vertical datum against which the altitudes values in this entry's Region are interpreted.- Returns:
- the altitude mode of this entry's Region. One of
WorldWind.ABSOLUTE
,WorldWind.CLAMP_TO_GROUND
, orWorldWind.RELATIVE_TO_GROUND
.
-
setAltitudeMode
public void setAltitudeMode(int altitudeMode)
Specifies the vertical datum against which the altitudes values in this entry's Region should be interpreted. Must be one ofWorldWind.ABSOLUTE
,WorldWind.CLAMP_TO_GROUND
, orWorldWind.RELATIVE_TO_GROUND
.- Parameters:
altitudeMode
- the vertical datum to use.
-
getSector
public Sector getSector()
Indicates theSector
used to determine if a Region who'saltitudeMode
isclampToGround
is visible. This returnsnull
if this entry's Region's has no geographic bounding box.- Returns:
- the
Sector
used to determine if a Region is visible, ornull
to specify that this entry's Region has no bounding box.
-
setSector
public void setSector(Sector sector)
Specifies theSector
that defines a Region's surface sector on theGlobe
. Specifynull
to indicate that this entry' Region has no geographic bounding box.- Parameters:
sector
- theSector
that is used to determine if aclampToGround
Region is visible, ornull
to specify that the entry's Region's has no bounding box.
-
getPoints
public java.util.List<Vec4> getPoints()
Indicates the model-coordinate points representing the corners and interior of this entry's Region. This returnsnull
if this entry's Region has no geographic bounding box.- Returns:
- the points representing the corners and interior of this entry's Region, or
null
if the Region has no bounding box.
-
setPoints
public void setPoints(java.util.List<Vec4> points)
Specifies the model-coordinate points representing the corners and interior of this entry's Region. These points are used to determine the distance between this entry's Region and theView's
eye point. Specifynull
to indicate that this entry' Region has no geographic bounding box.If this entry's Region has altitude mode
clampToGround
, this list must contain five points: the model-coordinate points of the Region's four corners and center point on the surface terrain.- Parameters:
points
- the points representing the corners and interior of this entry's Region, ornull
to specify that this entry's Region has no bounding box.
-
-