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
RegionDataholds 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 toisActiveusing the currentGlobeas the cache key. RegionData's elements depend on theGlobe'sElevationModel, and therefore cannot be permanently cached. Each RegionData entry is valid for a random amount of time between itsminExpiryTimeand 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'sisActiveproperty indicates whether the Region associated with a RegionData entry is active. This is used to share the result of computingisActiveamong 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 recomputeisActiveby comparing theDrawContext'scurrent frame number against the RegionData'sactiveFrameNumber. This property is accessed by callingisActiveandsetActive.extent
RegionData'sextentproperty is anExtentused to determine if a Region's bounding box is in view. This property is accessed by callinggetExtentandsetExtent. May benull.sector
RegionData'ssectorproperty is aSectorused to determine if Regions with analtitudeModeofclampToGroundare in view. Accessed by callinggetSectorandsetSector. When a Region'saltitudeModeisclampToGround, the Region's sector can be used to determine visibility because the Region is defined to be on theGlobe'ssurface.points
RegionData'spointsproperty 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'seye 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 longactiveFrameNumberIdentifies the frame used to determine if this entry's Region is active.protected intaltitudeModeIndicates the vertical datum against which the altitudes values in this entry's Region are interpreted.protected longframeNumberIdentifies the frame used to calculate this entry's values.protected booleanisActiveIdentifies whether this entry's Region is active.protected java.util.List<Vec4>pointsIndicates the model-coordinate points representing the corners and interior of this entry's Region.protected SectorsectorIndicates theSectorused to determine if a Region who'saltitudeModeisclampToGroundis 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 newRegionDataentry from theGlobeand vertical exaggeration of a specified draw context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetActiveFrameNumber()Identifies the frame used to determine if this entry's Region is active.intgetAltitudeMode()Indicates the vertical datum against which the altitudes values in this entry's Region are interpreted.longgetFrameNumber()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.SectorgetSector()Indicates theSectorused to determine if a Region who'saltitudeModeisclampToGroundis visible.booleanisActive()Indicates whether this entry's Region is active.voidsetActive(boolean active)Specifies whether this entry's Region is active.voidsetActiveFrameNumber(long frameNumber)Specifies the frame used to determine if this entry's Region is active.voidsetAltitudeMode(int altitudeMode)Specifies the vertical datum against which the altitudes values in this entry's Region should be interpreted.voidsetFrameNumber(long frameNumber)Specifies the frame used to calculate this entry's values.voidsetPoints(java.util.List<Vec4> points)Specifies the model-coordinate points representing the corners and interior of this entry's Region.voidsetSector(Sector sector)Specifies theSectorthat 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 theSectorused to determine if a Region who'saltitudeModeisclampToGroundis 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'seye point. Initiallynull.
-
-
Constructor Detail
-
RegionData
public RegionData(DrawContext dc, long minExpiryTime, long maxExpiryTime)
Constructs a newRegionDataentry from theGlobeand 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:
trueif this entry's Region is active, otherwisefalse.
-
setActive
public void setActive(boolean active)
Specifies whether this entry's Region is active.- Parameters:
active-trueto 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 theSectorused to determine if a Region who'saltitudeModeisclampToGroundis visible. This returnsnullif this entry's Region's has no geographic bounding box.- Returns:
- the
Sectorused to determine if a Region is visible, ornullto specify that this entry's Region has no bounding box.
-
setSector
public void setSector(Sector sector)
Specifies theSectorthat defines a Region's surface sector on theGlobe. Specifynullto indicate that this entry' Region has no geographic bounding box.- Parameters:
sector- theSectorthat is used to determine if aclampToGroundRegion is visible, ornullto 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 returnsnullif this entry's Region has no geographic bounding box.- Returns:
- the points representing the corners and interior of this entry's Region, or
nullif 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'seye point. Specifynullto 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, ornullto specify that this entry's Region has no bounding box.
-
-