VR-Forces 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) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCore/vrvCore.h>
12 #include <vrvCore/DtDe.h>
14 #include <vrvCore/DtUniqueID.h>
15 #include <vrvCore/DtRunwayData.h>
16 #include <vrvCore/DtRunwayStatus.h>
17 
20 
21 
22 
23 #include <matrix/vlVector.h>
24 
25 #include <unordered_map>
26 
27 #include <string>
28 
29 namespace makVrv
30 {
31  class DtRunwaySelector;
32  enum class DtRunwayLightsEnum : unsigned int;
33  enum class DtAerodromeLightsEnum : unsigned int;
34 
43  {
44  public:
47 
49  DtRunwayMarkingManager() = delete;
50 
52  DtRunwayMarkingManager(const DtRunwayMarkingManager& orig) = delete;
53 
55  DtRunwayMarkingManager& operator=(const DtRunwayMarkingManager& orig) = delete;
56 
58  virtual ~DtRunwayMarkingManager();
59 
61  virtual DtRunwaySelector* findRunwaySelector(DtElementID id);
62 
66  virtual DtRunwayData runwayData(const std::string& key) const = 0;
67 
70  virtual void updateRunwayManager(const float budget) = 0;
71 
72  //{@ \name Light Group Name Generation
74  virtual std::string createLightGroupName(const std::string& airportName, const std::string& runwayName, DtRunwayLightsEnum lightType) const;
75  virtual std::string createLightGroupName(const std::string& airportName, DtAerodromeLightsEnum lightType) const;
76  virtual std::string createLightGroupName(const std::string& airportName, const std::string& runwayName, const std::string& lightName) const;
77  virtual std::string createLightGroupName(const std::string& airportName, const std::string& runway1Name, const std::string& runway2Name, const std::string& lightName) const;
79 
80  public:
82  static DtRunwayMarkingManager& instance(DtDe& de);
83 
86  static void registerInstance(DtDe& de, DtRunwayMarkingManager* anInstance);
87 
91  static std::string generateLightGroupName(const std::string& airportName, const std::string& runwayName, const std::string& lightSubGroup);
92 
93  protected:
95  virtual void cleanup();
96 
98  virtual std::string runwayKey(const std::string& apt_icao, const std::string& runwayNum) const;
99 
101  virtual std::size_t hashRunwayData(const DtRunwayData& runwayData) const;
102 
104  virtual void createAndPlaceRunwaySelector(const DtRunwayData& runwayData);
105 
108  virtual void slot_runwayConditionChanged(DtUniqueID runwayId, const std::string& airportCode, const std::string& runwayName, DtRunwayCondition condition);
109 
112  virtual void slot_runwayDamageStateChanged(DtUniqueID runwayId, const std::string& airportCode, const std::string& runwayName, bool damaged);
113 
116  virtual void slot_runwayArrestorStateChanged(DtUniqueID runwayId, unsigned int runwayIndex, const std::string& airportCode, const std::string& runwayName, bool arrestorsUp);
117 
120  virtual void slot_runwayActiveStateChanged(DtUniqueID runwayId, unsigned int runwayIndex, const std::string& airportCode, const std::string& runwayName, bool isActive);
121 
122  protected:
124 
125  // *** Two ways to find a selector:
126  //
127  // Map of element ID to runway selectors. Note that this DtElementID is unrelated to the
128  // DtUniqueID used by the aerodrome status mgr.
129  std::unordered_map<DtElementID, DtRunwaySelector*> myRunwaySelectors;
130 
131  // Given a logical runway key, find the selector's DtElementID (which we can then look up in myRunwaySelectors
132  std::unordered_map<std::string, DtElementID> myLogicalKeyToSelectorIdMap;
133 
134 
135  // The std::string key is a logicalRunwayKey. This lets us find the aerodrome status mgr
136  // key to myRunwayStatusMap for the status of the physical runway this logical runway is part of
137  std::unordered_map<std::string, DtUniqueID> myLogicalPhysicalRunwayMap;
138 
139  // The key is the aerodrome status manager id created fpr the physical runway. So
140  // this maps from the id to the physical status (which will come from the aerodrome status mgr
141  std::unordered_map<DtUniqueID, DtRunwayStatus> myRunwayStatusMap;
142 
143  // Map of runway hashes to selectors. This is used to ensure a single selector for
144  // a physical runway
145  std::unordered_map<std::size_t, DtRunwaySelector*> myRunwaySelectorsCreated;
146 
148  };
149 }
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
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
std::unordered_map< DtElementID, DtRunwaySelector * > myRunwaySelectors
Definition: DtRunwayMarkingManager.h:129
Contains makVrv::DtRunwayStatus class.
std::unordered_map< std::string, DtUniqueID > myLogicalPhysicalRunwayMap
Definition: DtRunwayMarkingManager.h:137
Contains makVrv::DtDe class.
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
DtRunwayLightsEnum
Enumeration for light types placed on runways. Note that all are associated with logical runways exce...
Definition: DtLightGroupNameManager.h:22
std::unordered_map< std::size_t, DtRunwaySelector * > myRunwaySelectorsCreated
Definition: DtRunwayMarkingManager.h:145
Contains makVrv::DtVirtualBaseClass class.
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
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< std::string, DtElementID > myLogicalKeyToSelectorIdMap
Definition: DtRunwayMarkingManager.h:132
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
DtSignalConnectionManager myConnections
Definition: DtRunwayMarkingManager.h:147
DtRunwaySelector objects create a selectable runway that outlines a paged-in runway and an associated...
Definition: DtRunwaySelector.h:43
Contains makVrv::DtRunwayData class.
Base class to provide boost signal/slot management.
DtDe & myDe
Definition: DtRunwayMarkingManager.h:123
DtRunwayCondition
Definition: DtAerodromeStatusManager.h:30
Contains makVrv::DtUniqueID type.
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
std::unordered_map< DtUniqueID, DtRunwayStatus > myRunwayStatusMap
Definition: DtRunwayMarkingManager.h:141
Contains DLL export macros.

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)