dtTerrain::DTEDTerrainReader Class Reference

This data reader loads DTED data mapping to a specified latitude and longitude. More...

#include <dtedterrainreader.h>

Inheritance diagram for dtTerrain::DTEDTerrainReader:

dtTerrain::TerrainDataReader dtCore::Base

List of all members.

Public Member Functions

 DTEDTerrainReader (const DTEDLevelEnum &level=DTEDLevelEnum::ONE, const std::string &name="DTEDReader")
 Constructs the terrain reader.
const TerrainDataTypeGetDataType () const
 Gets the type of terrain data this reader supports.
virtual bool OnLoadTerrainTile (PagedTerrainTile &tile)
 Called by the terrain when a tile needs to be loaded.
const std::string GenerateTerrainTileCachePath (const PagedTerrainTile &tile)
 This generates the cache path for the specified tile.
void SetDTEDLevel (const DTEDLevelEnum &level)
 Sets the DTED level to load.
const DTEDLevelEnumGetDTEDLevel () const
 Gets the current DTED level this reader is trying to load.

Protected Member Functions

virtual ~DTEDTerrainReader ()
 Destroys the terrain reader.
std::string GetDTEDFilePath (const std::string &lat, const std::string &lon, int level)
 Searches the list of file resource paths for DTED data of the given latitude, longitude and level.

Classes

class  DTEDLevelEnum
 This enumeration represents the different DTED levels available for loading. More...


Detailed Description

This data reader loads DTED data mapping to a specified latitude and longitude.

Under the covers this reader uses GDAL to load the actual heightfield values. Note, to load specific DTED levels, one must specify the level to load. By default, the reader will attempt to load DTED level 1.


Constructor & Destructor Documentation

dtTerrain::DTEDTerrainReader::DTEDTerrainReader ( const DTEDLevelEnum level = DTEDLevelEnum::ONE,
const std::string &  name = "DTEDReader" 
)

Constructs the terrain reader.

Parameters:
level The level of DTED data to load.

dtTerrain::DTEDTerrainReader::~DTEDTerrainReader (  )  [protected, virtual]

Destroys the terrain reader.


Member Function Documentation

const TerrainDataType& dtTerrain::DTEDTerrainReader::GetDataType (  )  const [inline, virtual]

Gets the type of terrain data this reader supports.

Returns:
TerrainDataType::DTED.

Implements dtTerrain::TerrainDataReader.

bool dtTerrain::DTEDTerrainReader::OnLoadTerrainTile ( PagedTerrainTile tile  )  [virtual]

Called by the terrain when a tile needs to be loaded.

This method will first check the tile's cache for the heightfield. If it is not found, this method will load the DTED data for the specified tile.

Parameters:
tile The tile to load. Based on its latitude and longitude position and the reader's max DTED level, the appropriate data will be loaded.
Note:
If any errors occur during the load process, the appropriate exception is thrown.

Implements dtTerrain::TerrainDataReader.

const std::string dtTerrain::DTEDTerrainReader::GenerateTerrainTileCachePath ( const PagedTerrainTile tile  )  [virtual]

This generates the cache path for the specified tile.

The cache path is equal to: $Latitude_$Longitude_$DTEDLevel.

Parameters:
tile The tile with which to generate the path for.
Returns:
A string containing the generated cache path.

Implements dtTerrain::TerrainDataReader.

void dtTerrain::DTEDTerrainReader::SetDTEDLevel ( const DTEDLevelEnum level  ) 

Sets the DTED level to load.

Parameters:
level The level of data to load. By default, this value is set to DTEDLevelEnum::ONE.

const DTEDLevelEnum& dtTerrain::DTEDTerrainReader::GetDTEDLevel (  )  const [inline]

Gets the current DTED level this reader is trying to load.

Returns:
An enumeration corresponding to appropriate DTED level.

std::string dtTerrain::DTEDTerrainReader::GetDTEDFilePath ( const std::string &  lat,
const std::string &  lon,
int  level 
) [protected]

Searches the list of file resource paths for DTED data of the given latitude, longitude and level.

Parameters:
basePath String containing the root DTED path.
lat Latitude (ex. e90)
lon Longitude (ex. w150)
Returns:
The full path to the DTED file resource.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008