WSF
P6DofTerrain.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 2003-2015 The Boeing 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 P6DOFTERRAIN_H
13#define P6DOFTERRAIN_H
14
15#include "p6dof_export.h"
16
17#include <string>
18#include <vector>
19
20#include "UtVec3dX.hpp"
21
22class UtInput;
23
25// class returns a zero height of terrain for all locations. Specific terrain
26// models should derive from this class.
27
28class P6DOF_EXPORT P6DofTerrain
29{
30public:
31 explicit P6DofTerrain(const std::string& aFilename);
32
33 ~P6DofTerrain() = default;
34
35 P6DofTerrain* Clone() const;
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 P6DofTerrain() = default;
59 P6DofTerrain(const P6DofTerrain& aSrc) = default;
60
62 {
63 double lat_deg;
64 double lon_deg;
65 double minlat_deg;
66 double maxlat_deg;
67 double minlon_deg;
68 double maxlon_deg;
69 double alt_ft;
70 };
71
73 {
74 double minlat_deg;
75 double maxlat_deg;
76 double minlon_deg;
77 double maxlon_deg;
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
90 std::vector<TerrainRegion> mTerrainRegionList;
91};
92
93#endif
~P6DofTerrain()=default
bool ProcessLocation(UtInput &aInput, TerrainRegion &aRegion)
Definition P6DofTerrain.cpp:230
P6DofTerrain()=default
P6DofTerrain(const P6DofTerrain &aSrc)=default
P6DofTerrain(const std::string &aFilename)
Definition P6DofTerrain.cpp:22
bool ProcessInput(UtInput &aInput)
Definition P6DofTerrain.cpp:85
bool ProcessRegion(UtInput &aInput)
Definition P6DofTerrain.cpp:113
bool ReadTerrainFile(const std::string &aFilename)
Definition P6DofTerrain.cpp:32
bool WithinRegion(const TerrainRegion &aRegion, double aLatitude, double aLongitude) const
Definition P6DofTerrain.cpp:413
double HeightOfTerrain_m(double aLatitude, double aLongitude) const
Definition P6DofTerrain.cpp:360
bool HeightOfRegionLocation_ft(double aLatitude, double aLongitude, double &aAlt_ft) const
Definition P6DofTerrain.cpp:390
std::vector< TerrainRegion > mTerrainRegionList
Definition P6DofTerrain.hpp:90
bool WithinLocation(const TerrainLocation &aLocation, double aLatitude, double aLongitude, double &aAlt_ft) const
Definition P6DofTerrain.cpp:436
P6DofTerrain * Clone() const
Definition P6DofTerrain.cpp:27
Definition P6DofTerrain.hpp:62
double minlat_deg
Definition P6DofTerrain.hpp:65
double lon_deg
Definition P6DofTerrain.hpp:64
double minlon_deg
Definition P6DofTerrain.hpp:67
double alt_ft
Definition P6DofTerrain.hpp:69
double maxlat_deg
Definition P6DofTerrain.hpp:66
double maxlon_deg
Definition P6DofTerrain.hpp:68
double lat_deg
Definition P6DofTerrain.hpp:63
Definition P6DofTerrain.hpp:73
std::vector< TerrainLocation > locationList
Definition P6DofTerrain.hpp:78
double minlat_deg
Definition P6DofTerrain.hpp:74
double maxlat_deg
Definition P6DofTerrain.hpp:75
double minlon_deg
Definition P6DofTerrain.hpp:76
double maxlon_deg
Definition P6DofTerrain.hpp:77
Copyrights Multiple, All Rights Reserved