|
WSF
|
Manages interface to terrain for a set of WsfTerrain objects. More...
#include <WsfTerrain.hpp>
Classes | |
| class | RectInput |
| struct | DtedInput |
| struct | FloatGridInput |
| struct | GeotiffInput |
| struct | BathymetryInput |
| struct | Query |
Public Types | |
| enum | DataType { cDTED , cFLOAT_GRID , cVISUAL_DATABASE , cGEODETIC_EARTH_DATABASE , cGEOTIFF , cBATHYMETRY } |
Public Member Functions | |
| TerrainInterface (WsfScenario &aScenarioPtr) | |
| ~TerrainInterface () | |
| bool | ProcessInput (UtInput &aInput) |
| bool | Initialize () |
| WsfScenario * | GetScenario () |
| std::vector< int > * | GetDTEDLevel () |
| Access for DTED DB Information. | |
| int | GetDTEDLevelByIndex (size_t aIndex) |
| std::vector< std::string > * | GetDTEDPath () |
| void | GetDTEDPathByIndex (size_t aIndex, std::string &aPath) |
| const std::vector< DtedInput > & | GetDTEDInputs () const |
| const std::vector< GeotiffInput > & | GetGeotiffInputs () const |
| Access for geotiff DB Information. | |
| double | GetEarthRadiusMultiplier () |
| Access for Earth Radius Multiplier. | |
| void | PerformQueries (WsfSimulation &aSimulation) |
| bool | IsEnabled () const |
| bool | IsVegetationEnabled () const |
| bool | IsGeodeticDatabase () const |
| bool | IsDTED () const |
| bool | IsBathymetryEnabled () const |
Static Public Member Functions | |
| static TerrainInterface * | Get (const WsfScenario &aScenario) |
Friends | |
| class | Terrain |
External Services access. | |
These methods support the External Services and are not part of the WSF public interface. | |
| GeoElevationTileManager & | GetTileManager () |
| GeoElevationTileManager & | GetVegetationManager () |
| GeoElevationTileManager & | GetManager () |
| GeoElevationTileManager & | GetBathymetryManager () |
| bool | AddDtedDirectory (const std::string &aDirName, int aLevel) |
| bool | AddRawDtedDirectory (const std::string &aDirName, int aLevel, int aSwLat, int aSwLon, int aNeLat, int aNeLon) |
| bool | AddGeotiffDirectory (const std::string &aDirName) |
| bool | AddBathymetry (const std::string &aFileName) |
| int | GetElevApproxP (double aLat, double aLon, float &aElev, GeoElevationTileManager &aTileManager, GeoElevationTile *&aTilePtr) |
| void | GetGeodeticElev (double aLat, double aLon, float &aElev) |
| void | GeodeticComputeNormal (double aLat, double aLon, double aNormal[3]) |
| void | GetNormalNED (double aLat, double aLon, double aNormal[3], GeoElevationTile *&aTilePtr) |
| void | GetNormalENU (double aLat, double aLon, double aNormal[3], GeoElevationTile *&aTilePtr) |
| void | DisableTerrain () |
| void | EnableTerrain () |
| bool | MaskedByTerrain (double aLat1, double aLon1, double aAlt1, double aLat2, double aLon2, double aAlt2, double aMaxRange, double aRadiusScale=1.0) |
| bool | MaskedByVegetation (double aLat1, double aLon1, double aAlt1, double aLat2, double aLon2, double aAlt2, double aMaxRange, double aRadiusScale=1.0) |
| bool | MaskedByUnderwaterTerrain (double aLat1, double aLon1, double aAlt1, double aLat2, double aLon2, double aAlt2, double aMaxRange, double aRadiusScale=1.0) |
| void | ValidateDTED () |
| bool | SetFloatGridDirectory (const std::string &aDirName, double aSwLat, double aSwLon, double aNeLat, double aNeLon, GeoElevationTileManager &aTileManager) |
| bool | SetFloatGridFile (const std::string &aFileName, GeoElevationTileManager &aTileManager) |
| int | GetElevInterpP (double aLat, double aLon, float &aElev, GeoElevationTileManager &aTileManager, GeoElevationTile *&aTilePtr) |
| bool | MaskedByTerrainP (double aLat1, double aLon1, double aAlt1, double aLat2, double aLon2, double aAlt2, double aMaxRange, GeoElevationTileManager &TileManager, double aRadiusScale) |
| bool | MaskedByTerrainFastP (double aLat1, double aLon1, double aAlt1, double aLat2, double aLon2, double aAlt2, double aMaxRange, GeoElevationTileManager &aTileManager) |
| bool | ListTheFiles (const std::string &aGeodeticEarthFilePathname) |
| bool | DirectoryExists (const std::string &aDirName, const std::string &aCommand) |
| Check to see if the indicated directory exists. | |
| bool | LoadTile (double aLat, double aLon, GeoElevationTile *&aTilePtr) |
| int | LoadCME_File (const char *aCfgFile) |
| bool | LoadCME_Terrain () |
| void | ReadString (std::istream &aIn, std::string &aString) |
Manages interface to terrain for a set of WsfTerrain objects.
| wsf::TerrainInterface::TerrainInterface | ( | WsfScenario & | aScenarioPtr | ) |
| wsf::TerrainInterface::~TerrainInterface | ( | ) |
| bool wsf::TerrainInterface::AddBathymetry | ( | const std::string & | aFileName | ) |
References cBATHYMETRY, GetBathymetryManager(), GetScenario(), WsfScenario::GetSystemLog(), ok, and WsfSystemLog::WriteLogEntry().
Referenced by Initialize().
| bool wsf::TerrainInterface::AddDtedDirectory | ( | const std::string & | aDirName, |
| int | aLevel ) |
Add a NIMA DTED directory to the list of directories containing elevation data.
The directory tree should be in the EXACT format as copied from a NIMA CD (i.e.: The specified directory must contain a file named 'dmed' and a sub-directory named 'dted' which contains the longitudinal directories) The 'dmed' file is expected to be intact and reflect the limits of what is contained in the directory.
| aDirName | The name of the directory. It must contain a valid 'dmed' file and a directory 'dted' which contains the longitudinal directories. |
| aLevel | The DTED level (0, 1, or 2) |
References cDTED, DirectoryExists(), GetManager(), GetScenario(), WsfScenario::GetSystemLog(), ok, and WsfSystemLog::WriteLogEntry().
Referenced by Initialize(), and LoadCME_File().
| bool wsf::TerrainInterface::AddGeotiffDirectory | ( | const std::string & | aDirName | ) |
References cGEOTIFF, GetManager(), GetScenario(), WsfScenario::GetSystemLog(), ok, and WsfSystemLog::WriteLogEntry().
Referenced by Initialize().
| bool wsf::TerrainInterface::AddRawDtedDirectory | ( | const std::string & | aDirName, |
| int | aLevel, | ||
| int | aSwLat, | ||
| int | aSwLon, | ||
| int | aNeLat, | ||
| int | aNeLon ) |
Add a NIMA DTED directory to the list of directories containing elevation data.
This method is used when the 'dmed' file does not exist or does not represent the true contents of the directory (such as when multiple DTED CDs have been copied into the same directory). The bounding box of the region must be specified.
| aDirName | The name of the directory. The immediate sub-directories must be the longitudinal directories. |
| aLevel | The DTED level (0, 1, or 2) |
| aSwLat | The latitude of the southwest corner of the bounding box. |
| aSwLon | The longitude of the southwest corner of the bounding box. |
| aNeLat | The latitude of the northeast corner of the bounding box. |
| aNeLon | The longitude of the northeast corner of the bounding box. |
References cDTED, DirectoryExists(), GetManager(), GetScenario(), WsfScenario::GetSystemLog(), ok, and WsfSystemLog::WriteLogEntry().
Referenced by Initialize(), and LoadCME_File().
|
protected |
Check to see if the indicated directory exists.
Referenced by AddDtedDirectory(), AddRawDtedDirectory(), and SetFloatGridDirectory().
| void wsf::TerrainInterface::DisableTerrain | ( | ) |
Disable terrain processing even if terrain has been loaded. All subsequent terrain calls will operate as though no terrain has been loaded.
| void wsf::TerrainInterface::EnableTerrain | ( | ) |
(Re)enable terrain processing. If terrain has been defined and terrain processing has not been disabled by the user then subsequent terrain processing calls will utilize the terrain.
Referenced by WsfNavigationMesh::DebugDrawMesh(), and WsfTerrainPathFinder::Initialize().
| void wsf::TerrainInterface::GeodeticComputeNormal | ( | double | aLat, |
| double | aLon, | ||
| double | aNormal[3] ) |
Referenced by GetNormalENU(), and GetNormalNED().
|
static |
References WsfScenario::GetTerrainInterface(), and TerrainInterface().
Referenced by HorizontalMapFunction::BuildContours(), WsfPlatform::CompleteLoad(), WsfTRIMSIM_SensorComponent::CorrectForAltitude(), wsf::coverage::RectangularGrid::CreateRectangularGrid(), WsfDisInterface::ExtrapolatePlatformState(), WsfSimulation::GetTerrainInterface(), WsfZoneSet::Initialize(), WsfTrack::ProcessInputBlock(), Terrain, UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and wsf::coverage::Grid::WriteGridDataFile().
| GeoElevationTileManager & wsf::TerrainInterface::GetBathymetryManager | ( | ) |
References wsf::Terrain::cBATHYMETRY, and cBATHYMETRY.
Referenced by AddBathymetry(), MaskedByTerrain(), and MaskedByUnderwaterTerrain().
|
inline |
|
inline |
Access for DTED DB Information.
| int wsf::TerrainInterface::GetDTEDLevelByIndex | ( | size_t | aIndex | ) |
|
inline |
| void wsf::TerrainInterface::GetDTEDPathByIndex | ( | size_t | aIndex, |
| std::string & | aPath ) |
|
inline |
Access for Earth Radius Multiplier.
| int wsf::TerrainInterface::GetElevApproxP | ( | double | aLat, |
| double | aLon, | ||
| float & | aElev, | ||
| GeoElevationTileManager & | aTileManager, | ||
| GeoElevationTile *& | aTilePtr ) |
|
protected |
| void wsf::TerrainInterface::GetGeodeticElev | ( | double | aLat, |
| double | aLon, | ||
| float & | aElev ) |
Referenced by GetElevApproxP(), GetElevInterpP(), and Fires::FiresMover::Update().
|
inline |
Access for geotiff DB Information.
| GeoElevationTileManager & wsf::TerrainInterface::GetManager | ( | ) |
References cDTED, cGEOTIFF, and wsf::Terrain::cTERRAIN.
Referenced by AddDtedDirectory(), AddGeotiffDirectory(), AddRawDtedDirectory(), wsf::Terrain::GetManager(), GetTileManager(), Initialize(), LoadTile(), and MaskedByTerrain().
| void wsf::TerrainInterface::GetNormalENU | ( | double | aLat, |
| double | aLon, | ||
| double | aNormal[3], | ||
| GeoElevationTile *& | aTilePtr ) |
Get the unit normal vector to the terrain in East-North-Up coordinates.
| aLat | Latitude in the range [-90, 90] |
| aLon | Longitude in the range [-180, 180] |
| aNormal | [output] The resulting normal vector or [0, 0, 1] if |
| aTilePtr | [output] The tile containing aLat, aLon there is no terrain at the requested point or if terrain processing has been disabled. |
References cBATHYMETRY, cDTED, cFLOAT_GRID, cGEODETIC_EARTH_DATABASE, cGEOTIFF, cVISUAL_DATABASE, GeodeticComputeNormal(), and LoadTile().
| void wsf::TerrainInterface::GetNormalNED | ( | double | aLat, |
| double | aLon, | ||
| double | aNormal[3], | ||
| GeoElevationTile *& | aTilePtr ) |
Get the unit normal vector to the terrain in North-East-Down coordinates.
| aLat | Latitude in the range [-90, 90] |
| aLon | Longitude in the range [-180, 180] |
| aNormal | [output] The resulting normal vector or [0, 0, -1] if |
| aTilePtr | [output] The tile containing aLat,aLon there is no terrain at the requested point or if terrain processing has been disabled. |
References cBATHYMETRY, cDTED, cFLOAT_GRID, cGEODETIC_EARTH_DATABASE, cGEOTIFF, cVISUAL_DATABASE, GeodeticComputeNormal(), and LoadTile().
|
inline |
| GeoElevationTileManager & wsf::TerrainInterface::GetTileManager | ( | ) |
References GetManager().
| GeoElevationTileManager & wsf::TerrainInterface::GetVegetationManager | ( | ) |
References cDTED, and wsf::Terrain::cVEGETATION.
Referenced by Initialize(), and MaskedByVegetation().
| bool wsf::TerrainInterface::Initialize | ( | ) |
References AddBathymetry(), AddDtedDirectory(), AddGeotiffDirectory(), AddRawDtedDirectory(), GetManager(), GetVegetationManager(), ListTheFiles(), LoadCME_Terrain(), ok, SetFloatGridDirectory(), SetFloatGridFile(), and ValidateDTED().
Referenced by Terrain.
|
inline |
Referenced by MaskedByTerrain(), and MaskedByUnderwaterTerrain().
|
inline |
|
inline |
Referenced by MaskedByTerrain().
|
inline |
|
inline |
Referenced by MaskedByVegetation().
|
protected |
Referenced by Initialize().
|
protected |
This is a cut down version of 'GeoData::LoadConfigurationFile' from the geodata project. This allows us to read our normal 'geodata.dat' files. All of the directives except 'dted' and 'raw_dted' are ignored.
References AddDtedDirectory(), AddRawDtedDirectory(), GetScenario(), WsfScenario::GetSystemLog(), ReadString(), and WsfSystemLog::WriteLogEntry().
Referenced by LoadCME_Terrain().
|
protected |
References LoadCME_File(), and ok.
Referenced by Initialize().
|
protected |
Check to see if the current tile encloses the provided latitude and longitude. If not load the tile that does.
| aLat | Latitude in the range [-90, 90]. |
| aLon | Longitude in the range [-180, 180]. |
| aTilePtr | [output] The tile containing aLat,aLon |
References GetManager().
Referenced by GetNormalENU(), and GetNormalNED().
| bool wsf::TerrainInterface::MaskedByTerrain | ( | double | aLat1, |
| double | aLon1, | ||
| double | aAlt1, | ||
| double | aLat2, | ||
| double | aLon2, | ||
| double | aAlt2, | ||
| double | aMaxRange, | ||
| double | aRadiusScale = 1.0 ) |
Is the line of sight between two points masked by the terrain?
| aLat1 | Latitude of the first point [-90, 90] |
| aLon1 | Longitude of the first point [-180, 180] |
| aAlt1 | Altitude MSL of the first point. |
| aLat2 | Latitude of the second point [-90, 90] |
| aLon2 | Longitude of the second point [-180, 180] |
| aAlt2 | Altitude MSL of the second point. |
| aMaxRange | Distance at which to stop checking. |
| aRadiusScale | Effective earth radius multiplier (default = 1.0) |
References GetBathymetryManager(), GetManager(), IsBathymetryEnabled(), IsEnabled(), and MaskedByTerrainP().
Referenced by wsf::comm::ComponentHW_Subsurface::CanSendTo(), WsfLOS_Manager::MaskedByTerrain(), WsfLOS_Manager::MaskedByTerrain(), and WsfLOS_Manager::MaskedByTerrain().
|
protected |
References cGEODETIC_EARTH_DATABASE, cVISUAL_DATABASE, and std::swap().
Referenced by MaskedByTerrainP().
|
protected |
References wsf::Terrain::cBATHYMETRY, cBATHYMETRY, cGEODETIC_EARTH_DATABASE, wsf::Terrain::cVEGETATION, cVISUAL_DATABASE, wsf::Terrain::GetBathymetryElevInterp(), wsf::Terrain::GetElevInterp(), MaskedByTerrainFastP(), std::swap(), and Terrain.
Referenced by MaskedByTerrain(), MaskedByUnderwaterTerrain(), and MaskedByVegetation().
| bool wsf::TerrainInterface::MaskedByUnderwaterTerrain | ( | double | aLat1, |
| double | aLon1, | ||
| double | aAlt1, | ||
| double | aLat2, | ||
| double | aLon2, | ||
| double | aAlt2, | ||
| double | aMaxRange, | ||
| double | aRadiusScale = 1.0 ) |
Is the line of sight between two points masked by the underwater terrain?
| aLat1 | Latitude of the first point [-90, 90] |
| aLon1 | Longitude of the first point [-180, 180] |
| aAlt1 | Altitude MSL of the first point. |
| aLat2 | Latitude of the second point [-90, 90] |
| aLon2 | Longitude of the second point [-180, 180] |
| aAlt2 | Altitude MSL of the second point. |
| aMaxRange | Distance at which to stop checking. |
| aRadiusScale | Effective earth radius multiplier (default = 1.0) |
References GetBathymetryManager(), IsBathymetryEnabled(), and MaskedByTerrainP().
| bool wsf::TerrainInterface::MaskedByVegetation | ( | double | aLat1, |
| double | aLon1, | ||
| double | aAlt1, | ||
| double | aLat2, | ||
| double | aLon2, | ||
| double | aAlt2, | ||
| double | aMaxRange, | ||
| double | aRadiusScale = 1.0 ) |
Is the line of sight between two points masked by the vegetation layer?
| aLat1 | Latitude of the first point [-90, 90] |
| aLon1 | Longitude of the first point [-180, 180] |
| aAlt1 | Altitude MSL of the first point. |
| aLat2 | Latitude of the second point [-90, 90] |
| aLon2 | Longitude of the second point [-180, 180] |
| aAlt2 | Altitude MSL of the second point. |
| aMaxRange | Distance at which to stop checking. |
| aRadiusScale | Effective earth radius multiplier (default = 1.0) |
References GetVegetationManager(), IsVegetationEnabled(), and MaskedByTerrainP().
Referenced by WsfLOS_Manager::MaskedByVegetation(), WsfLOS_Manager::MaskedByVegetation(), and WsfLOS_Manager::MaskedByVegetation().
| void wsf::TerrainInterface::PerformQueries | ( | WsfSimulation & | aSimulation | ) |
References wsf::TerrainInterface::Query::cHEIGHT, wsf::TerrainInterface::Query::cHORIZON, wsf::TerrainInterface::Query::cMASKING, wsf::TerrainInterface::Query::cTEST_EXTREMA_IN_ZONE, wsf::Terrain::GetElevApprox(), wsf::Terrain::GetElevInterp(), wsf::Terrain::GetHeightExtremaIn(), wsf::Terrain::MaskedByTerrain(), wsf::Terrain::Post::mHeightM, wsf::Terrain::Post::mLatDeg, wsf::Terrain::Post::mLonDeg, success, and Terrain.
Referenced by WsfSimulation::WsfSimulation().
| bool wsf::TerrainInterface::ProcessInput | ( | UtInput & | aInput | ) |
See if the supplied command is one of mine.
| aInput | The input stream. |
References cBATHYMETRY, cDTED, cFLOAT_GRID, cGEODETIC_EARTH_DATABASE, cGEOTIFF, wsf::TerrainInterface::Query::cHEIGHT, wsf::TerrainInterface::Query::cHORIZON, wsf::TerrainInterface::Query::cMASKING, wsf::TerrainInterface::Query::cTEST_EXTREMA_IN_ZONE, cVISUAL_DATABASE, wsf::EarthGravityModelExtension::Get(), GetScenario(), wsf::TerrainInterface::Query::mAlt, wsf::TerrainInterface::Query::mAlt2, wsf::TerrainInterface::DtedInput::mDirName, wsf::TerrainInterface::FloatGridInput::mDirName, wsf::TerrainInterface::GeotiffInput::mDirName, wsf::TerrainInterface::Query::mEarthRadius, wsf::TerrainInterface::BathymetryInput::mFileName, wsf::TerrainInterface::FloatGridInput::mFileName, wsf::TerrainInterface::Query::mLat, wsf::TerrainInterface::Query::mLat2, wsf::TerrainInterface::DtedInput::mLevel, wsf::TerrainInterface::Query::mLon, wsf::TerrainInterface::Query::mLon2, wsf::TerrainInterface::DtedInput::mRaw, wsf::TerrainInterface::Query::mType, wsf::TerrainInterface::FloatGridInput::mVegetation, wsf::TerrainInterface::Query::mZonePtr, ok, ProcessInput(), and wsf::TerrainInterface::RectInput::ProcessRect().
Referenced by ProcessInput(), and Terrain.
|
protected |
Referenced by LoadCME_File().
|
protected |
Set a Grid-Float processed DEM directory tree. The bounding box of the region must be specified.
| aDirName | The name of the directory. The immediate sub-directories must be the longitudinal directories. |
| aSwLat | The latitude of the southwest corner of the bounding box. |
| aSwLon | The longitude of the southwest corner of the bounding box. |
| aNeLat | The latitude of the northeast corner of the bounding box. |
| aNeLon | The longitude of the northeast corner of the bounding box. |
| aTileManager | The tile manager |
References cFLOAT_GRID, wsf::Terrain::cTERRAIN, DirectoryExists(), GetScenario(), WsfScenario::GetSystemLog(), ok, and WsfSystemLog::WriteLogEntry().
Referenced by Initialize().
|
protected |
Set a Grid-Float processed DEM directory tree. The bounding box of the region must be specified.
| aFileName | The name of the file. The program must be able to find the file, independent of any directory entries you may have made; so there must be an absolute or relative path associated with it. |
| aTileManager | The tile manager |
References cFLOAT_GRID, wsf::Terrain::cTERRAIN, GetScenario(), WsfScenario::GetSystemLog(), ok, and WsfSystemLog::WriteLogEntry().
Referenced by Initialize().
|
protected |
Validate DTED data for correctness. This method examines ALL of the loaded DTED to see if the elevation data is reasonable.
Referenced by Initialize().
|
friend |
References Get(), Initialize(), ProcessInput(), Terrain, and TerrainInterface().
Referenced by MaskedByTerrainP(), PerformQueries(), and Terrain.