VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aerodromeLoader.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 
12 #include <features/feature.h>
14 #include <matrix/geodeticCoord.h>
15 #include <unordered_map>
16 #include <vrfutil/RTree.h>
17 #include <geometry/extent.h>
18 
19 namespace osgEarth
20 {
21  class MapNode;
22 }
23 
24 namespace MAKVRinTerra
25 {
26  class DtFeatureDatabase;
27 
29  {
30  public:
32  virtual ~DtAerodromeLoader();
33 
34  virtual bool loadAerodromes(const std::string& earthFile, MAKVRinTerra::DtFeatureDatabase& featureDatabase);
35  virtual bool loadAerodromes(osgEarth::MapNode*, MAKVRinTerra::DtFeatureDatabase& featureDatabase, const std::string& strFilename);
36 
39  virtual bool cacheAerodromes(MAKVRinTerra::DtFeatureDatabase& featureDatabase, int& errorCode);
40 
41  typedef struct _RunwayData
42  {
43  std::string name() const { return runway1 + "/" + runway2; }
44  std::string airportCode;
45  std::string runway1;
46  std::string runway2;
47  double length = 0.;
48  double heading1 = 0.;
49  double heading2 = 0.;
50  std::vector<DtVector> runwayPoints;
52  std::vector<DtPoint> runwayCorners;
53  } RunwayData;
54 
55  typedef struct _AerodromeDataBoundary
56  {
57  std::string airportCode;
58  std::vector< DtPoint > airportBoundary;
61 
62 
63  typedef struct _AerodromeData
64  {
65  long long type = 0;
66  std::string airportCode;
67  std::string airportName;
68  DtGeodeticCoord aerodromeLocation;
69  std::shared_ptr<AerodromeDataBoundary> aerodromeDataBoundary;
70  std::vector< std::shared_ptr<RunwayData> > runways;
72  } AerodromeData;
73 
74  virtual AerodromeData aerodrome(const std::string& airportCode) const;
75  virtual std::vector<AerodromeData> aerodromesWithinRange(const DtVector& location, double range) const;
76  virtual void addRunwayData(const RunwayData& runwayData);
77  virtual void addAerodrome(const AerodromeData& aerodromeData);
78  virtual void addAerodromeBoundary(const AerodromeDataBoundary& aerodromeDataBoundary);
79 
80  virtual DtGeodeticCoord aerodromeLocation(const std::string& airportCode) const;
81  virtual bool hasAerodrome(const std::string& airportCode) const;
82  virtual double altitudeOfAerodrome(const std::string& airportCode) const;
83 
84  const std::set<std::pair<std::string, std::string>>& getAirportandIcaoNames() const
85  {
86  return myAirportAndIcaoNames;
87  }
88 
89  bool hasAerodromes() const
90  {
91  return (myAerodromes.size() != 0);
92  }
93 
94  virtual void clear();
95 
97  virtual std::vector<AerodromeData> aerodromesInArea(const std::vector<DtVector>&) const;
98 
100  virtual std::vector<MAKVRinTerra::DtAerodromeLoader::AerodromeData> aerodromesAtLocation(const DtVector& location) const;
101 
103  virtual std::vector<MAKVRinTerra::DtAerodromeLoader::RunwayData> runwayAtLocation(const DtVector& location) const;
104 
105  protected:
106  virtual void visitAirportFeature(const MAKVRinTerra::DtFeature& feature);
107  virtual void visitAirportBoundaryFeature(const MAKVRinTerra::DtFeature& feature);
108  virtual void visitRunwayFeature(const MAKVRinTerra::DtFeature& feature);
109 
110  protected:
111  typedef std::unordered_map<std::string, AerodromeData> AerodromesType;
113  std::set<std::pair<std::string, std::string>> myAirportAndIcaoNames;
114 
118 
122  };
123 }
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
DtGeodeticCoord aerodromeLocation
Definition: aerodromeLoader.h:68
aerodromeBoundaryTreeType myaerodromeBoundaryTree
Definition: aerodromeLoader.h:121
Definition: aerodromeLoader.h:63
std::string airportCode
Definition: aerodromeLoader.h:66
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
AerodromesType myAerodromes
Definition: aerodromeLoader.h:112
makVrf::RTree< std::shared_ptr< RunwayData >, double, 3 > runwayTreeType
spatial tree that contain all the world runways
Definition: aerodromeLoader.h:116
std::string airportCode
Definition: aerodromeLoader.h:44
std::string runway1
Definition: aerodromeLoader.h:45
Definition: aerodromeLoader.h:28
Handle< PointType > Point
Definition: featureGeometry.h:70
DtFeatureGeometry::Point aerodromePointOrigin
Definition: aerodromeLoader.h:71
File I/O helper class, look below for implementation and notes.
Definition: RTree.h:58
std::vector< DtPoint > runwayCorners
contain the four corner of the runway
Definition: aerodromeLoader.h:52
std::string name() const
Definition: aerodromeLoader.h:43
Definition: featureContext.h:50
std::vector< DtVector > runwayPoints
Definition: aerodromeLoader.h:50
std::string airportName
Definition: aerodromeLoader.h:67
Definition: aerodromeLoader.h:41
Contains the declaration of the DtExtent class.
std::shared_ptr< AerodromeDataBoundary > aerodromeDataBoundary
Definition: aerodromeLoader.h:69
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
std::vector< DtPoint > airportBoundary
Definition: aerodromeLoader.h:58
runwayTreeType myrunwayTree
Definition: aerodromeLoader.h:117
bool hasAerodromes() const
Definition: aerodromeLoader.h:89
std::vector< std::shared_ptr< RunwayData > > runways
Definition: aerodromeLoader.h:70
makVrf::RTree< std::shared_ptr< AerodromeDataBoundary >, double, 3 > aerodromeBoundaryTreeType
spatial tree that contain all the world airport boundary
Definition: aerodromeLoader.h:120
Represents a GIS feature. Features consist of a DtFeatureGeometry (2.5D geometric vector data) and a ...
Definition: feature.h:36
DtExtent airportBoundaryBoundingBox
Definition: aerodromeLoader.h:59
std::set< std::pair< std::string, std::string > > myAirportAndIcaoNames
Definition: aerodromeLoader.h:113
std::string airportCode
Definition: aerodromeLoader.h:57
std::unordered_map< std::string, AerodromeData > AerodromesType
Definition: aerodromeLoader.h:111
const std::set< std::pair< std::string, std::string > > & getAirportandIcaoNames() const
Definition: aerodromeLoader.h:84
std::string runway2
Definition: aerodromeLoader.h:46

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)