protected static class KMLRegion.RegionData extends ShapeDataCache.ShapeDataCacheEntry
RegionData
holds a Region's computed data used during a single call to Region.isActive
,
and is unique to a particular Globe
.
RegionData entries are places in a Region's regionDataCache
, and are retrieved during each call to
isActive
using the current Globe
as the cache key. RegionData's elements depend on the
Globe's
ElevationModel
, and therefore cannot be permanently cached. Each RegionData
entry is valid for a random amount of time between its minExpiryTime
and its
maxExpiryTime
, 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's isActive
property indicates whether the Region
associated with a RegionData entry is active. This is used to share the result of computing isActive
among multiple calls during the same frame. For example, the preRender and render passes need not each compute
isActive
, and can therefore share the same computation by ensuring that this property is set at most
once per frame. Callers determine when to recompute isActive
by comparing the
DrawContext's
current frame number against the RegionData's activeFrameNumber
. This
property is accessed by calling isActive
and setActive
.
extent
RegionData's extent
property is an Extent
used to
determine if a Region's bounding box is in view. This property is accessed by calling getExtent
and
setExtent
. May be null
.
sector
RegionData's sector
property is a Sector
used to
determine if Regions with an altitudeMode
of clampToGround
are in view. Accessed by
calling getSector
and setSector
. When a Region's altitudeMode
is
clampToGround
, the Region's sector can be used to determine visibility because the Region is defined
to be on the Globe's
surface.
points
RegionData's points
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 the View's
eye point. If the Region has altitude mode of
clampToGround
, this list must contain five points: the model-coordinate points of the Region's four
corners and center point on the surface terrain.
Modifier and Type | Field and 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 the
Sector used to determine if a Region who's altitudeMode is
clampToGround is visible. |
extent, eyeDistance, globeStateKey, lastUsed, timer, timerAdjustedEyeDistance, verticalExaggeration
Constructor and Description |
---|
RegionData(DrawContext dc,
long minExpiryTime,
long maxExpiryTime)
Constructs a new
RegionData entry from the Globe and vertical exaggeration of a
specified draw context. |
Modifier and Type | Method and 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 the
Sector used to determine if a Region who's altitudeMode is
clampToGround 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 the
Sector that defines a Region's surface sector on the Globe . |
adjustTimer, getExtent, getEyeDistance, getGlobeStateKey, getTimer, getVerticalExaggeration, isExpired, isValid, restartTimer, setExpired, setExtent, setEyeDistance, setGlobeStateKey, setTimer, setVerticalExaggeration
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
protected long activeFrameNumber
protected int altitudeMode
WorldWind.ABSOLUTE
, WorldWind.CLAMP_TO_GROUND
, or
WorldWind.RELATIVE_TO_GROUND
. Initially -1.protected long frameNumber
protected boolean isActive
false
.protected java.util.List<Vec4> points
View's
eye point.
Initially null
.protected Sector sector
Sector
used to determine if a Region who's altitudeMode
is
clampToGround
is visible. Initially null
.public RegionData(DrawContext dc, long minExpiryTime, long maxExpiryTime)
RegionData
entry from the Globe
and vertical exaggeration of a
specified draw context.dc
- the draw context. Must contain a Globe
.minExpiryTime
- the minimum expiration duration, in milliseconds.maxExpiryTime
- the maximum expiration duration, in milliseconds.public long getActiveFrameNumber()
public int getAltitudeMode()
WorldWind.ABSOLUTE
,
WorldWind.CLAMP_TO_GROUND
, or WorldWind.RELATIVE_TO_GROUND
.public long getFrameNumber()
public java.util.List<Vec4> getPoints()
null
if this entry's Region has no geographic bounding box.null
if the
Region has no bounding box.public Sector getSector()
Sector
used to determine if a Region who's altitudeMode
is
clampToGround
is visible. This returns null
if this entry's Region's has no
geographic bounding box.Sector
used to determine if a Region is visible, or null
to specify
that this entry's Region has no bounding box.public boolean isActive()
true
if this entry's Region is active, otherwise false
.public void setActive(boolean active)
active
- true
to specify that this entry's Region is active, otherwise false
.public void setActiveFrameNumber(long frameNumber)
frameNumber
- the frame used to determine if this entry's Region is active.public void setAltitudeMode(int altitudeMode)
WorldWind.ABSOLUTE
, WorldWind.CLAMP_TO_GROUND
, or
WorldWind.RELATIVE_TO_GROUND
.altitudeMode
- the vertical datum to use.public void setFrameNumber(long frameNumber)
frameNumber
- the frame used to calculate this entry's values.public void setPoints(java.util.List<Vec4> points)
View's
eye point.
Specify null
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.
points
- the points representing the corners and interior of this entry's Region, or null
to specify that this entry's Region has no bounding box.public void setSector(Sector sector)
Sector
that defines a Region's surface sector on the Globe
. Specify
null
to indicate that this entry' Region has no geographic bounding box.sector
- the Sector
that is used to determine if a clampToGround
Region is
visible, or null
to specify that the entry's Region's has no bounding box.