VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtVrlinkConnection.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 
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;
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();
72 
74  virtual void setViewControlChanged( bool enabled );
75 
78  virtual void setUseTopoForFlatEarthVectorConversion( bool enabled );
79 
81  virtual void observerUpdated(const std::string& name,
82  double x, double y, double z,
83  double psi, double theta, double phi);
84 
85  virtual void observerUpdated(const std::string& observerName,
86  double x, double y, double z,
87  double psi, double theta, double phi,
88  double dx, double dy, double dz,
89  double dpsi, double dtheta, double dphi);
90 
92  virtual void stopPublishingObserver(const std::string& observerName);
93 
95  virtual void startPublishingObserver(const std::string& observerName);
96 
98  virtual void attachObserverObject(const std::string& observerName, DtUniqueID id);
99 
101  virtual void detachObjects(const std::string& observerName);
102 
104  inline DtExerciseConn* exerciseConn()
105  {
106  return myExerciseConnection;
107  }
108 
110  virtual const std::string& tag()
111  {
112 #ifdef DtDIS
113  const static std::string str("DIS");
114 #elif DtHLA_1516_EVOLVED
115  const static std::string str("HLA1516e");
116 #elif DtHLA_1516
117  const static std::string str("HLA1516");
118 #elif DtHLA
119  const static std::string str("HLA13");
120 #else
121  const static std::string str("");
122 #endif
123  return str;
124  }
125 
126 
127 #if DtHLA
128  inline const DtDDMRegionSet& regions() const
129  {
130  return myRegions;
131  }
132 
133  virtual void addDdmRegionForObserver(const std::string& observerName);
134 
135  virtual void removeDdmRegionForObserver(const std::string& observerName);
136 
138  virtual void setDdmRegionSize(int sizeInMeters);
139 
140  virtual void setRegionUpdateThreshold(int percentage);
141 
142  virtual void setUseAltitudeThreshold(bool yesNo);
143 
144  virtual void setAltitudeThreshold(int meters);
145 
146  virtual void updateDdmRegion(const std::string& observerName,
147  const DtVector& observerLocation);
148 
149  virtual void setRegionOutOfBounds(DtDDMRegionSP region);
150 
151  boost::signal<void (DtDDMRegionSP)> signal_regionAdded;
152  boost::signal<void (DtDDMRegionSP)> signal_regionToBeRemoved;
153 
154 #endif
155 
156 #if DtDIS
157  //Check to see if entity is published by this simulation.
158  bool entityIsPublished(const DtEntityIdentifier& id) const;
159 
161  virtual bool timeoutProcessing() const;
162 
164  virtual void setTimeoutProcessing(bool enabled);
165 
167  virtual double timeoutInterval() const;
168 
170  virtual void setTimeoutInterval(double interval);
171 #endif
172 
175  void setSupportsDelayedVisualizerCreation(bool);
176  bool supportsDelayedVisualizerCreation() const;
177 
178  // Signal sent before the tick starts
179  boost::signal<void ()> signal_preTick;
180 
181  // Signal sent after the tick has been completed
182  boost::signal<void ()> signal_postTick;
183 
184  protected:
185 
187  void addObserverPublisher(const std::string& observerName);
188 
189  protected:
190 
191  typedef boost::unordered_map<std::string, DtEntityPublisher*>
193 
194  //Exercise Connection settings.
196 
198 
199  //Active connection
200  DtExerciseConn* myExerciseConnection;
201 
202 #if DtHLA
203  bool initializeDdm();
204 
205  DtDDMRegionSet myRegions;
206 
207  struct RegionInfo
208  {
209  DtGeodeticRegionSP region;
212  };
213 
214  typedef boost::unordered_map<std::string, RegionInfo> ObserverRegions;
220 #endif
221 
222 #if DtDIS
225 #endif
226 
227 
228  //Publishers for observers
233 
235  };
236  }
237 }

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)