VR-Forces 4.5 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 
82  virtual void setConnectionFrameTime( double frameTime );
83 
86  virtual double connectionFrameTime() const;
87 
89  virtual void observerUpdated(const std::string& name,
90  double x, double y, double z,
91  double psi, double theta, double phi);
92 
93  virtual void observerUpdated(const std::string& observerName,
94  double x, double y, double z,
95  double psi, double theta, double phi,
96  double dx, double dy, double dz,
97  double dpsi, double dtheta, double dphi);
98 
100  virtual void stopPublishingObserver(const std::string& observerName);
101 
103  virtual void startPublishingObserver(const std::string& observerName);
104 
106  virtual void attachObserverObject(const std::string& observerName, DtUniqueID id);
107 
109  virtual void detachObjects(const std::string& observerName);
110 
112  inline DtExerciseConn* exerciseConn()
113  {
114  return myExerciseConnection;
115  }
116 
118  virtual const std::string& tag()
119  {
120 #ifdef DtDIS
121  const static std::string str("DIS");
122 #elif DtHLA_1516_EVOLVED
123  const static std::string str("HLA1516e");
124 #elif DtHLA_1516
125  const static std::string str("HLA1516");
126 #elif DtHLA
127  const static std::string str("HLA13");
128 #else
129  const static std::string str("");
130 #endif
131  return str;
132  }
133 
134 
135 #if DtHLA
136  inline const DtDDMRegionSet& regions() const
137  {
138  return myRegions;
139  }
140 
141  virtual void addDdmRegionForObserver(const std::string& observerName);
142 
143  virtual void removeDdmRegionForObserver(const std::string& observerName);
144 
146  virtual void setDdmRegionSize(int sizeInMeters);
147 
148  virtual void setRegionUpdateThreshold(int percentage);
149 
150  virtual void setUseAltitudeThreshold(bool yesNo);
151 
152  virtual void setAltitudeThreshold(int meters);
153 
154  virtual void updateDdmRegion(const std::string& observerName,
155  const DtVector& observerLocation);
156 
157  virtual void setRegionOutOfBounds(DtDDMRegionSP region);
158 
159  boost::signal<void (DtDDMRegionSP)> signal_regionAdded;
160  boost::signal<void (DtDDMRegionSP)> signal_regionToBeRemoved;
161 
162 #endif
163 
164 #if DtDIS
165  //Check to see if entity is published by this simulation.
166  bool entityIsPublished(const DtEntityIdentifier& id) const;
167 
169  virtual bool timeoutProcessing() const;
170 
172  virtual void setTimeoutProcessing(bool enabled);
173 
175  virtual double timeoutInterval() const;
176 
178  virtual void setTimeoutInterval(double interval);
179 #endif
180 
183  void setSupportsDelayedVisualizerCreation(bool);
184  bool supportsDelayedVisualizerCreation() const;
185 
186  // Signal sent before the tick starts
187  boost::signal<void ()> signal_preTick;
188 
189  // Signal sent after the tick has been completed
190  boost::signal<void ()> signal_postTick;
191 
192  protected:
193 
195  void addObserverPublisher(const std::string& observerName);
196 
197  protected:
198 
199  typedef boost::unordered_map<std::string, DtEntityPublisher*>
201 
202  //Exercise Connection settings.
204 
206 
207  //Active connection
208  DtExerciseConn* myExerciseConnection;
209 
210 #if DtHLA
211  bool initializeDdm();
212 
213  DtDDMRegionSet myRegions;
214 
215  struct RegionInfo
216  {
217  DtGeodeticRegionSP region;
220  };
221 
222  typedef boost::unordered_map<std::string, RegionInfo> ObserverRegions;
228 #endif
229 
230 #if DtDIS
233 #endif
234 
235 
236  //Publishers for observers
242 
244  };
245  }
246 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)