NASA World Wind

gov.nasa.worldwind.util
Class SectorVisibilityTree

java.lang.Object
  extended by gov.nasa.worldwind.util.SectorVisibilityTree

public class SectorVisibilityTree
extends Object

Determines the visible sectors at a specifed resolution within the draw context's current visible sector.


Nested Class Summary
protected static class SectorVisibilityTree.Context
           
 
Field Summary
protected  Object globeStateKey
           
protected  HashMap<Sector,Extent> newExtents
           
protected  HashMap<Sector,Extent> prevExtents
           
protected  ArrayList<Sector> sectors
           
protected  double sectorSize
           
protected  long timeStamp
           
protected  DecisionTree<Sector,SectorVisibilityTree.Context> tree
           
 
Constructor Summary
SectorVisibilityTree()
           
 
Method Summary
 void clearSectors()
           
 List<Sector> getSectors()
           
 double getSectorSize()
           
 long getTimeStamp()
           
 List<Sector> refresh(DrawContext dc, double sectorSize)
          Determines the visible sectors at a specifed resolution within the draw context's current visible sector.
 List<Sector> refresh(DrawContext dc, double sectorSize, List<Sector> searchSectors)
          Determines the visible sectors at a specified resolution within a collection of sectors.
 List<Sector> refresh(DrawContext dc, double sectorSize, Sector searchSector)
          Determines the visible sectors at a specified resolution within a specified sector.
 void setTimeStamp(long timeStamp)
           
protected  void swapCylinderLists(DrawContext dc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

globeStateKey

protected Object globeStateKey

newExtents

protected HashMap<Sector,Extent> newExtents

prevExtents

protected HashMap<Sector,Extent> prevExtents

sectors

protected ArrayList<Sector> sectors

sectorSize

protected double sectorSize

timeStamp

protected long timeStamp

tree

protected DecisionTree<Sector,SectorVisibilityTree.Context> tree
Constructor Detail

SectorVisibilityTree

public SectorVisibilityTree()
Method Detail

clearSectors

public void clearSectors()

getSectors

public List<Sector> getSectors()

getSectorSize

public double getSectorSize()

getTimeStamp

public long getTimeStamp()

refresh

public List<Sector> refresh(DrawContext dc,
                            double sectorSize)
Determines the visible sectors at a specifed resolution within the draw context's current visible sector.

Parameters:
dc - the current draw context
sectorSize - the granularity of sector visibility, in degrees. All visible sectors of this size are found. The value must be in the range, 1 second <= sectorSize <= 180 degrees.
Returns:
the list of visible sectors. The list will be empty if no sectors are visible.
Throws:
IllegalArgumentException - if the draw context is null.

refresh

public List<Sector> refresh(DrawContext dc,
                            double sectorSize,
                            List<Sector> searchSectors)
Determines the visible sectors at a specified resolution within a collection of sectors. This method can be used to recursively determine visible sectors: the output of one invocation can be passed as an argument to the next invocation.

Parameters:
dc - the current draw context
sectorSize - the granularity of sector visibility, in degrees. All visible sectors of this size are The value must be in the range, 1 second <= sectorSize <= 180 degrees. found.
searchSectors - the sectors for which to determine visibility.
Returns:
the list of visible sectors. The list will be empty if no sectors are visible.
Throws:
IllegalArgumentException - if the draw context is null, the sector size is less than or equal to zero or the search sector list is null.

refresh

public List<Sector> refresh(DrawContext dc,
                            double sectorSize,
                            Sector searchSector)
Determines the visible sectors at a specified resolution within a specified sector.

Parameters:
dc - the current draw context
sectorSize - the granularity of sector visibility, in degrees. All visible sectors of this size are found. The value must be in the range, 1 second <= sectorSize <= 180 degrees.
searchSector - the overall sector for which to determine visibility. May be null, in which case the current visible sector of the draw context is used.
Returns:
the list of visible sectors. The list will be empty if no sectors are visible.
Throws:
IllegalArgumentException - if the draw context is null, the sector size is less than or equal to zero, or the search sector list is null.

setTimeStamp

public void setTimeStamp(long timeStamp)

swapCylinderLists

protected void swapCylinderLists(DrawContext dc)

NASA World Wind