VR-Forces 4.10 Class Documentation
 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) 2020 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 <boost/unordered_map.hpp>
29 
30 #include <string>
31 
32 namespace makVrv
33 {
34  class DtModelDefinition;
35  class DtOsgArticulatedModel;
36  class DtSceneObject;
37  class DtRunwaySignaler;
38 
41  {
42  //
43  DtRunwayData();
44  // Data from shapefile attributes.
45  std::string apt_icao;
46  std::string runwayNum;
47  std::string runwayNum1;
48  std::string runwayNum2;
49  std::string surface;
50  std::string shoulder;
51  std::string edgeLight;
52  std::string markings;
53  std::string approach;
54  std::string REIL;
55 
58  int length_m;
59  int width_m;
60  int displaced;
62  int stopway;
63  int touchdown;
64 
65  double smoothness;
66  double true_heading;
67 
68  // Data from shapefile geometry
71  std::vector<DtVector> geomPoints; // describe the runway polygon
72 
73  // Calculated data
74 
75  // Shapefile geometry converted to local coordinates.
78  std::vector<DtVector> geomPoints_cig; // describe the runway polygon
79 
80  // Calculated from geometry and true heading.
83 
84  // Calculated from runway polygon.
85  double width_ft;
86 
87  // creation phase
93 
94  };
95 
97 
99  class DT_DLL_VRVOSG DtRunwayNode : public osg::Group
100  {
101  public:
102  DtRunwayNode(DtDe& de, DtRunwayData& runwayData, DtRunwaySignaler& runwaySignaler);
103  virtual ~DtRunwayNode();
104 
105  public:
109  };
110 
111  class DT_DLL_VRVOSG DtRunwayThresholdNode : public osg::Group
112  {
113  public:
114  DtRunwayThresholdNode(DtDe& de, DtRunwayThresholdData& runwayThresholdData, DtRunwaySignaler& runwaySignaler);
115  virtual ~DtRunwayThresholdNode();
116 
117  public:
121  };
122 
125  {
126  public:
128  static DtRunwaySignaler& instance(DtDe& de);
129 
131  virtual ~DtRunwaySignaler();
132 
133  boost::signalslib::signal<void ( const std::string& ) > signal_AerodromeStartInitializing;
134  boost::signalslib::signal<void ( const std::string& ) > signal_AerodromeCreated;
135 
136  boost::signalslib::signal<void ( DtRunwayData& )> signal_RunwayCreated;
137  boost::signalslib::signal<void ( DtRunwayData& )> signal_RunwayDestroyed;
138 
139  boost::signalslib::signal<void ( DtRunwayThresholdData& )> signal_RunwayThresholdCreated;
140  boost::signalslib::signal<void ( DtRunwayThresholdData& )> signal_RunwayThresholdDestroyed;
141 
142  protected:
144 
145  };
146 
149  {
150  public:
151 
152  typedef boost::unordered_map<std::string, DtRunwayThresholdData> DtRunwayThresholdDataMap;
153 
154  typedef boost::unordered_map<DtUniqueID, std::vector<DtSceneObject*> > DtSceneObjectsMap;
155  typedef boost::unordered_map<DtUniqueID, std::vector<DtOsgArticulatedModel*> > DtRunwayLightsMap;
156 
158  static DtRunwayMarkingManager& instance(DtDe& anIG);
159 
161  virtual ~DtRunwayMarkingManager();
162 
165  virtual void updateRunwayManager(const float budget);
166 
167  virtual void slot_AerodromeCreated(const std::string& icao);
168  virtual void slot_AerodromeStartInitializing(const std::string& icao);
169 
170  virtual void slot_RunwayCreated(DtRunwayData& runwayData);
171  virtual void slot_RunwayDestroyed(DtRunwayData& runwayData);
172 
173  virtual void slot_RunwayThresholdCreated(DtRunwayThresholdData& runwayThreshold);
174  virtual void slot_RunwayThresholdDestroyed(DtRunwayThresholdData& runwayThreshold);
175 
176  virtual double runwayWidth(const std::vector<DtVector>& runwayPolygon) const;
177  virtual DtVector forwardVector(const std::vector<DtVector>& runwayPolygon) const;
178  virtual DtVector forwardVector(const DtVector& position, double heading) const;
179  virtual DtVector rightVector(const DtVector& position, double heading) const;
180 
181  public:
182 
183  boost::signalslib::signal<void (const std::string&)> signal_AerodromeCreated;
184 
185  boost::signalslib::signal<void (DtRunwayData&)> signal_RunwayCreated;
186  boost::signalslib::signal<void (DtRunwayData&)> signal_RunwayDestroyed;
187 
188  boost::signalslib::signal<void (DtRunwayThresholdData&)> signal_RunwayThresholdCreated;
189  boost::signalslib::signal<void (DtRunwayThresholdData&)> signal_RunwayThresholdDestroyed;
190 
191  protected:
192 
194 
198 
202 
203  boost::unordered_map<DtUniqueID, DtSceneObject*> myRunwayMarkers;
205 
209 
210  typedef boost::unordered_map<std::string, std::string> ModelDefsByNameMap;
212 
213  protected:
214  static const char* RunwayLightMapFilename;
215 
216  protected:
217 
218  void addLightPtr(DtUniqueID runwayID, DtOsgArticulatedModel* lightModel);
219  void addSceneObjPtr(DtUniqueID runwayID, DtSceneObject* sceneObj);
220 
221  std::string runwayKey(const std::string& apt_icao, const std::string& runwayNum) const;
223  std::size_t hashRunwayData(const DtRunwayData& runwayData);
224 
225  bool createAndPlaceCenterlineLighting( DtRunwayData& runwayData, const float budget);
226  // Touchdown zone lighting based on FAA AC 150/5340-30D sec 3.3 b.
227  // Touchdown zone lights consist of 2 rows of transverse light bars located symmetrically about
228  // the runway centerline per Figure 34. Each light bar consists of 3 unidirectional lights
229  // facing the landing threshold. The rows of light bars extend to 3,000 feet (900 m), or
230  // one-half the runway length for runways less than 6,000 feet (1 800 m), from the threshold
231  // with the first light bars located 100 feet (30 m) from the threshold.
232  void createAndPlaceTouchdownZone(const DtRunwayData& runwayData);
233  void createAndPlaceTouchdownZoneLightBar(const DtUniqueID runwayId, const std::string& groupName,
234  const DtVector& position, double heading);
235  bool createAndPlaceEdgeLighting(DtRunwayData& runwayData, const float budget);
236  void createAndPlaceThresholdAndEndLighting(const DtRunwayData& runwayData);
237  void createAndPlaceApproachLighting(const DtRunwayThresholdData& runwayData);
238  void createAndPlaceREIL(const DtRunwayThresholdData& runwayData);
239  void createAndPlaceGroundLight(DtModelDefinition* modelDef, DtUniqueID runwayId, const std::string& groupName,
240  const DtVector& pos, double zOffset = 0.0, double heading = 0.0);
241 
242  bool readModelDefsByNameFile(const std::string& path, const std::string& modelDefsFilename);
243 
244  std::vector<std::string> myNewRunways;
245  std::vector<std::string> myNewRunwayPolygons;
247 
248  private:
249 
250  DtVector geodeticToGeocentric(double lat, double lon, double alt) const;
251  DtVector geodeticToCig(const DtVector& geodPos) const;
252 
253  };
254 }
std::vector< DtVector > geomPoints_cig
Definition: DtRunwayMarkingManager.h:78
int displaced
Definition: DtRunwayMarkingManager.h:60
int isDisplaced
Definition: DtRunwayMarkingManager.h:61
int touchdown
Definition: DtRunwayMarkingManager.h:63
std::string surface
Definition: DtRunwayMarkingManager.h:49
Definition: DtRunwayMarkingManager.h:148
DtRunwaySignaler & myRunwaySignaler
Definition: DtRunwayMarkingManager.h:108
Virtual base class.
Definition: DtVirtualBaseClass.h:19
std::string shoulder
Definition: DtRunwayMarkingManager.h:50
boost::signalslib::signal< void(DtRunwayData &)> signal_RunwayDestroyed
Definition: DtRunwayMarkingManager.h:186
boost::signalslib::signal< void(DtRunwayData &)> signal_RunwayCreated
Definition: DtRunwayMarkingManager.h:185
boost::signalslib::signal< void(DtRunwayThresholdData &)> signal_RunwayThresholdDestroyed
Definition: DtRunwayMarkingManager.h:140
DtVector centerLinePopulation
Definition: DtRunwayMarkingManager.h:92
boost::unordered_map< DtUniqueID, std::vector< DtSceneObject * > > DtSceneObjectsMap
Definition: DtRunwayMarkingManager.h:154
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
double offsetFromStartOfRunway_m
Definition: DtRunwayMarkingManager.h:91
DtDe & myDe
Definition: DtRunwayMarkingManager.h:118
bool myAerodromeCreated
Definition: DtRunwayMarkingManager.h:208
Definition: DtRunwayMarkingManager.h:111
Definition: DtTextureAtlasIndexParser.h:23
boost::unordered_map< std::string, DtRunwayThresholdData > DtRunwayThresholdDataMap
Definition: DtRunwayMarkingManager.h:152
Contains makVrv::DtDe class.
std::vector< std::string > myNewRunways
Definition: DtRunwayMarkingManager.h:244
ModelDefsByNameMap myModelDefsByNameMap
Definition: DtRunwayMarkingManager.h:211
double edgeLightingOffsetFromStartOfRunway_m
Definition: DtRunwayMarkingManager.h:89
std::string runwayNum1
Definition: DtRunwayMarkingManager.h:47
DtDe & myDe
Definition: DtRunwayMarkingManager.h:106
An articulated model manipulator for controlling an articulated model.
Definition: DtOsgArticulatedModel.h:67
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:88
boost::signalslib::signal< void(const std::string &)> signal_AerodromeCreated
Definition: DtRunwayMarkingManager.h:183
boost::signalslib::signal< void(DtRunwayThresholdData &)> signal_RunwayThresholdDestroyed
Definition: DtRunwayMarkingManager.h:189
double smoothness
Definition: DtRunwayMarkingManager.h:65
boost::signalslib::signal< void(DtRunwayData &)> signal_RunwayDestroyed
Definition: DtRunwayMarkingManager.h:137
std::string approach
Definition: DtRunwayMarkingManager.h:53
int stopway
Definition: DtRunwayMarkingManager.h:62
DtRunwayThresholdData myRunwayThresholdData
Definition: DtRunwayMarkingManager.h:119
double width_ft
Definition: DtRunwayMarkingManager.h:85
A locked buffered queue which allows multiple writers and a single reader.
Definition: DtLockedBufferedQueue.h:24
Contains makVrv::DtVirtualBaseClass class.
std::string apt_icao
Definition: DtRunwayMarkingManager.h:45
boost::signalslib::signal< void(const std::string &) > signal_AerodromeStartInitializing
Definition: DtRunwayMarkingManager.h:133
std::string runwayNum2
Definition: DtRunwayMarkingManager.h:48
DtRunwayData DtRunwayThresholdData
Definition: DtRunwayMarkingManager.h:96
DtVector displacedThresholdPoint_cig
Definition: DtRunwayMarkingManager.h:77
Contains makVrv::DtTextureAtlasIndexParser class.
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
double true_heading
Definition: DtRunwayMarkingManager.h:66
DtRunwayData myRunwayData
Definition: DtRunwayMarkingManager.h:107
std::string edgeLight
Definition: DtRunwayMarkingManager.h:51
int length_m
Definition: DtRunwayMarkingManager.h:58
DtSceneObjectsMap mySceneObjs
Definition: DtRunwayMarkingManager.h:207
std::vector< std::string > myNewRunwayPolygons
Definition: DtRunwayMarkingManager.h:245
DtRunwayThresholdDataMap myRunwayThresholdData
Definition: DtRunwayMarkingManager.h:204
DtVector edgeLightingCurrentPos
Definition: DtRunwayMarkingManager.h:90
int distance_r
Definition: DtRunwayMarkingManager.h:57
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
boost::unordered_map< DtUniqueID, std::vector< DtOsgArticulatedModel * > > DtRunwayLightsMap
Definition: DtRunwayMarkingManager.h:155
std::string runwayNum
Definition: DtRunwayMarkingManager.h:46
DtSignalConnectionManager myConnections
Definition: DtRunwayMarkingManager.h:196
int centerline
Definition: DtRunwayMarkingManager.h:56
std::vector< DtVector > geomPoints
Definition: DtRunwayMarkingManager.h:71
DtVector thresholdPoint_cig
Definition: DtRunwayMarkingManager.h:76
Base class to provide boost signal/slot management.
std::string REIL
Definition: DtRunwayMarkingManager.h:54
boost::signalslib::signal< void(DtRunwayThresholdData &)> signal_RunwayThresholdCreated
Definition: DtRunwayMarkingManager.h:188
boost::signalslib::signal< void(DtRunwayData &)> signal_RunwayCreated
Definition: DtRunwayMarkingManager.h:136
boost::signalslib::signal< void(const std::string &) > signal_AerodromeCreated
Definition: DtRunwayMarkingManager.h:134
DtVector thresholdPoint
Definition: DtRunwayMarkingManager.h:69
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:41
DtVector displacedThresholdPoint
Definition: DtRunwayMarkingManager.h:70
DtDe & myDe
Definition: DtRunwayMarkingManager.h:195
Definition: DtRunwayMarkingManager.h:124
DtRunwayLightsMap myRunwayLights
Definition: DtRunwayMarkingManager.h:206
Contains makVrv::DtUniqueID type.
Contains DLL export macros.
DtVector forwardVector_cig
Definition: DtRunwayMarkingManager.h:81
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
DtLockedBufferedQueue< DtRunwayThresholdData > myRunwayDisplacedThresholdLockedQueue
Definition: DtRunwayMarkingManager.h:201
DtTextureAtlasIndexParser * myTextureAtlasIndexParser
Definition: DtRunwayMarkingManager.h:197
DtLockedBufferedQueue< DtRunwayThresholdData > myRunwayThresholdLockedQueue
Definition: DtRunwayMarkingManager.h:200
std::string markings
Definition: DtRunwayMarkingManager.h:52
boost::signalslib::signal< void(DtRunwayThresholdData &)> signal_RunwayThresholdCreated
Definition: DtRunwayMarkingManager.h:139
Definition: DtRunwayMarkingManager.h:40
DtLockedBufferedQueue< DtRunwayData > myRunwayDataLockedQueue
Definition: DtRunwayMarkingManager.h:199
Definition: DtRunwayMarkingManager.h:99
osg::Timer myCurrentFrameBudgetTimer
Definition: DtRunwayMarkingManager.h:246
DtVector rightVector_cig
Definition: DtRunwayMarkingManager.h:82
DtRunwaySignaler & myRunwaySignaler
Definition: DtRunwayMarkingManager.h:120
boost::unordered_map< std::string, std::string > ModelDefsByNameMap
Definition: DtRunwayMarkingManager.h:210
static const char * RunwayLightMapFilename
Definition: DtRunwayMarkingManager.h:214
boost::unordered_map< DtUniqueID, DtSceneObject * > myRunwayMarkers
Definition: DtRunwayMarkingManager.h:203
int width_m
Definition: DtRunwayMarkingManager.h:59

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)