VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtRunwayMarkingManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 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 
26 #include <boost/bind.hpp>
27 #include <boost/unordered_map.hpp>
28 
29 #include <string>
30 
31 namespace makVrv
32 {
33  class DtModelDefinition;
34  class DtOsgArticulatedModel;
35  class DtSceneObject;
36 
38  {
39  // Data from shapefile attributes.
40  std::string apt_icao;
41  std::string runwayNum;
42  std::string runwayNum1;
43  std::string runwayNum2;
44  std::string surface;
45  std::string shoulder;
46  std::string edgeLight;
47  std::string markings;
48  std::string approach;
49  std::string REIL;
50 
53  int length_m;
54  int width_m;
55  int displaced;
57  int stopway;
58  int touchdown;
59 
60  double smoothness;
61  double true_heading;
62 
63  // Data from shapefile geometry
66  std::vector<DtVector> geomPoints; // describe the runway polygon
67 
68  // Calculated data
69 
70  // Shapefile geometry converted to local coordinates.
73  std::vector<DtVector> geomPoints_cig; // describe the runway polygon
74 
75  // Calculated from geometry and true heading.
78 
79  // Calculated from runway polygon.
80  double width_ft;
81 
82  };
83 
85 
86  class DT_DLL_VRVOSG DtRunwayNode : public osg::Group
87  {
88  public:
89  DtRunwayNode(DtDe& de, DtRunwayData& runwayData);
90  ~DtRunwayNode();
91 
92  public:
95  };
96 
97  class DT_DLL_VRVOSG DtRunwayThresholdNode : public osg::Group
98  {
99  public:
100  DtRunwayThresholdNode(DtDe& de, DtRunwayThresholdData& runwayThresholdData);
102 
103  public:
106  };
107 
109  {
110  public:
112  static DtRunwaySignaler& instance(DtDe& de);
113 
115  virtual ~DtRunwaySignaler();
116 
117  boost::signal<void ( const std::string& ) > signal_AerodromeStartInitializing;
118  boost::signal<void ( const std::string& ) > signal_AerodromeCreated;
119 
120  boost::signal<void ( DtRunwayData& )> signal_RunwayCreated;
121  boost::signal<void ( DtRunwayData& )> signal_RunwayDestroyed;
122 
123  boost::signal<void ( DtRunwayThresholdData& )> signal_RunwayThresholdCreated;
124  boost::signal<void ( DtRunwayThresholdData& )> signal_RunwayThresholdDestroyed;
125 
126  protected:
128 
129  };
130 
132  {
133  public:
134 
135  typedef boost::unordered_map<std::string, DtRunwayThresholdData> DtRunwayThresholdDataMap;
136 
137  typedef boost::unordered_map<DtUniqueID, std::vector<DtSceneObject*> > DtSceneObjectsMap;
138  typedef boost::unordered_map<DtUniqueID, std::vector<DtOsgArticulatedModel*> > DtRunwayLightsMap;
139 
141  static DtRunwayMarkingManager& instance(DtDe& anIG);
142 
144  virtual ~DtRunwayMarkingManager();
145 
148  virtual void updateRunwayManager();
149 
150  virtual void slot_AerodromeCreated(const std::string& icao);
151  virtual void slot_AerodromeStartInitializing(const std::string& icao);
152 
153  virtual void slot_RunwayCreated(DtRunwayData& runwayData);
154  virtual void slot_RunwayDestroyed(DtRunwayData& runwayData);
155 
156  virtual void slot_RunwayThresholdCreated(DtRunwayThresholdData& runwayThreshold);
157  virtual void slot_RunwayThresholdDestroyed(DtRunwayThresholdData& runwayThreshold);
158 
159  virtual double runwayWidth(const std::vector<DtVector>& runwayPolygon) const;
160  virtual DtVector forwardVector(const std::vector<DtVector>& runwayPolygon) const;
161  virtual DtVector forwardVector(const DtVector& position, double heading) const;
162  virtual DtVector rightVector(const DtVector& position, double heading) const;
163 
164  public:
165 
166  boost::signal<void (const std::string&)> signal_AerodromeCreated;
167 
168  boost::signal<void (DtRunwayData&)> signal_RunwayCreated;
169  boost::signal<void (DtRunwayData&)> signal_RunwayDestroyed;
170 
171  boost::signal<void (DtRunwayThresholdData&)> signal_RunwayThresholdCreated;
172  boost::signal<void (DtRunwayThresholdData&)> signal_RunwayThresholdDestroyed;
173 
174  protected:
175 
177 
181 
185 
186  boost::unordered_map<DtUniqueID, DtSceneObject*> myRunwayMarkers;
188 
192 
193  typedef boost::unordered_map<std::string, std::string> ModelDefsByNameMap;
195 
196  protected:
197  static const char* RunwayLightMapFilename;
198 
199  protected:
200 
201  void addLightPtr(DtUniqueID runwayID, DtOsgArticulatedModel* lightModel);
202  void addSceneObjPtr(DtUniqueID runwayID, DtSceneObject* sceneObj);
203 
204  std::string runwayKey(const std::string& apt_icao, const std::string& runwayNum) const;
206  std::size_t hashRunwayData(const DtRunwayData& runwayData);
207 
208  void createAndPlaceCenterlineLighting(const DtRunwayData& runwayData);
209  // Touchdown zone lighting based on FAA AC 150/5340-30D sec 3.3 b.
210  // Touchdown zone lights consist of 2 rows of transverse light bars located symmetrically about
211  // the runway centerline per Figure 34. Each light bar consists of 3 unidirectional lights
212  // facing the landing threshold. The rows of light bars extend to 3,000 feet (900 m), or
213  // one-half the runway length for runways less than 6,000 feet (1 800 m), from the threshold
214  // with the first light bars located 100 feet (30 m) from the threshold.
215  void createAndPlaceTouchdownZone(const DtRunwayData& runwayData);
216  void createAndPlaceTouchdownZoneLightBar(const DtUniqueID runwayId, const DtVector& position, double heading);
217  void createAndPlaceEdgeLighting(const DtRunwayData& runwayData);
218  void createAndPlaceThresholdLighting(const DtRunwayData& runwayData);
219  void createAndPlaceApproachLighting(const DtRunwayThresholdData& runwayData);
220  void createAndPlaceREIL(const DtRunwayThresholdData& runwayData);
221  void createAndPlaceGroundLight(const std::string& modelDef, DtUniqueID runwayId, const DtVector& pos,
222  double zOffset = 0.0, double heading = 0.0);
223 
224  bool readModelDefsByNameFile(const std::string& path, const std::string& modelDefsFilename);
225 
226  private:
227 
228  DtVector geodeticToGeocentric(double lat, double lon, double alt) const;
229  DtVector geodeticToCig(const DtVector& geodPos) const;
230 
231  };
232 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)