VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtVrlinkConnection.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 <vrvCore/DtDriver.h>
14 
15 #include <vl/entityPublisher.h>
16 
17 #include <unordered_map>
18 #include <boost/function.hpp>
19 
21 class DtExerciseConn;
22 class DtStealthControlPdu;
23 
24 #ifndef DT_PROTOCOL_NAMESPACE
25 #error Namespace Protocol Macro DT_PROTOCOL_NAMESPACE not defined.
26 #endif
27 
28 #if DtHLA
29 #include <vl/geodeticRegion.h>
30 #endif
31 
32 namespace makVrv
33 {
34  class DtVrlinkDriver;
35 
36  namespace DT_PROTOCOL_NAMESPACE
37  {
39 
43  {
44  public:
45 
48  const DtCoordinateSystem& coordSystem,
49  const DtEntityAppearanceMapperFactoryCreator& appFactoryCreator,
50  DtSharedSettingsManager& settingsManager,
51  DtVrlinkDriver& driver);
52 
54  virtual ~DtVrlinkConnection();
55 
57  virtual void setExerciseConnInit(const DtExerciseConnInitializer& exConnInitializer);
58 
63  virtual bool connect();
64 
66  virtual bool connected() const;
67 
72  virtual bool disconnect();
73 
75  virtual void tick(double dt);
76 
78  virtual double simTime() const;
79 
81  virtual void setSimTime(double simTime);
82 
84  virtual double clockTime() const;
85 
87  virtual DtTimeStampType timeStampType() const;
88 
89 
91  virtual void setViewControlChanged( bool enabled );
92 
95  virtual void setUseTopoForFlatEarthVectorConversion( bool enabled );
96 
99  virtual void setConnectionFrameTime( double frameTime );
100 
103  virtual double connectionFrameTime() const;
104 
106  virtual void observerUpdated(const std::string& name,
107  double x, double y, double z,
108  double psi, double theta, double phi);
109 
112  virtual void observerUpdated(const std::string& observerName,
113  double x, double y, double z,
114  double psi, double theta, double phi,
115  double dx, double dy, double dz,
116  double dpsi, double dtheta, double dphi);
117 
119  virtual void stopPublishingObserver(const std::string& observerName);
120 
122  virtual void startPublishingObserver(const std::string& observerName);
123 
125  virtual void queueDriverFunction(boost::function<void()> func);
126 
130  virtual void queueConnectionFunction(boost::function<void()> func);
131 
134  virtual DtVrlinkDriver& vrlinkDriver();
135  virtual const DtVrlinkDriver& vrlinkDriver() const;
136 
138  inline DtExerciseConn* exerciseConn()
139  {
140  return myExerciseConnection;
141  }
142 
144  virtual const std::string& tag()
145  {
146 #ifdef DtDIS
147  const static std::string str("DIS");
148 #elif DtHLA_1516_EVOLVED
149  const static std::string str("HLA1516e");
150 #elif DtHLA_1516
151  const static std::string str("HLA1516");
152 #elif DtHLA
153  const static std::string str("HLA13");
154 #else
155  const static std::string str("");
156 #endif
157  return str;
158  }
159 
160 
161 #if DtHLA
162  inline const DtDDMRegionSet& regions() const
163  {
164  return myRegions;
165  }
166 
167  virtual void addDdmRegionForObserver(const std::string& observerName);
168 
169  virtual void removeDdmRegionForObserver(const std::string& observerName);
170 
172  virtual void setDdmRegionSize(int sizeInMeters);
173 
174  virtual void setRegionUpdateThreshold(int percentage);
175 
176  virtual void setUseAltitudeThreshold(bool yesNo);
177 
178  virtual void setAltitudeThreshold(int meters);
179 
180  virtual void updateDdmRegion(const std::string& observerName,
181  const DtVector& observerLocation);
182 
183  virtual void setRegionOutOfBounds(DtDDMRegionSP region);
184 
185  boost::signalslib::signal<void (DtDDMRegionSP)> signal_regionAdded;
186  boost::signalslib::signal<void (DtDDMRegionSP)> signal_regionToBeRemoved;
187 
188 #endif
189 
190 #if DtDIS
191  //Check to see if entity is published by this simulation.
192  bool entityIsPublished(const DtEntityIdentifier& id) const;
193 
195  virtual bool timeoutProcessing() const;
196 
198  virtual void setTimeoutProcessing(bool enabled);
199 
201  virtual double timeoutInterval() const;
202 
204  virtual void setTimeoutInterval(double interval);
205 #endif
206 
209  void setSupportsDelayedVisualizerCreation(bool);
210  bool supportsDelayedVisualizerCreation() const;
211 
216  boost::signalslib::signal<void()> signal_exerciseConnectionCreated;
217 
219  boost::signalslib::signal<void ()> signal_preTick;
220 
222  boost::signalslib::signal<void ()> signal_postTick;
223 
224  protected:
225 
227  void addObserverPublisher(const std::string& observerName);
228 
229  protected:
230 
231  typedef std::unordered_map<std::string, DtEntityPublisher*>
233 
234  //Exercise Connection settings.
236 
238 
239  //Active connection
240  DtExerciseConn* myExerciseConnection;
241 
242 #if DtHLA
243  bool initializeDdm();
244 
245  DtDDMRegionSet myRegions;
246 
247  struct RegionInfo
248  {
249  DtGeodeticRegionSP region;
252  };
253 
254  typedef std::unordered_map<std::string, RegionInfo> ObserverRegions;
260 #endif
261 
262 #if DtDIS
265 #endif
266 
267 
268  //Publishers for observers
274 
277  };
278  }
279 }
Creator for DtEntityAppearanceMapperFactory class.
Definition: DtEntityAppearanceMapperFactory.h:82
The shared settings manager, is the global object responsible for managing any shared settings object...
Definition: DtSharedSettingsManager.h:42
#define DL_DLL_IGCONVRLINK
Definition: dllExport.h:26
#define DT_PROTOCOL_NAMESPACE
Contains DLL export macros.
Definition: vrfDis.h:17
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
Contains makVrv:DtDriver class.
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
The abstract interface necessary for agents.
Definition: DtAgentManagerInterface.h:33

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)