VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgRunwayMarkingManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 
16 #include <vrvCore/DtDe.h>
19 #include <vrvCore/DtUniqueID.h>
20 #include <vrvCore/DtSceneObject.h>
21 #include <vrvCore/DtRunwayData.h>
22 
25 
26 #include <matrix/vlVector.h>
27 
28 #include <osg/Vec3>
29 #include <osg/Group>
30 #include <osg/Timer>
31 
32 #include <unordered_map>
33 
34 #include <string>
35 
36 namespace makVrv
37 {
38  class DtModelDefinition;
39  class DtOsgArticulatedModel;
40  class DtSceneObject;
41  class DtRunwaySignaler;
42  class DtCoordinateSystem;
43  class DtRunwaySelector;
44  enum class DtRunwayLightsEnum : unsigned int;
45  enum class DtAerodromeLightsEnum : unsigned int;
46 
49  {
50  public:
51 
52  typedef std::unordered_map<std::string, DtRunwayThresholdData> DtRunwayThresholdDataMap;
53  typedef std::unordered_map<DtUniqueID, std::vector<DtSceneObject*> > DtSceneObjectsMap;
54  typedef std::unordered_map<DtUniqueID, std::vector<DtOsgArticulatedModel*> > DtRunwayLightsMap;
55 
57 
59  virtual ~DtOsgRunwayMarkingManager();
60 
63  virtual void updateRunwayManager(const float budget) override;
64 
65  virtual void slot_AerodromeCreated(const std::string& icao);
66  virtual void slot_AerodromeStartInitializing(const std::string& icao);
67 
68  virtual void slot_RunwayCreated(DtRunwayData& runwayData);
69  virtual void slot_RunwayDestroyed(DtRunwayData& runwayData);
70 
71  virtual void slot_RunwayThresholdCreated(DtRunwayThresholdData& runwayThreshold);
72  virtual void slot_RunwayThresholdDestroyed(DtRunwayThresholdData& runwayThreshold);
73 
74  virtual double runwayWidth(const std::vector<DtVector>& runwayPolygon) const;
75  virtual DtVector forwardVector(const std::vector<DtVector>& runwayPolygon) const;
76  virtual DtVector forwardVector(const DtVector& position, double heading) const;
77  virtual DtVector rightVector(const DtVector& position, double heading) const;
78 
80  virtual std::string modelDefinitionFromLightName(const std::string& lightName, const std::string& defaultModelDefName="");
81 
85  virtual DtRunwayData runwayData(const std::string& key) const override;
86 
87  protected:
88  virtual void addLightPtr(DtUniqueID runwayID, DtOsgArticulatedModel* lightModel);
89  virtual void addSceneObjPtr(DtUniqueID runwayID, DtSceneObject* sceneObj);
90 
91  virtual bool createAndPlaceCenterlineLighting(DtRunwayData& runwayData, const float budget);
92 
93  // Touchdown zone lighting based on FAA AC 150/5340-30D sec 3.3 b.
94  // Touchdown zone lights consist of 2 rows of transverse light bars located symmetrically about
95  // the runway centerline per Figure 34. Each light bar consists of 3 unidirectional lights
96  // facing the landing threshold. The rows of light bars extend to 3,000 feet (900 m), or
97  // one-half the runway length for runways less than 6,000 feet (1 800 m), from the threshold
98  // with the first light bars located 100 feet (30 m) from the threshold.
99  virtual void createAndPlaceTouchdownZone(const DtRunwayData& runwayData);
100  virtual void createAndPlaceTouchdownZoneLightBar(const DtUniqueID runwayId, const std::string& airportName, const std::string& runwayName,
101  const DtVector& position, double heading);
102  virtual bool createAndPlaceEdgeLighting(DtRunwayData& runwayData, const float budget);
103  virtual void createAndPlaceThresholdAndEndLighting(const DtRunwayData& runwayData);
104  virtual void createAndPlaceApproachLighting(const DtRunwayThresholdData& runwayData);
105  virtual void createAndPlaceREIL(const DtRunwayThresholdData& runwayData);
106  virtual void createAndPlaceGroundLight(const DtModelDefinition* modelDef, DtUniqueID runwayId, const std::string& groupName,
107  const DtVector& pos, double zOffset = 0.0, double heading = 0.0);
108  virtual void createAndPlaceContinuousBarThreshold(const DtUniqueID runwayId, const std::string& threshGroupName,
109  const DtModelDefinition* threshDefinition, const DtRunwayData& runwayData);
110 
111  virtual bool readModelDefsByNameFile(const std::string& path, const std::string& modelDefsFilename);
112 
114  virtual void slot_coordinateSystemChanged();
115 
118  virtual void slot_runwayLightsChanged(std::string airportName, std::string runwayName, DtRunwayLightsEnum lightType, float intensity);
119 
122  virtual void slot_aerodromeLightsChanged(std::string aerodromeName, DtAerodromeLightsEnum lightType, float intensity);
123 
124  virtual void slot_deQuit();
125  virtual void cleanup() override;
126 
127  virtual void removeRunwayData(const DtRunwayData& runwayData);
128  virtual void removeRunwayThreshold(const DtRunwayThresholdData& runwayData);
129 
130  protected:
131  static const char* RunwayLightMapFilename;
132 
133  protected:
136 
140 
143 
144  std::unordered_map<DtUniqueID, DtSceneObject*> myRunwayMarkers;
146 
149 
150  typedef std::unordered_map<std::string, std::string> ModelDefsByNameMap;
152 
154 
155  std::vector<std::string> myNewRunways;
156  std::vector<std::string> myNewRunwayPolygons;
158 
161  DtCoordinateSystem* myCoordinateSystem = nullptr;
162 
163  DtVector geodeticToGeocentric(double lat, double lon, double alt) const;
164  DtVector geodeticToCig(const DtVector& geodPos) const;
165  DtTaitBryan geodeticToCig(const DtVector& geodPos, double geodeticHeading) const;
166  };
167 }
The DtRunwayMarkingManager processes aerodrome data that is streamed in from osgEarth. It uses that data to create and place runway lighting and set up runway selector objects. Most of the lighting implementation may be found in DtOsgRunwayMarkingManager. You can use this base class definition to lookup runway selectors and their associated data by element id (as provided by the DtSelectionManager).
Definition: DtRunwayMarkingManager.h:42
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
ModelDefsByNameMap myModelDefsByNameMap
Definition: DtOsgRunwayMarkingManager.h:151
DtLockedBufferedQueue< DtRunwayData > myRunwayDataLockedQueue
Definition: DtOsgRunwayMarkingManager.h:137
DtSceneObjectsMap mySceneObjs
Definition: DtOsgRunwayMarkingManager.h:148
std::unordered_map< DtUniqueID, std::vector< DtOsgArticulatedModel * > > DtRunwayLightsMap
Definition: DtOsgRunwayMarkingManager.h:54
std::unordered_map< std::string, DtRunwayThresholdData > DtRunwayThresholdDataMap
Definition: DtOsgRunwayMarkingManager.h:52
Definition: DtTextureAtlasIndexParser.h:33
bool myAerodromeCreated
Definition: DtOsgRunwayMarkingManager.h:153
Contains makVrv::DtRunwayMarkingManager class.
Contains makVrv::DtDe class.
std::unordered_map< DtUniqueID, std::vector< DtSceneObject * > > DtSceneObjectsMap
Definition: DtOsgRunwayMarkingManager.h:53
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:67
DtRunwayLightsEnum
Enumeration for light types placed on runways. Note that all are associated with logical runways exce...
Definition: DtLightGroupNameManager.h:22
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:42
Definition: DtOsgRunwayMarkingManager.h:48
A locked buffered queue which allows multiple writers and a single reader. Internally the queue is st...
Definition: DtLockedBufferedQueue.h:24
Contains makVrv::DtVirtualBaseClass class.
std::vector< std::string > myNewRunways
Definition: DtOsgRunwayMarkingManager.h:155
static const char * RunwayLightMapFilename
Definition: DtOsgRunwayMarkingManager.h:131
DtRunwayLightsMap myRunwayLights
Definition: DtOsgRunwayMarkingManager.h:147
Contains makVrv::DtTextureAtlasIndexParser class.
DtLockedBufferedQueue< DtRunwayThresholdData > myRunwayThresholdToDeleteLockedQueue
Definition: DtOsgRunwayMarkingManager.h:142
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtLockedBufferedQueue< DtRunwayThresholdData > myRunwayDisplacedThresholdLockedQueue
Definition: DtOsgRunwayMarkingManager.h:139
DtRunwayThresholdDataMap myRunwayThresholdData
Definition: DtOsgRunwayMarkingManager.h:145
DtRunwayData is the data collected from paged Aerodrome data and used for creating runway markings...
Definition: DtRunwayData.h:23
DtAerodromeLightsEnum
Enumeration for light types that are aerodrome wide.
Definition: DtLightGroupNameManager.h:40
std::unordered_map< DtUniqueID, DtSceneObject * > myRunwayMarkers
Definition: DtOsgRunwayMarkingManager.h:144
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
DtLockedBufferedQueue< DtRunwayThresholdData > myRunwayThresholdLockedQueue
Definition: DtOsgRunwayMarkingManager.h:138
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
osg::Timer myCurrentFrameBudgetTimer
Definition: DtOsgRunwayMarkingManager.h:157
std::vector< std::string > myNewRunwayPolygons
Definition: DtOsgRunwayMarkingManager.h:156
DtTextureAtlasIndexParser * myTextureAtlasIndexParser
Definition: DtOsgRunwayMarkingManager.h:135
Contains makVrv::DtRunwayData class.
Base class to provide boost signal/slot management.
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:44
DtSignalConnectionManager myConnections
Definition: DtOsgRunwayMarkingManager.h:134
Contains makVrv::DtUniqueID type.
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
DtLockedBufferedQueue< DtRunwayData > myRunwayDataToDeleteLockedQueue
Definition: DtOsgRunwayMarkingManager.h:141
Contains makVrv::DtSceneObject class.
std::unordered_map< std::string, std::string > ModelDefsByNameMap
Definition: DtOsgRunwayMarkingManager.h:150

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)