VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtEnvironmentProcessor.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 
12 #include <vrvVrl/vrvVrl.h>
13 
14 #ifndef DT_PROTOCOL_NAMESPACE
15 #error Namespace Protocol Macro DT_PROTOCOL_NAMESPACE not defined.
16 #endif
17 
19 
22 
23 #include <vrvCore/DtUniqueID.h>
24 
25 #include <unordered_map>
26 
27 class DtVrlUuid;
28 class DtReflectedObject;
29 class DtEnvironmentConditionStateRepository;
30 
31 namespace makVrv
32 {
33  class DtEnvironmentStatusManager;
34 
35  namespace DT_PROTOCOL_NAMESPACE
36  {
37  class DtVrlinkConnection;
38  class DtCustomReflectedEnvironmentListCreator;
39 
40 
58  {
59  public:
62 
64  virtual ~DtEnvironmentProcessor();
65 
67  DtEnvironmentProcessor() = delete;
68 
71 
73  DtEnvironmentProcessor& operator=(const DtEnvironmentProcessor&) = delete;
74 
75  public:
78  static void registerInstance(DtVrlinkConnection& conn, DtEnvironmentProcessor* instance);
79 
81  static DtEnvironmentProcessor* findInstance(DtVrlinkConnection& conn);
82 
83  public:
85  // Returns false if the UUID is not found.
86  virtual bool getWeatherAreaIdFromMetocWeatherAreaUuid(const DtVrlUuid& uuid, DtUniqueID& vrvWeatherAreaId);
87 
91  virtual bool getVrvIdFromMetocUuid(const DtVrlUuid& weatherObjectUuid, DtUniqueID& envObjectId);
92 
95  virtual void onEnvironmentObjectDiscovered(DtEnvironmentConditionStateRepository* interceptor);
96 
98  virtual void onEnvironmentObjectToBeDestroyed(const DtEnvironmentConditionStateRepository* repository);
99 
102  virtual DtVrlinkReflectedTroposphereLayerList* findReflectedTroposphereLayerList();
103  virtual DtVrlinkReflectedLandSurfaceList* findReflectedLandSurfaceList();
104  virtual DtVrlinkReflectedWaterSurfaceList* findReflectedWaterSurfaceList();
105  virtual DtVrlinkReflectedSubsurfaceLayerList* findReflectedSubsurfaceLayerList();
107 
108  protected:
110  void startListening();
111 
113  void stopListening();
114 
115 #if DtHLA
116  virtual void addDdmRegion(DtDDMRegionSP regionToAdd);
118 
120  virtual void removeDdmRegion(DtDDMRegionSP regionToRemove);
121 #endif
122 
124  static bool discoverFunction(DtReflectedObject* refObj, void* usr);
125 
129  virtual bool discover(DtReflectedObject* refObj);
130 
142  // (Note, DtEnvironmentConditionStateRepository* should be const but isn't due to VR-Link issue)
143  virtual bool determineWeatherAreaId(DtEnvironmentConditionStateRepository* repository, DtUniqueID& weatherAreaId);
144 
146  virtual bool getExistingWeatherAreaFromGeoReference(const DtGeoReferenceVariant& geoRef, DtUniqueID& weatherAreaId) const;
147 
150  virtual DtUniqueID newWeatherAreaFromGeoReference(const DtGeoReferenceVariant& geoRef);
151 
152  protected:
153 
157 
160 
163 
166 
169 
170  //
171  // ID Spaces
172  // VR-Link will provide a DtUuid for each env object it conveys. When MAK extensions
173  // are used, a DtUuid will also be provided for weather areas. Since weather areas can
174  // contain separate layers there may be multiple env object DtUuids associated with a weather
175  // area id.
176  // VR-Vantage assigns DtUniqueIDs (the ids used throughout VRV) to both env object DtUUids and
177  // to weather area DtUuids when provided. When MAK extensions are NOT in use, a DtUniqueID is
178  // still generated for each weather area, but there is no associated DtUuid from VR-Link.
179 
180  // type used for associating DtUuids (in string form) with VRV DtUniqueIDs (may be unique env object
181  // identifiers, which are also used for layer ids for topo layer objects) or weather area ids.
182  typedef std::unordered_map<std::string, DtUniqueID> VrlUuidToVrvIdMap;
183 
184  // map of metoc uuids (id for the env object itself) to the DtUniqueID assigned by VRV. This VRV
185  // DtUniqueID is used to verify that a discovered object is new, and is used as a LAYER ID
186  // for troposphere layer env objects
188 
189  // Map of MAK-extension weather area uuids to VRV weather area ids
191 
192  // Associate the (potentially multiple) VRV DtUniqueIDs assigned to env objects with VRV weather area ids
193  typedef std::unordered_multimap<DtUniqueID, DtUniqueID> WeatherAreaIdToVrvIdMap;
195 
196  // Map of known geoReference when not using mak extensions, keyed by VRV weather area ids assigned to them
197  std::unordered_map<DtUniqueID, DtGeoReferenceVariant*> myNonMakWeatherAreaMap;
198  };
199 
200 
201  } // protocol namespace
202 } // makVRV namespace
203 
Abstract Custom Reflected Environmnent list creator. This provides an interface for the DtCustomRefle...
Definition: DtCustomReflectedEnvironmentList.h:99
DtCustomReflectedEnvironmentListCreator * myReflectedSubsurfaceLayerListCreator
Definition: DtEnvironmentProcessor.h:167
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
DtVrlinkReflectedWaterSurfaceList * myReflectedWaterSurfaceList
Definition: DtEnvironmentProcessor.h:162
DtVrlinkReflectedSubsurfaceLayerList * myReflectedSubsurfaceLayerList
Definition: DtEnvironmentProcessor.h:168
DtCustomReflectedEnvironmentList is a templated class used to extend the VR-Link environment reflecte...
Definition: DtCustomReflectedEnvironmentList.h:57
VrlUuidToVrvIdMap myMetocWeatherAreaUuidToWeatherAreaIdMap
Definition: DtEnvironmentProcessor.h:190
#define DL_DLL_IGCONVRLINK
Definition: dllExport.h:26
std::unordered_multimap< DtUniqueID, DtUniqueID > WeatherAreaIdToVrvIdMap
Definition: DtEnvironmentProcessor.h:193
#define DT_PROTOCOL_NAMESPACE
Contains DLL export macros.
Definition: vrfDis.h:17
Contains makVrv::DtVirtualBaseClass class.
DtCustomReflectedEnvironmentListCreator * myReflectedTroposphereLayerListCreator
Definition: DtEnvironmentProcessor.h:158
std::unordered_map< std::string, DtUniqueID > VrlUuidToVrvIdMap
Definition: DtEnvironmentProcessor.h:182
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
WeatherAreaIdToVrvIdMap myWeatherAreaIdToVrvIdMap
Definition: DtEnvironmentProcessor.h:194
DtVrlinkConnection & myConnection
Definition: DtEnvironmentProcessor.h:154
DtVrlinkReflectedLandSurfaceList * myReflectedLandSurfaceList
Definition: DtEnvironmentProcessor.h:165
DtEnvironmentProcessor manages environment data for a VR-Link connection that is transmitted through ...
Definition: DtEnvironmentProcessor.h:57
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
DtSignalConnectionManager myConnections
Definition: DtEnvironmentProcessor.h:155
Base class to provide boost signal/slot management.
Contains makVrv::DtCustomReflectedEnvironmentList class.
VrlUuidToVrvIdMap myMetocUuidToVrvIdMap
Definition: DtEnvironmentProcessor.h:187
DtEnvironmentStatusManager & myEnvironmentStatusManager
Definition: DtEnvironmentProcessor.h:156
Contains makVrv::DtUniqueID type.
DtVrlinkReflectedTroposphereLayerList * myReflectedTroposphereLayerList
Definition: DtEnvironmentProcessor.h:159
std::unordered_map< DtUniqueID, DtGeoReferenceVariant * > myNonMakWeatherAreaMap
Definition: DtEnvironmentProcessor.h:197
Contains DLL export macros.
DtEnvironmentStatusManager manages all of the environment-related data (including date and time) that...
Definition: DtEnvironmentStatusManager.h:50
DtCustomReflectedEnvironmentListCreator * myReflectedWaterSurfaceListCreator
Definition: DtEnvironmentProcessor.h:161
DtCustomReflectedEnvironmentListCreator * myReflectedLandSurfaceListCreator
Definition: DtEnvironmentProcessor.h:164

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)