VR-Forces 4.6.1 Class Documentation
 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) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/DtDriver.h>
13 #include <vrvVrl/DtConnection.h>
14 
15 #include <vl/entityPublisher.h>
16 
17 #include <boost/unordered_map.hpp>
18 
20 class DtExerciseConn;
21 class DtStealthControlPdu;
22 
23 #ifndef DT_PROTOCOL_NAMESPACE
24 #error Namespace Protocol Macro DT_PROTOCOL_NAMESPACE not defined.
25 #endif
26 
27 #if DtHLA
28 #include <vl/geodeticRegion.h>
29 #endif
30 
31 namespace makVrv
32 {
33  namespace DT_PROTOCOL_NAMESPACE
34  {
36 
40  {
41  public:
42 
45  const DtCoordinateSystem& coordSystem,
46  const DtEntityAppearanceMapperFactoryCreator& appFactoryCreator,
47  DtSharedSettingsManager& settingsManager);
48 
50  virtual ~DtVrlinkConnection();
51 
53  virtual void setExerciseConnInit(const DtExerciseConnInitializer& exConnInitializer);
54 
59  virtual bool connect();
60 
62  virtual bool connected() const;
63 
68  virtual bool disconnect();
69 
71  virtual void tick(double dt);
72 
74  virtual double simTime() const;
75 
77  virtual void setSimTime(double simTime);
78 
80  virtual double clockTime() const;
81 
83  virtual DtTimeStampType timeStampType() const;
84 
85 
87  virtual void setViewControlChanged( bool enabled );
88 
91  virtual void setUseTopoForFlatEarthVectorConversion( bool enabled );
92 
95  virtual void setConnectionFrameTime( double frameTime );
96 
99  virtual double connectionFrameTime() const;
100 
102  virtual void observerUpdated(const std::string& name,
103  double x, double y, double z,
104  double psi, double theta, double phi);
105 
106  virtual void observerUpdated(const std::string& observerName,
107  double x, double y, double z,
108  double psi, double theta, double phi,
109  double dx, double dy, double dz,
110  double dpsi, double dtheta, double dphi);
111 
113  virtual void stopPublishingObserver(const std::string& observerName);
114 
116  virtual void startPublishingObserver(const std::string& observerName);
117 
119  inline DtExerciseConn* exerciseConn()
120  {
121  return myExerciseConnection;
122  }
123 
125  virtual const std::string& tag()
126  {
127 #ifdef DtDIS
128  const static std::string str("DIS");
129 #elif DtHLA_1516_EVOLVED
130  const static std::string str("HLA1516e");
131 #elif DtHLA_1516
132  const static std::string str("HLA1516");
133 #elif DtHLA
134  const static std::string str("HLA13");
135 #else
136  const static std::string str("");
137 #endif
138  return str;
139  }
140 
141 
142 #if DtHLA
143  inline const DtDDMRegionSet& regions() const
144  {
145  return myRegions;
146  }
147 
148  virtual void addDdmRegionForObserver(const std::string& observerName);
149 
150  virtual void removeDdmRegionForObserver(const std::string& observerName);
151 
153  virtual void setDdmRegionSize(int sizeInMeters);
154 
155  virtual void setRegionUpdateThreshold(int percentage);
156 
157  virtual void setUseAltitudeThreshold(bool yesNo);
158 
159  virtual void setAltitudeThreshold(int meters);
160 
161  virtual void updateDdmRegion(const std::string& observerName,
162  const DtVector& observerLocation);
163 
164  virtual void setRegionOutOfBounds(DtDDMRegionSP region);
165 
166  boost::signal<void (DtDDMRegionSP)> signal_regionAdded;
167  boost::signal<void (DtDDMRegionSP)> signal_regionToBeRemoved;
168 
169 #endif
170 
171 #if DtDIS
172  //Check to see if entity is published by this simulation.
173  bool entityIsPublished(const DtEntityIdentifier& id) const;
174 
176  virtual bool timeoutProcessing() const;
177 
179  virtual void setTimeoutProcessing(bool enabled);
180 
182  virtual double timeoutInterval() const;
183 
185  virtual void setTimeoutInterval(double interval);
186 #endif
187 
190  void setSupportsDelayedVisualizerCreation(bool);
191  bool supportsDelayedVisualizerCreation() const;
192 
193  // Signal sent before the tick starts
194  boost::signal<void ()> signal_preTick;
195 
196  // Signal sent after the tick has been completed
197  boost::signal<void ()> signal_postTick;
198 
199  protected:
200 
202  void addObserverPublisher(const std::string& observerName);
203 
204  protected:
205 
206  typedef boost::unordered_map<std::string, DtEntityPublisher*>
208 
209  //Exercise Connection settings.
211 
213 
214  //Active connection
215  DtExerciseConn* myExerciseConnection;
216 
217 #if DtHLA
218  bool initializeDdm();
219 
220  DtDDMRegionSet myRegions;
221 
222  struct RegionInfo
223  {
224  DtGeodeticRegionSP region;
227  };
228 
229  typedef boost::unordered_map<std::string, RegionInfo> ObserverRegions;
235 #endif
236 
237 #if DtDIS
240 #endif
241 
242 
243  //Publishers for observers
249 
251  };
252  }
253 }

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)