VR-Forces 4.3 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>
17 
18 #include <boost/unordered_map.hpp>
19 
20 class DtExerciseConnInitializer;
21 class DtExerciseConn;
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  namespace DT_PROTOCOL_NAMESPACE
35  {
37 
41  {
42  public:
43 
46  const DtCoordinateSystem& coordSystem,
47  const DtEntityAppearanceMapperFactoryCreator& appFactoryCreator,
48  DtSharedSettingsManager& settingsManager);
49 
51  virtual ~DtVrlinkConnection();
52 
54  virtual void setExerciseConnInit(const DtExerciseConnInitializer& exConnInitializer);
55 
60  virtual bool connect();
61 
63  virtual bool connected() const;
64 
69  virtual bool disconnect();
70 
72  virtual void tick();
73 
75  virtual void setViewControlChanged( bool enabled );
76 
79  virtual void setUseTopoForFlatEarthVectorConversion( bool enabled );
80 
82  virtual void observerUpdated(const std::string& name,
83  double x, double y, double z,
84  double psi, double theta, double phi);
85 
86  virtual void observerUpdated(const std::string& observerName,
87  double x, double y, double z,
88  double psi, double theta, double phi,
89  double dx, double dy, double dz,
90  double dpsi, double dtheta, double dphi);
91 
93  virtual void stopPublishingObserver(const std::string& observerName);
94 
96  virtual void startPublishingObserver(const std::string& observerName);
97 
99  virtual void attachObserverObject(const std::string& observerName, DtUniqueID id);
100 
102  virtual void detachObjects(const std::string& observerName);
103 
105  inline DtExerciseConn* exerciseConn()
106  {
107  return myExerciseConnection;
108  }
109 
111  virtual const std::string& tag()
112  {
113 #ifdef DtDIS
114  const static std::string str("DIS");
115 #elif DtHLA_1516_EVOLVED
116  const static std::string str("HLA1516e");
117 #elif DtHLA_1516
118  const static std::string str("HLA1516");
119 #elif DtHLA
120  const static std::string str("HLA13");
121 #else
122  const static std::string str("");
123 #endif
124  return str;
125  }
126 
127 
128 #if DtHLA
129  inline const DtDDMRegionSet& regions() const
130  {
131  return myRegions;
132  }
133 
134  virtual void addDdmRegionForObserver(const std::string& observerName);
135 
136  virtual void removeDdmRegionForObserver(const std::string& observerName);
137 
139  virtual void setDdmRegionSize(int sizeInMeters);
140 
141  virtual void setRegionUpdateThreshold(int percentage);
142 
143  virtual void setUseAltitudeThreshold(bool yesNo);
144 
145  virtual void setAltitudeThreshold(int meters);
146 
147  virtual void updateDdmRegion(const std::string& observerName,
148  const DtVector& observerLocation);
149 
150  virtual void setRegionOutOfBounds(DtDDMRegionSP region);
151 
152  boost::signal<void (DtDDMRegionSP)> signal_regionAdded;
153  boost::signal<void (DtDDMRegionSP)> signal_regionToBeRemoved;
154 
155 #endif
156 
157 #if DtDIS
158  //Check to see if entity is published by this simulation.
159  bool entityIsPublished(const DtEntityIdentifier& id) const;
160 
162  virtual bool timeoutProcessing() const;
163 
165  virtual void setTimeoutProcessing(bool enabled);
166 
168  virtual double timeoutInterval() const;
169 
171  virtual void setTimeoutInterval(double interval);
172 #endif
173 
176  void setSupportsDelayedVisualizerCreation(bool);
177  bool supportsDelayedVisualizerCreation() const;
178 
179  // Signal sent before the tick starts
180  boost::signal<void ()> signal_preTick;
181 
182  // Signal sent after the tick has been completed
183  boost::signal<void ()> signal_postTick;
184 
185  protected:
186 
188  void addObserverPublisher(const std::string& observerName);
189 
190  protected:
191 
192  typedef boost::unordered_map<std::string, DtEntityPublisher*>
194 
195  //Exercise Connection settings.
196  DtExerciseConnInitializer* myExConnInitializer;
197 
199 
200  //Active connection
201  DtExerciseConn* myExerciseConnection;
202 
203 #if DtHLA
204  bool initializeDdm();
205 
206  DtDDMRegionSet myRegions;
207 
208  struct RegionInfo
209  {
210  DtGeodeticRegionSP region;
213  };
214 
215  typedef boost::unordered_map<std::string, RegionInfo> ObserverRegions;
221 #endif
222 
223 #if DtDIS
226 #endif
227 
228 
229  //Publishers for observers
234 
236  };
237  }
238 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)