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 <boost/shared_ptr.hpp>
18 #include <geometry/extent.h>
19 
20 namespace osgEarth
21 {
22  class MapNode;
23 }
24 
25 namespace MAKVRinTerra
26 {
27  class DtFeatureDatabase;
28 
30  {
31  public:
33  virtual ~DtAerodromeLoader();
34 
35  virtual bool loadAerodromes(const std::string& earthFile, MAKVRinTerra::DtFeatureDatabase& featureDatabase);
36  virtual bool loadAerodromes(osgEarth::MapNode*, MAKVRinTerra::DtFeatureDatabase& featureDatabase, const std::string& strFilename);
37 
40  virtual bool cacheAerodromes(MAKVRinTerra::DtFeatureDatabase& featureDatabase, int& errorCode);
41 
42  typedef struct _RunwayData
43  {
44  std::string name() const { return runway1 + "/" + runway2; }
45  std::string airportCode;
46  std::string runway1;
47  std::string runway2;
48  double length = 0.;
49  double heading1 = 0.;
50  double heading2 = 0.;
51  std::vector<DtVector> runwayPoints;
53  std::vector<DtPoint> runwayCorners;
54  } RunwayData;
55 
56  typedef struct _AerodromeDataBoundary
57  {
58  std::string airportCode;
59  std::vector< DtPoint > airportBoundary;
62 
63 
64  typedef struct _AerodromeData
65  {
66  long long type = 0;
67  std::string airportCode;
68  std::string airportName;
69  DtGeodeticCoord aerodromeLocation;
70  boost::shared_ptr<AerodromeDataBoundary> aerodromeDataBoundary;
71  std::vector< boost::shared_ptr<RunwayData> > runways;
73  } AerodromeData;
74 
75  virtual AerodromeData aerodrome(const std::string& airportCode) const;
76  virtual std::vector<AerodromeData> aerodromesWithinRange(const DtVector& location, double range) const;
77  virtual void addRunwayData(const RunwayData& runwayData);
78  virtual void addAerodrome(const AerodromeData& aerodromeData);
79  virtual void addAerodromeBoundary(const AerodromeDataBoundary& aerodromeDataBoundary);
80 
81  virtual DtGeodeticCoord aerodromeLocation(const std::string& airportCode) const;
82  virtual bool hasAerodrome(const std::string& airportCode) const;
83  virtual double altitudeOfAerodrome(const std::string& airportCode) const;
84 
85  const std::set<std::pair<std::string, std::string>>& getAirportandIcaoNames() const
86  {
87  return myAirportAndIcaoNames;
88  }
89 
90  bool hasAerodromes() const
91  {
92  return (myAerodromes.size() != 0);
93  }
94 
95  virtual void clear();
96 
98  virtual std::vector<AerodromeData> aerodromesInArea(const std::vector<DtVector>&) const;
99 
101  virtual std::vector<MAKVRinTerra::DtAerodromeLoader::AerodromeData> aerodromesAtLocation(const DtVector& location) const;
102 
104  virtual std::vector<MAKVRinTerra::DtAerodromeLoader::RunwayData> runwayAtLocation(const DtVector& location) const;
105 
106  protected:
107  virtual void visitAirportFeature(const MAKVRinTerra::DtFeature& feature);
108  virtual void visitAirportBoundaryFeature(const MAKVRinTerra::DtFeature& feature);
109  virtual void visitRunwayFeature(const MAKVRinTerra::DtFeature& feature);
110 
111  protected:
112  typedef std::unordered_map<std::string, AerodromeData> AerodromesType;
114  std::set<std::pair<std::string, std::string>> myAirportAndIcaoNames;
115 
119 
123  };
124 }
makVrf::RTree< boost::shared_ptr< AerodromeDataBoundary >, double, 3 > aerodromeBoundaryTreeType
spatial tree that contain all the world airport boundary
Definition: aerodromeLoader.h:121
#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:69
aerodromeBoundaryTreeType myaerodromeBoundaryTree
Definition: aerodromeLoader.h:122
Definition: aerodromeLoader.h:64
std::string airportCode
Definition: aerodromeLoader.h:67
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
AerodromesType myAerodromes
Definition: aerodromeLoader.h:113
std::vector< boost::shared_ptr< RunwayData > > runways
Definition: aerodromeLoader.h:71
std::string airportCode
Definition: aerodromeLoader.h:45
makVrf::RTree< boost::shared_ptr< RunwayData >, double, 3 > runwayTreeType
spatial tree that contain all the world runways
Definition: aerodromeLoader.h:117
std::string runway1
Definition: aerodromeLoader.h:46
Definition: aerodromeLoader.h:29
Handle< PointType > Point
Definition: featureGeometry.h:69
DtFeatureGeometry::Point aerodromePointOrigin
Definition: aerodromeLoader.h:72
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:53
std::string name() const
Definition: aerodromeLoader.h:44
Definition: featureContext.h:51
std::vector< DtVector > runwayPoints
Definition: aerodromeLoader.h:51
std::string airportName
Definition: aerodromeLoader.h:68
Definition: aerodromeLoader.h:42
Contains the declaration of the DtExtent class.
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:59
runwayTreeType myrunwayTree
Definition: aerodromeLoader.h:118
bool hasAerodromes() const
Definition: aerodromeLoader.h:90
boost::shared_ptr< AerodromeDataBoundary > aerodromeDataBoundary
Definition: aerodromeLoader.h:70
Represents a GIS feature. Features consist of a DtFeatureGeometry (2.5D geometric vector data) and a ...
Definition: feature.h:37
DtExtent airportBoundaryBoundingBox
Definition: aerodromeLoader.h:60
std::set< std::pair< std::string, std::string > > myAirportAndIcaoNames
Definition: aerodromeLoader.h:114
std::string airportCode
Definition: aerodromeLoader.h:58
std::unordered_map< std::string, AerodromeData > AerodromesType
Definition: aerodromeLoader.h:112
const std::set< std::pair< std::string, std::string > > & getAirportandIcaoNames() const
Definition: aerodromeLoader.h:85
std::string runway2
Definition: aerodromeLoader.h:47

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)