com.bbn.openmap.layer.dted
Class DTEDCacheHandler

java.lang.Object
  extended by com.bbn.openmap.layer.dted.DTEDCacheHandler

public class DTEDCacheHandler
extends java.lang.Object

The DTEDCacheHandler controls the real cache of DTED frames. It is managed by the DTEDCacheManager, and the manager asks it for frames. The DTEDCacheHandler goes to its cache for the images, but it also manages the configuration of the frames, and figures out what frames are needed, given a projection.


Field Summary
protected  DTEDFrameColorTable colortable
          The colors used by the frames to create the images.
protected  DTEDFrameSubframeInfo dfsi
          A description of the drawing attributes of the images.
static int FRAME_CACHE_SIZE
          Default frame cache size.
protected  DTEDFrameCache frameCache
          The real frame cache.
protected  int frameCacheSize
           
protected  java.lang.String[] paths
          The DTED level 0, 1 directory paths.
static int SF_PIXEL_HW
          Subframe pixel height and width.
 
Constructor Summary
DTEDCacheHandler()
           
DTEDCacheHandler(java.lang.String[] dataPaths, int numColors, int opaque)
           
DTEDCacheHandler(java.lang.String[] dataPaths, int numColors, int opaqueness, int subframe_cache_size)
           
 
Method Summary
 DTEDFrameColorTable getColortable()
          Get the colortable being used to color the frames.
 int getElevation(float lat, float lon)
          Get an elevation at a point.
 int getFrameCacheSize()
          Get the limit imposed on the number of frames used in the cache.
 OMGraphic getNextImage(Projection proj)
          Returns the next OMRaster image.
 void setColortable(DTEDFrameColorTable colorT)
          Set the DTEDFrameColorTable used by the handler.
 void setFrameCacheSize(int size)
          Normally, the cache grows and shrinks as appropriate according to the number of frames needed to cover the screen.
 void setProjection(EqualArc proj)
          The method to call to let the cache handler know what the projection looks like so it can figure out which frames (and subframes) will be needed.
 void setProjection(Projection proj, double lat1, double lon1, double lat2, double lon2)
          The method to call to let the cache handler know what the projection looks like so it can figure out which frames (and subframes) will be needed.
 void setSubframeInfo(DTEDFrameSubframeInfo new_dfsi)
          Setting the subframe attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FRAME_CACHE_SIZE

public static final int FRAME_CACHE_SIZE
Default frame cache size.

See Also:
Constant Field Values

SF_PIXEL_HW

public static final int SF_PIXEL_HW
Subframe pixel height and width.

See Also:
Constant Field Values

paths

protected java.lang.String[] paths
The DTED level 0, 1 directory paths.


frameCache

protected DTEDFrameCache frameCache
The real frame cache.


frameCacheSize

protected int frameCacheSize

colortable

protected DTEDFrameColorTable colortable
The colors used by the frames to create the images.


dfsi

protected DTEDFrameSubframeInfo dfsi
A description of the drawing attributes of the images.

Constructor Detail

DTEDCacheHandler

public DTEDCacheHandler()

DTEDCacheHandler

public DTEDCacheHandler(java.lang.String[] dataPaths,
                        int numColors,
                        int opaque)

DTEDCacheHandler

public DTEDCacheHandler(java.lang.String[] dataPaths,
                        int numColors,
                        int opaqueness,
                        int subframe_cache_size)
Method Detail

setFrameCacheSize

public void setFrameCacheSize(int size)
Normally, the cache grows and shrinks as appropriate according to the number of frames needed to cover the screen. If you want to limit the size it can grow, set the size. If it's negative, then there will be no limit.


getFrameCacheSize

public int getFrameCacheSize()
Get the limit imposed on the number of frames used in the cache.


getElevation

public int getElevation(float lat,
                        float lon)
Get an elevation at a point. Always uses the cache to load the frame and get the data.


setSubframeInfo

public void setSubframeInfo(DTEDFrameSubframeInfo new_dfsi)
Setting the subframe attributes.


setProjection

public void setProjection(EqualArc proj)
The method to call to let the cache handler know what the projection looks like so it can figure out which frames (and subframes) will be needed.

Parameters:
proj - the EqualArc projection of the screen.

setProjection

public void setProjection(Projection proj,
                          double lat1,
                          double lon1,
                          double lat2,
                          double lon2)
The method to call to let the cache handler know what the projection looks like so it can figure out which frames (and subframes) will be needed. Should be called when the CacheHandler is dealing with just a part of the map, such as when the map covers the dateline or equator.

Parameters:
proj - the EqualArc projection of the screen.
lat1 - latitude of the upper left corner of the window, in decimal degrees.
lon1 - longitude of the upper left corner of the window, in decimal degrees.
lat2 - latitude of the lower right corner of the window, in decimal degrees.
lon2 - longitude of the lower right corner of the window, in decimal degrees.

getNextImage

public OMGraphic getNextImage(Projection proj)
Returns the next OMRaster image. When setProjection() is called, the cache sets the projection parameters it needs, and also resets this popping mechanism. When this mechanism is reset, you can keep calling this method to get another subframe image. When it returns a null value, it is done. It will automatically skip over window frames it doesn't have, and return the next one it does have. It traverses from the top left to right frames, and top to bottom for each column of frames. It handles all the subframes for a frame at one time.

Parameters:
proj - current projection.
Returns:
OMGraphic image, projected if not null.

getColortable

public DTEDFrameColorTable getColortable()
Get the colortable being used to color the frames.

Returns:
DTEDFrameColorTable

setColortable

public void setColortable(DTEDFrameColorTable colorT)
Set the DTEDFrameColorTable used by the handler. If you pass in a null value, a default colortable will be inserted.

Parameters:
colorT -


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