## com.bbn.openmap.layer.dted
Class DTEDCacheManager

    java.lang.Object
      com.bbn.openmap.layer.dted.DTEDCacheManager

public class DTEDCacheManager
extends java.lang.Object

The DTEDCacheManager is the object you need if you want to retrieve DTED files en masse for display. You set it up with the paths to the files, and then ask it for an OMGraphicList that contains the frames for a geographical area.

The DTEDCacheManager also manages objects called DTEDCacheHandlers. Cache handlers have their own set of frames, figure out which frames are needed to fill the screen, and ask each frame for the rasters (subframes). The situation gets pretty tricky when the screen has the equator and/or the dateline on it, and a different cache handler is needed for each quadrant of the earth. This situation is relatively rare, though, and the DTEDCacheManager automatically checks for these situations and creates the cache handlers needed.

There are two calls to the Cache that you need to use. The constructor sets up the cache with the location of the data on your system. The getRectangle() call returns an OMGraphicList of objects to draw, that cover the area asked for.

Field Summary
`protected DTEDCacheHandler[]` `caches` The cache handlers needed to cover the screen.
`protected int` `cacheSize`
`protected java.lang.String[]` `dted2DirPaths`
`protected java.lang.String[]` `dtedDirPaths`
`static int` `MAX_NUM_BOXES` A box is a earth quadrant.
`protected int` `numColors`
`protected int` `opaqueness`
`static int` `SMALL_CACHE_SIZE` The size of the smaller caches, when more cachehandlers are needed to cover the equator and the dateline.
`protected DTEDFrameSubframeInfo` `subframeInfo`

Constructor Summary
`DTEDCacheManager()` Constructor that uses the default paths and the default number of colors.
`DTEDCacheManager(java.lang.String[] DTEDPaths)` Constructor that lets you set the paths of the DTED directories, where the data is located.
`DTEDCacheManager(java.lang.String[] DTEDPaths, int num_colors, int opaque)` Constructor that lets you set the paths of the DTED directories, where the data is located, as well as the number of colors you want used in the graphics.
`DTEDCacheManager(java.lang.String[] DTEDPaths, java.lang.String[] DTED2Paths, int num_colors, int opaque)` Constructor that lets you set the paths of the DTED directories, where the data is located, as well as the number of colors you want used in the graphics.

Method Summary
`int` `getCacheSize()` Get the number of frames that the caches should contain.
`int` `getElevation(float lat, float lon)` Get an elevation at a point.
`int` `getNumColors()`
`int` `getOpaqueness()`
`OMGraphicList` `getRectangle(EqualArc proj)` The call to the cache that lets you choose what kind of information is returned.
`DTEDFrameSubframeInfo` `getSubframeInfo()`
`void` `resetCaches()` Reset the DTEDCacheHandler array so the handlers will get created on the next frame request.
`void` `setCacheSize(int size)` Set the number of frames that the caches should contain.
`void` `setDtedDirPaths(java.lang.String[] paths)` Used to set the DTED directory paths.
`void` `setDtedDirPaths(java.lang.String[] paths, java.lang.String[] paths2)` Used to set the DTED directory paths.
`void` `setNumColors(int numberOfColors)`
`void` `setOpaqueness(int setting)`
`void` `setSubframeInfo(DTEDFrameSubframeInfo dfsi)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SMALL_CACHE_SIZE

    public static final int SMALL_CACHE_SIZE

  The size of the smaller caches, when more cachehandlers are needed to cover the equator and the dateline.

  See Also:
    Constant Field Values

### MAX_NUM_BOXES

    public static final int MAX_NUM_BOXES

  A box is a earth quadrant.

  See Also:
    Constant Field Values

### caches

    protected DTEDCacheHandler[] caches

  The cache handlers needed to cover the screen. Need one for each earth quadrant, and for each DTED directory, in case coverage is spread out over different sources.

### subframeInfo

    protected DTEDFrameSubframeInfo subframeInfo

### dtedDirPaths

    protected java.lang.String[] dtedDirPaths

### dted2DirPaths

    protected java.lang.String[] dted2DirPaths

### numColors

    protected int numColors

### opaqueness

    protected int opaqueness

### cacheSize

    protected int cacheSize

Constructor Detail

### DTEDCacheManager

    public DTEDCacheManager()

  Constructor that uses the default paths and the default number of colors.

### DTEDCacheManager

    public DTEDCacheManager(java.lang.String[] DTEDPaths)

  Constructor that lets you set the paths of the DTED directories, where the data is located.

Parameters:
  `DTEDPaths` - pathnames to the DTED directories.

### DTEDCacheManager

    public DTEDCacheManager(java.lang.String[] DTEDPaths,
                            int num_colors,
                            int opaque)

  Constructor that lets you set the paths of the DTED directories, where the data is located, as well as the number of colors you want used in the graphics.

Parameters:
  `DTEDPaths` - pathnames to the DTED level 0 and 1 directories.
  `num_colors` - number of colors to be used in the graphics.
  `opaque` - the opaqueness of the dted images, 0 - 255 (0 is clear)

### DTEDCacheManager

    public DTEDCacheManager(java.lang.String[] DTEDPaths,
                            java.lang.String[] DTED2Paths,
                            int num_colors,
                            int opaque)

  Constructor that lets you set the paths of the DTED directories, where the data is located, as well as the number of colors you want used in the graphics.

Parameters:
  `DTEDPaths` - pathnames to the DTED level 0 and 1 directories.
  `DTED2Paths` - pathnames to the DTED level 2 directories.
  `num_colors` - number of colors to be used in the graphics.
  `opaque` - the opaqueness of the dted images, 0 - 255 (0 is clear)

Method Detail

### setDtedDirPaths

    public void setDtedDirPaths(java.lang.String[] paths)

  Used to set the DTED directory paths.

  Parameters:
    `paths` - DTED Level 0 and 1 directory paths.

### setDtedDirPaths

    public void setDtedDirPaths(java.lang.String[] paths,
                                java.lang.String[] paths2)

  Used to set the DTED directory paths.

  Parameters:
    `paths` - DTED Level 0 and 1 directory paths.
    `paths2` - DTED Level 2 directory paths.

### resetCaches

    public void resetCaches()

  Reset the DTEDCacheHandler array so the handlers will get created on the next frame request.

### setCacheSize

    public void setCacheSize(int size)

  Set the number of frames that the caches should contain. If negative or zero, the cache calculates the cache size based on the projection.

### getCacheSize

    public int getCacheSize()

  Get the number of frames that the caches should contain. If negative or zero, the cache is calculating the cache size based on the projection.

### getElevation

    public int getElevation(float lat,
                            float lon)

  Get an elevation at a point. Always uses the main cache to load the frame and get the data.

  Parameters:
    `lat` - latitude of point in decimal degrees.
    `lon` - longitude of point in decimal degrees.

### setSubframeInfo

    public void setSubframeInfo(DTEDFrameSubframeInfo dfsi)

### getSubframeInfo

    public DTEDFrameSubframeInfo getSubframeInfo()

### getRectangle

    public OMGraphicList getRectangle(EqualArc proj)

  The call to the cache that lets you choose what kind of information is returned. This function also figures out what part of the earth is covered on the screen, and creates auxillary cache handlers as needed.

  Parameters:
    `proj` - The projection of the screen (CADRG).
  Returns:
    List of rasters to display.

### setNumColors

    public void setNumColors(int numberOfColors)

### getNumColors

    public int getNumColors()

### setOpaqueness

    public void setOpaqueness(int setting)

### getOpaqueness

    public int getOpaqueness()

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details