VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtRunwayMarkingManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCore/DtDe.h>
14 #include <vrvCore/DtUniqueID.h>
15 
18 
19 #include <vrvOsg/vrvOsg.h>
20 
21 #include <matrix/vlVector.h>
22 
23 #include <osg/Vec3>
24 #include <osg/Group>
25 #include <osg/Timer>
26 
27 #include <boost/bind.hpp>
28 #include <unordered_map>
29 
30 #include <string>
31 
32 namespace makVrv
33 {
34  class DtModelDefinition;
35  class DtOsgArticulatedModel;
36  class DtSceneObject;
37  class DtRunwaySignaler;
38  class DtCoordinateSystem;
39 
42  {
43  //
44  DtRunwayData();
45  // Data from shapefile attributes.
46  std::string apt_icao;
47  std::string runwayNum;
48  std::string runwayNum1;
49  std::string runwayNum2;
50  std::string surface;
51  std::string shoulder;
52  std::string edgeLight;
53  std::string markings;
54  std::string approach;
55  std::string REIL;
56 
59  int length_m;
60  int width_m;
61  int displaced;
63  int stopway;
64  int touchdown;
65 
66  double smoothness;
67  double true_heading;
68 
69  // Data from shapefile geometry
72  std::vector<DtVector> geomPoints; // describe the runway polygon
73 
74  // Calculated data
75 
76  // Shapefile geometry converted to local coordinates.
79  std::vector<DtVector> geomPoints_cig; // describe the runway polygon
80 
81  // Calculated from geometry and true heading.
84 
85  // Calculated from runway polygon.
86  double width_ft;
87 
88  // creation phase
94 
95  };
96 
98 
100  class DT_DLL_VRVOSG DtRunwayNode : public osg::Group
101  {
102  public:
103  DtRunwayNode(DtDe& de, DtRunwayData& runwayData, DtRunwaySignaler& runwaySignaler);
104  virtual ~DtRunwayNode();
105 
106  public:
110  };
111 
112  class DT_DLL_VRVOSG DtRunwayThresholdNode : public osg::Group
113  {
114  public:
115  DtRunwayThresholdNode(DtDe& de, DtRunwayThresholdData& runwayThresholdData, DtRunwaySignaler& runwaySignaler);
116  virtual ~DtRunwayThresholdNode();
117 
118  public:
122  };
123 
126  {
127  public:
129  static DtRunwaySignaler& instance(DtDe& de);
130 
132  virtual ~DtRunwaySignaler();
133 
134  boost::signalslib::signal<void ( const std::string& ) > signal_AerodromeStartInitializing;
135  boost::signalslib::signal<void ( const std::string& ) > signal_AerodromeCreated;
136 
137  boost::signalslib::signal<void ( DtRunwayData& )> signal_RunwayCreated;
138  boost::signalslib::signal<void ( DtRunwayData& )> signal_RunwayDestroyed;
139 
140  boost::signalslib::signal<void ( DtRunwayThresholdData& )> signal_RunwayThresholdCreated;
141  boost::signalslib::signal<void ( DtRunwayThresholdData& )> signal_RunwayThresholdDestroyed;
142 
143  protected:
145 
146  };
147 
150  {
151  public:
152 
153  typedef std::unordered_map<std::string, DtRunwayThresholdData> DtRunwayThresholdDataMap;
154 
155  typedef std::unordered_map<DtUniqueID, std::vector<DtSceneObject*> > DtSceneObjectsMap;
156  typedef std::unordered_map<DtUniqueID, std::vector<DtOsgArticulatedModel*> > DtRunwayLightsMap;
157 
159  static DtRunwayMarkingManager& instance(DtDe& anIG);
160 
162  virtual ~DtRunwayMarkingManager();
163 
166  virtual void updateRunwayManager(const float budget);
167 
168  virtual void slot_AerodromeCreated(const std::string& icao);
169  virtual void slot_AerodromeStartInitializing(const std::string& icao);
170 
171  virtual void slot_RunwayCreated(DtRunwayData& runwayData);
172  virtual void slot_RunwayDestroyed(DtRunwayData& runwayData);
173 
174  virtual void slot_RunwayThresholdCreated(DtRunwayThresholdData& runwayThreshold);
175  virtual void slot_RunwayThresholdDestroyed(DtRunwayThresholdData& runwayThreshold);
176 
177  virtual double runwayWidth(const std::vector<DtVector>& runwayPolygon) const;
178  virtual DtVector forwardVector(const std::vector<DtVector>& runwayPolygon) const;
179  virtual DtVector forwardVector(const DtVector& position, double heading) const;
180  virtual DtVector rightVector(const DtVector& position, double heading) const;
181 
182  public:
183 
184  boost::signalslib::signal<void (const std::string&)> signal_AerodromeCreated;
185 
186  boost::signalslib::signal<void (DtRunwayData&)> signal_RunwayCreated;
187  boost::signalslib::signal<void (DtRunwayData&)> signal_RunwayDestroyed;
188 
189  boost::signalslib::signal<void (DtRunwayThresholdData&)> signal_RunwayThresholdCreated;
190  boost::signalslib::signal<void (DtRunwayThresholdData&)> signal_RunwayThresholdDestroyed;
191 
192  protected:
193 
195 
199 
203 
206 
207  std::unordered_map<DtUniqueID, DtSceneObject*> myRunwayMarkers;
209 
213 
214  typedef std::unordered_map<std::string, std::string> ModelDefsByNameMap;
216 
217  protected:
218  static const char* RunwayLightMapFilename;
219 
220  protected:
221 
222  void addLightPtr(DtUniqueID runwayID, DtOsgArticulatedModel* lightModel);
223  void addSceneObjPtr(DtUniqueID runwayID, DtSceneObject* sceneObj);
224 
225  std::string runwayKey(const std::string& apt_icao, const std::string& runwayNum) const;
227  std::size_t hashRunwayData(const DtRunwayData& runwayData);
228 
229  bool createAndPlaceCenterlineLighting( DtRunwayData& runwayData, const float budget);
230  // Touchdown zone lighting based on FAA AC 150/5340-30D sec 3.3 b.
231  // Touchdown zone lights consist of 2 rows of transverse light bars located symmetrically about
232  // the runway centerline per Figure 34. Each light bar consists of 3 unidirectional lights
233  // facing the landing threshold. The rows of light bars extend to 3,000 feet (900 m), or
234  // one-half the runway length for runways less than 6,000 feet (1 800 m), from the threshold
235  // with the first light bars located 100 feet (30 m) from the threshold.
236  void createAndPlaceTouchdownZone(const DtRunwayData& runwayData);
237  void createAndPlaceTouchdownZoneLightBar(const DtUniqueID runwayId, const std::string& groupName,
238  const DtVector& position, double heading);
239  bool createAndPlaceEdgeLighting(DtRunwayData& runwayData, const float budget);
240  void createAndPlaceThresholdAndEndLighting(const DtRunwayData& runwayData);
241  void createAndPlaceApproachLighting(const DtRunwayThresholdData& runwayData);
242  void createAndPlaceREIL(const DtRunwayThresholdData& runwayData);
243  void createAndPlaceGroundLight(DtModelDefinition* modelDef, DtUniqueID runwayId, const std::string& groupName,
244  const DtVector& pos, double zOffset = 0.0, double heading = 0.0);
245 
246  bool readModelDefsByNameFile(const std::string& path, const std::string& modelDefsFilename);
247 
249  virtual void slot_coordinateSystemChanged();
250 
251  protected:
252  std::vector<std::string> myNewRunways;
253  std::vector<std::string> myNewRunwayPolygons;
255 
258  DtCoordinateSystem* myCoordinateSystem = nullptr;
259  private:
260 
261  DtVector geodeticToGeocentric(double lat, double lon, double alt) const;
262  DtVector geodeticToCig(const DtVector& geodPos) const;
263 
264  void removeRunwayData(const DtRunwayData& runwayData);
265  void removeRunwayThreshold(const DtRunwayThresholdData& runwayData);
266  };
267 }
std::vector< DtVector > geomPoints_cig
Definition: DtRunwayMarkingManager.h:79
int displaced
Definition: DtRunwayMarkingManager.h:61
int isDisplaced
Definition: DtRunwayMarkingManager.h:62
int touchdown
Definition: DtRunwayMarkingManager.h:64
std::string surface
Definition: DtRunwayMarkingManager.h:50
Definition: DtRunwayMarkingManager.h:149
DtRunwaySignaler & myRunwaySignaler
Definition: DtRunwayMarkingManager.h:109
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
std::string shoulder
Definition: DtRunwayMarkingManager.h:51
std::unordered_map< DtUniqueID, DtSceneObject * > myRunwayMarkers
Definition: DtRunwayMarkingManager.h:207
boost::signalslib::signal< void(DtRunwayData &)> signal_RunwayDestroyed
Definition: DtRunwayMarkingManager.h:187
boost::signalslib::signal< void(DtRunwayData &)> signal_RunwayCreated
Definition: DtRunwayMarkingManager.h:186
boost::signalslib::signal< void(DtRunwayThresholdData &)> signal_RunwayThresholdDestroyed
Definition: DtRunwayMarkingManager.h:141
DtVector centerLinePopulation
Definition: DtRunwayMarkingManager.h:93
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
double offsetFromStartOfRunway_m
Definition: DtRunwayMarkingManager.h:92
DtDe & myDe
Definition: DtRunwayMarkingManager.h:119
bool myAerodromeCreated
Definition: DtRunwayMarkingManager.h:212
Definition: DtRunwayMarkingManager.h:112
Definition: DtTextureAtlasIndexParser.h:23
Contains makVrv::DtDe class.
std::vector< std::string > myNewRunways
Definition: DtRunwayMarkingManager.h:252
ModelDefsByNameMap myModelDefsByNameMap
Definition: DtRunwayMarkingManager.h:215
double edgeLightingOffsetFromStartOfRunway_m
Definition: DtRunwayMarkingManager.h:90
std::string runwayNum1
Definition: DtRunwayMarkingManager.h:48
DtDe & myDe
Definition: DtRunwayMarkingManager.h:107
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:69
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:38
int myCurrentPhase
Definition: DtRunwayMarkingManager.h:89
boost::signalslib::signal< void(const std::string &)> signal_AerodromeCreated
Definition: DtRunwayMarkingManager.h:184
boost::signalslib::signal< void(DtRunwayThresholdData &)> signal_RunwayThresholdDestroyed
Definition: DtRunwayMarkingManager.h:190
double smoothness
Definition: DtRunwayMarkingManager.h:66
boost::signalslib::signal< void(DtRunwayData &)> signal_RunwayDestroyed
Definition: DtRunwayMarkingManager.h:138
std::string approach
Definition: DtRunwayMarkingManager.h:54
int stopway
Definition: DtRunwayMarkingManager.h:63
DtRunwayThresholdData myRunwayThresholdData
Definition: DtRunwayMarkingManager.h:120
std::unordered_map< DtUniqueID, std::vector< DtSceneObject * > > DtSceneObjectsMap
Definition: DtRunwayMarkingManager.h:155
double width_ft
Definition: DtRunwayMarkingManager.h:86
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::string apt_icao
Definition: DtRunwayMarkingManager.h:46
boost::signalslib::signal< void(const std::string &) > signal_AerodromeStartInitializing
Definition: DtRunwayMarkingManager.h:134
std::string runwayNum2
Definition: DtRunwayMarkingManager.h:49
DtRunwayData DtRunwayThresholdData
Definition: DtRunwayMarkingManager.h:97
DtVector displacedThresholdPoint_cig
Definition: DtRunwayMarkingManager.h:78
Contains makVrv::DtTextureAtlasIndexParser class.
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
double true_heading
Definition: DtRunwayMarkingManager.h:67
DtRunwayData myRunwayData
Definition: DtRunwayMarkingManager.h:108
std::string edgeLight
Definition: DtRunwayMarkingManager.h:52
std::unordered_map< std::string, DtRunwayThresholdData > DtRunwayThresholdDataMap
Definition: DtRunwayMarkingManager.h:153
int length_m
Definition: DtRunwayMarkingManager.h:59
DtSceneObjectsMap mySceneObjs
Definition: DtRunwayMarkingManager.h:211
std::vector< std::string > myNewRunwayPolygons
Definition: DtRunwayMarkingManager.h:253
DtRunwayThresholdDataMap myRunwayThresholdData
Definition: DtRunwayMarkingManager.h:208
DtVector edgeLightingCurrentPos
Definition: DtRunwayMarkingManager.h:91
int distance_r
Definition: DtRunwayMarkingManager.h:58
std::string runwayNum
Definition: DtRunwayMarkingManager.h:47
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
DtSignalConnectionManager myConnections
Definition: DtRunwayMarkingManager.h:197
int centerline
Definition: DtRunwayMarkingManager.h:57
std::vector< DtVector > geomPoints
Definition: DtRunwayMarkingManager.h:72
DtVector thresholdPoint_cig
Definition: DtRunwayMarkingManager.h:77
Base class to provide boost signal/slot management.
std::string REIL
Definition: DtRunwayMarkingManager.h:55
boost::signalslib::signal< void(DtRunwayThresholdData &)> signal_RunwayThresholdCreated
Definition: DtRunwayMarkingManager.h:189
boost::signalslib::signal< void(DtRunwayData &)> signal_RunwayCreated
Definition: DtRunwayMarkingManager.h:137
boost::signalslib::signal< void(const std::string &) > signal_AerodromeCreated
Definition: DtRunwayMarkingManager.h:135
DtVector thresholdPoint
Definition: DtRunwayMarkingManager.h:70
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:42
DtVector displacedThresholdPoint
Definition: DtRunwayMarkingManager.h:71
DtDe & myDe
Definition: DtRunwayMarkingManager.h:196
Definition: DtRunwayMarkingManager.h:125
DtRunwayLightsMap myRunwayLights
Definition: DtRunwayMarkingManager.h:210
Contains makVrv::DtUniqueID type.
Contains DLL export macros.
DtVector forwardVector_cig
Definition: DtRunwayMarkingManager.h:82
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:70
DtLockedBufferedQueue< DtRunwayThresholdData > myRunwayDisplacedThresholdLockedQueue
Definition: DtRunwayMarkingManager.h:202
DtTextureAtlasIndexParser * myTextureAtlasIndexParser
Definition: DtRunwayMarkingManager.h:198
DtLockedBufferedQueue< DtRunwayThresholdData > myRunwayThresholdLockedQueue
Definition: DtRunwayMarkingManager.h:201
std::string markings
Definition: DtRunwayMarkingManager.h:53
boost::signalslib::signal< void(DtRunwayThresholdData &)> signal_RunwayThresholdCreated
Definition: DtRunwayMarkingManager.h:140
DtLockedBufferedQueue< DtRunwayData > myRunwayDataToDeleteLockedQueue
Definition: DtRunwayMarkingManager.h:204
DtLockedBufferedQueue< DtRunwayThresholdData > myRunwayThresholdToDeleteLockedQueue
Definition: DtRunwayMarkingManager.h:205
std::unordered_map< DtUniqueID, std::vector< DtOsgArticulatedModel * > > DtRunwayLightsMap
Definition: DtRunwayMarkingManager.h:156
Definition: DtRunwayMarkingManager.h:41
DtLockedBufferedQueue< DtRunwayData > myRunwayDataLockedQueue
Definition: DtRunwayMarkingManager.h:200
Definition: DtRunwayMarkingManager.h:100
osg::Timer myCurrentFrameBudgetTimer
Definition: DtRunwayMarkingManager.h:254
std::unordered_map< std::string, std::string > ModelDefsByNameMap
Definition: DtRunwayMarkingManager.h:214
DtVector rightVector_cig
Definition: DtRunwayMarkingManager.h:83
DtRunwaySignaler & myRunwaySignaler
Definition: DtRunwayMarkingManager.h:121
static const char * RunwayLightMapFilename
Definition: DtRunwayMarkingManager.h:218
int width_m
Definition: DtRunwayMarkingManager.h:60

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)