Class 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 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.

    • 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. Initially false.
      • altitudeMode

        protected int altitudeMode
        Indicates the vertical datum against which the altitudes values in this entry's Region are interpreted. One of WorldWind.ABSOLUTE, WorldWind.CLAMP_TO_GROUND, or WorldWind.RELATIVE_TO_GROUND. Initially -1.
      • sector

        protected Sector sector
        Indicates the Sector used to determine if a Region who's altitudeMode is clampToGround is visible. Initially null.
      • 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 the View's eye point. Initially null.
    • Constructor Detail

      • RegionData

        public RegionData​(DrawContext dc,
                          long minExpiryTime,
                          long maxExpiryTime)
        Constructs a new RegionData entry from the Globe and vertical exaggeration of a specified draw context.
        Parameters:
        dc - the draw context. Must contain a Globe.
        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, otherwise false.
      • 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, otherwise false.
      • 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, or WorldWind.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 of WorldWind.ABSOLUTE, WorldWind.CLAMP_TO_GROUND, or WorldWind.RELATIVE_TO_GROUND.
        Parameters:
        altitudeMode - the vertical datum to use.
      • getSector

        public Sector getSector()
        Indicates the 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.
        Returns:
        the Sector used to determine if a Region is visible, or null to specify that this entry's Region has no bounding box.
      • setSector

        public void setSector​(Sector sector)
        Specifies the Sector that defines a Region's surface sector on the Globe. Specify null to indicate that this entry' Region has no geographic bounding box.
        Parameters:
        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.
      • getPoints

        public java.util.List<Vec4> getPoints()
        Indicates the model-coordinate points representing the corners and interior of this entry's Region. This returns null 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 the 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.

        Parameters:
        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.