WSF
WsfSixDOF_Terrain.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2020 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFSIXDOFTERRAIN_HPP
13#define WSFSIXDOFTERRAIN_HPP
14
15#include "wsf_six_dof_export.h"
16
17#include <string>
18#include <vector>
19
20class UtInput;
21#include "UtVec3dX.hpp"
22
23namespace wsf
24{
26
27namespace six_dof
28{
30class WSF_SIX_DOF_EXPORT Terrain
31{
32public:
33 explicit Terrain(TerrainInterface* aWsfTerrain);
34
35 ~Terrain() = default;
36
37 bool ReadTerrainFile(const std::string& aFilename);
38
39 bool ProcessInput(UtInput& aInput);
40
41 // HeightOfTerrain_m returns the height of the terrain in meters above sea level.
42 // This function should be overloaded by derived classes.
43 double HeightOfTerrain_m(double aLatitude, double aLongitude) const;
44
45 // HeightOfTerrain_m returns the height of the terrain in meters above sea level.
46 // It also provides the normal vector (in NED coords) to the terrain (pointing up),
47 // the speed of the surface in NED (if moving, such as an aircraft carrier), and a
48 // friction multiplier at the location. The friction multiplier is used to relate
49 // how the friction at the location compares to nominal tire to runway friction.
50 // This function should be overloaded by derived classes.
51 double HeightOfTerrain_m(double aLatitude,
52 double aLongitude,
53 UtVec3dX& aUpVectorNED,
54 UtVec3dX& aSpeedVectorNED_mps,
55 double& aFrictionMultiplier) const;
56
57protected:
58 Terrain() = default;
59 Terrain(const Terrain& aSrc) = default;
60
62 {
63 double lat_deg = 0.0;
64 double lon_deg = 0.0;
65 double minlat_deg = 0.0;
66 double maxlat_deg = 0.0;
67 double minlon_deg = 0.0;
68 double maxlon_deg = 0.0;
69 double alt_ft = 0.0;
70 };
71
73 {
74 double minlat_deg = 0.0;
75 double maxlat_deg = 0.0;
76 double minlon_deg = 0.0;
77 double maxlon_deg = 0.0;
78 std::vector<TerrainLocation> locationList;
79 };
80
81 bool ProcessRegion(UtInput& aInput);
82 bool ProcessLocation(UtInput& aInput, TerrainRegion& aRegion);
83
84 bool HeightOfRegionLocation_ft(double aLatitude, double aLongitude, double& aAlt_ft) const;
85
86 bool WithinRegion(const TerrainRegion& aRegion, double aLatitude, double aLongitude) const;
87
88 bool WithinLocation(const TerrainLocation& aLocation, double aLatitude, double aLongitude, double& aAlt_ft) const;
89
90private:
91 std::vector<TerrainRegion> mTerrainRegionList;
92 wsf::TerrainInterface* mWsfTerrain = nullptr; // Used to serve common terrain data to SixDOF movers
93};
94} // namespace six_dof
95} // namespace wsf
96
97#endif
Manages interface to terrain for a set of WsfTerrain objects.
Definition WsfTerrain.hpp:43
double HeightOfTerrain_m(double aLatitude, double aLongitude) const
Definition WsfSixDOF_Terrain.cpp:356
bool ProcessRegion(UtInput &aInput)
Definition WsfSixDOF_Terrain.cpp:109
bool ProcessLocation(UtInput &aInput, TerrainRegion &aRegion)
Definition WsfSixDOF_Terrain.cpp:226
bool ReadTerrainFile(const std::string &aFilename)
Definition WsfSixDOF_Terrain.cpp:28
bool WithinLocation(const TerrainLocation &aLocation, double aLatitude, double aLongitude, double &aAlt_ft) const
Definition WsfSixDOF_Terrain.cpp:444
bool WithinRegion(const TerrainRegion &aRegion, double aLatitude, double aLongitude) const
Definition WsfSixDOF_Terrain.cpp:421
bool ProcessInput(UtInput &aInput)
Definition WsfSixDOF_Terrain.cpp:81
Terrain(TerrainInterface *aWsfTerrain)
Definition WsfSixDOF_Terrain.cpp:23
bool HeightOfRegionLocation_ft(double aLatitude, double aLongitude, double &aAlt_ft) const
Definition WsfSixDOF_Terrain.cpp:398
Terrain(const Terrain &aSrc)=default
Definition WsfSA_Processor.hpp:35
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Definition WsfSixDOF_Terrain.hpp:62
double alt_ft
Definition WsfSixDOF_Terrain.hpp:69
double minlat_deg
Definition WsfSixDOF_Terrain.hpp:65
double lon_deg
Definition WsfSixDOF_Terrain.hpp:64
double maxlat_deg
Definition WsfSixDOF_Terrain.hpp:66
double maxlon_deg
Definition WsfSixDOF_Terrain.hpp:68
double minlon_deg
Definition WsfSixDOF_Terrain.hpp:67
double lat_deg
Definition WsfSixDOF_Terrain.hpp:63
Definition WsfSixDOF_Terrain.hpp:73
double maxlat_deg
Definition WsfSixDOF_Terrain.hpp:75
double minlat_deg
Definition WsfSixDOF_Terrain.hpp:74
std::vector< TerrainLocation > locationList
Definition WsfSixDOF_Terrain.hpp:78
double minlon_deg
Definition WsfSixDOF_Terrain.hpp:76
double maxlon_deg
Definition WsfSixDOF_Terrain.hpp:77
Copyrights Multiple, All Rights Reserved