VR-Forces Development_Version 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_AerodromeCreated;
118 
119  boost::signal<void ( DtRunwayData& )> signal_RunwayCreated;
120  boost::signal<void ( DtRunwayData& )> signal_RunwayDestroyed;
121 
122  boost::signal<void ( DtRunwayThresholdData& )> signal_RunwayThresholdCreated;
123  boost::signal<void ( DtRunwayThresholdData& )> signal_RunwayThresholdDestroyed;
124 
125  protected:
127 
128  };
129 
131  {
132  public:
133 
134  typedef boost::unordered_map<std::string, DtRunwayThresholdData> DtRunwayThresholdDataMap;
135 
136  typedef boost::unordered_map<DtUniqueID, std::vector<DtSceneObject*> > DtSceneObjectsMap;
137  typedef boost::unordered_map<DtUniqueID, std::vector<DtOsgArticulatedModel*> > DtRunwayLightsMap;
138 
140  static DtRunwayMarkingManager& instance(DtDe& anIG);
141 
143  virtual ~DtRunwayMarkingManager();
144 
147  virtual void updateRunwayManager();
148 
149  virtual void slot_AerodromeCreated(const std::string& icao);
150 
151  virtual void slot_RunwayCreated(DtRunwayData& runwayData);
152  virtual void slot_RunwayDestroyed(DtRunwayData& runwayData);
153 
154  virtual void slot_RunwayThresholdCreated(DtRunwayThresholdData& runwayThreshold);
155  virtual void slot_RunwayThresholdDestroyed(DtRunwayThresholdData& runwayThreshold);
156 
157  virtual double runwayWidth(const std::vector<DtVector>& runwayPolygon) const;
158  virtual DtVector forwardVector(const std::vector<DtVector>& runwayPolygon) const;
159  virtual DtVector forwardVector(const DtVector& position, double heading) const;
160  virtual DtVector rightVector(const DtVector& position, double heading) const;
161 
162  public:
163 
164  boost::signal<void (const std::string&)> signal_AerodromeCreated;
165 
166  boost::signal<void (DtRunwayData&)> signal_RunwayCreated;
167  boost::signal<void (DtRunwayData&)> signal_RunwayDestroyed;
168 
169  boost::signal<void (DtRunwayThresholdData&)> signal_RunwayThresholdCreated;
170  boost::signal<void (DtRunwayThresholdData&)> signal_RunwayThresholdDestroyed;
171 
172  protected:
173 
175 
179 
183 
184  boost::unordered_map<DtUniqueID, DtSceneObject*> myRunwayMarkers;
186 
189 
190 
191 
192  void addLightPtr(DtUniqueID runwayID, DtOsgArticulatedModel* lightModel);
193  void addSceneObjPtr(DtUniqueID runwayID, DtSceneObject* sceneObj);
194 
195  std::string runwayKey(const std::string& apt_icao, const std::string& runwayNum) const;
197  std::size_t hashRunwayData(const DtRunwayData& runwayData);
198 
199  void createAndPlaceCenterlineLighting(const DtRunwayData& runwayData);
200  // Touchdown zone lighting based on FAA AC 150/5340-30D sec 3.3 b.
201  // Touchdown zone lights consist of 2 rows of transverse light bars located symmetrically about
202  // the runway centerline per Figure 34. Each light bar consists of 3 unidirectional lights
203  // facing the landing threshold. The rows of light bars extend to 3,000 feet (900 m), or
204  // one-half the runway length for runways less than 6,000 feet (1 800 m), from the threshold
205  // with the first light bars located 100 feet (30 m) from the threshold.
206  void createAndPlaceTouchdownZone(const DtRunwayData& runwayData);
207  void createAndPlaceTouchdownZoneLightBar(const DtUniqueID runwayId, const DtVector& position, double heading);
208  void createAndPlaceEdgeLighting(const DtRunwayData& runwayData);
209  void createAndPlaceThresholdLighting(const DtRunwayData& runwayData);
210  void createAndPlaceApproachLighting(const DtRunwayThresholdData& runwayData);
211  void createAndPlaceREIL(const DtRunwayThresholdData& runwayData);
212  void createAndPlaceGroundLight(std::string modelDef, DtUniqueID runwayId, const DtVector& pos,
213  double zOffset = 0.0, double heading = 0.0);
214 
215  private:
216 
217  DtVector geodeticToGeocentric(double lat, double lon, double alt) const;
218  DtVector geodeticToCig(const DtVector& geodPos) const;
219 
220  };
221 }

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)