VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtVrlinkDriver.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvVrl/vrvVrl.h>
13 #include <vrvCore/DtDriver.h>
17 #include <vlutil/vlThread.h>
18 
19 #include <vlutil/vlRunnable.h>
20 
21 #include <vrvUtil/signalslib.h>
22 
23 #include <boost/bind/bind.hpp>
24 
25 #include <vector>
26 
27 class DtThread;
28 class DtEntityType;
30 class DtExerciseConnConfig;
31 
32 namespace makVrv
33 {
34  class DtAsynchronousEventQueue;
35  class DtAsynchronousAgentManager;
36  class DtVrlinkBaseConnection;
37  class DtEntityTypeMapper;
38  class DtObserver;
39  class DtSelectionManager;
40  class DtMouseState;
41  class DtColorValue;
42 
46  protected DtRunnable
47  {
48  public:
65  static const std::string theExConnConfigFileCount;
66 
82  static const std::string theExConnConfigFile;
83 
84  public:
85 
87  DtVrlinkDriver(DtAgentManager& agentManager,
88  const std::string& uniqueName, const std::string& className);
89 
91  virtual ~DtVrlinkDriver();
92 
94  virtual const std::string& className() const;
95 
97  virtual bool observersPublished() const;
98 
100  virtual void setObserversPublished(bool isPublished);
101 
104  virtual bool overrideGlobalViewControl() const;
105 
108  virtual void setOverrideGlobalViewControl(bool enabled);
109 
113  virtual bool viewControlEnabled() const;
114 
117  virtual void setLocalViewControlEnabled(bool enabled);
118 
121  virtual bool localViewControlEnabled() const;
122 
125  virtual void setConnectionFrameTime( double frameTime );
126 
129  virtual double connectionFrameTime() const;
130 
137  void setUseTopoForFlatEarthVectorConversion( bool flag );
138  bool useTopoForFlatEarthVectorConversion() const;
139 
141  virtual void queueDriverFunction(const std::function<void ()>& function);
142 
144  virtual void queueConnectionFunction(const std::function<void ()>& function);
145 
147  bool useThreadFlag() const
148  {
149  return myUseThreadFlag;
150  }
151 
153  {
154  return myConnection;
155  }
156 
158  boost::signalslib::signal<void (DtVrlinkBaseConnection*)> signal_connectionCreated;
159 
161  boost::signalslib::signal<void (DtVrlinkBaseConnection*)> signal_connectionAboutToBeDestroyed;
162 
165  {
166  return *myLocalExConnInitializer;
167  }
168 
171  {
172  return *myLocalExConnInitializer;
173  }
174  protected:
175 
177  virtual DtVrlinkBaseConnection* createConnection() = 0;
178 
181  virtual bool onStart();
182 
185  virtual bool onStop();
186 
188  virtual void run();
189 
191  void startPublishingObservers();
192 
194  void stopPublishingObservers();
195 
198  virtual bool onTick();
199 
202  void startThread();
203 
206  void stopThread();
207 
209  void setConnectionState( bool state );
210 
212  virtual void slot_displayEngineAdded( const DtDeRecord& igRecord );
213 
215  virtual void slot_globalViewControlEnabledSet( bool );
216 
218 
220  virtual void connectToDynamicSignals();
221 
224  virtual void disconnectFromDynamicSignals();
225 
226  virtual void slot_onViewChanged(
228 
229  virtual void slot_onCurrentSelectionChanged(
230  const DtSelectionManager::IdSet& selected,
231  const DtSelectionManager::IdSet& deselected);
232 
233  virtual void slot_onElementHasHoveredWidget( const DtElementID& elementId, bool hasMouseCursor );
234 
235  virtual void slot_onVertexElementHasHoveredWidget( const DtElementID& parentId, const DtElementID& vertexElementId, bool hasMouseCursor );
236 
237  virtual void slot_onVertexSelected( const DtUniqueID& selected,
238  const DtUniqueID& parentOfSelected);
239 
240  virtual void slot_onVertexDeselected( const DtUniqueID& deselected,
241  const DtUniqueID& parentOfDeselected);
242 
252  virtual void slot_infoLabelsArePinned(
253  const DtSelectionManager::IdSet& elementIds, bool arePinned);
254 
256  virtual void slot_entityTrackHistoryColorOverride(
257  const DtElementID& entityId, const DtColorValue& color, bool overrideColor);
258 
260  virtual void slot_switchEntitySymbolDecorationQuadrant(
261  const DtElementID& entityId);
262 
264  virtual void slot_onCoordinateSystemChanged(
265  const std::string& coordinateSystem,
266  const std::string& coordinateParameters );
267 
269  virtual void toggleEntitySelected(const DtUniqueID& id);
270 
271  virtual void performObserverAction(
273 
275 
276  virtual void slot_onObserverDestroyed(DtObserver* observer);
277 
278  virtual void slot_onObserverCreated(DtObserver* observer);
279 
281  virtual void startPublishingObserver( DtObserver* observer );
282 
284  virtual void stopPublishingObserver( DtObserver* observer );
285 
287  virtual void updateObservers();
288 
291  virtual void slot_pause();
292 
295  virtual void slot_resume();
296 
298  typedef std::vector<std::function<void ()> > FunctionCallList;
299 
300  enum FunctionType {Create, Update, Destroy};
301 
303  virtual void runFunctionQueue(FunctionCallQueue& queue);
304 
305  protected:
306 
307  //Main thread variables.
308  std::string myClassName;
309 
311  //Cross thread variables. They are used between the two threads for
312  //communication.
314  DtThreadStartSP myStart;
315  DtThread* myThread;
316 
321 
325 
327 
330  double myLastSimTime; // only used when single threaded
337 
339 
340  std::string myAppName;
341  std::string myAppVersion;
342  std::string myDefaultConfigFile;
343  std::vector<std::string> myConfigFiles;
344 
346  DtExerciseConnConfig* myDefaultConfiguration;
347  int myDeNotifyLevel = 0;
348  };
349 }
boost::function< void(DtObserver &)> ObserverAction
Definition: DtViewStateProcessor.h:29
#define DT_DLL_VRVVRL
Definition: vrvVrl.h:19
An asynchronous interface to the scene manager.
Definition: DtAsynchronousAgentManager.h:24
The master window of the scene.
Definition: DtSelectionManager.h:28
A Record of an IG instance.
Definition: DtDeRecord.h:24
Contains makVrv:DtSelectionManager class.
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
Contains makVrv::DtLockedBufferedQueue class.
A locked buffered queue which allows multiple writers and a single reader. Internally the queue is st...
Definition: DtLockedBufferedQueue.h:24
A facade for a DtObserverObject.
Definition: DtObserver.h:38
The DtDriver is an abstract class. Developers derive from this to create logic that &quot;directs&quot; things ...
Definition: DtDriver.h:31
The asynchronous event queue. To create an asynchronous event queue the the makVrv::DtMainEventQueue ...
Definition: DtAsynchronousEventQueue.h:24
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
The DtAgentManager manages the distributed scene object framework. This includes the objects and upda...
Definition: DtAgentManager.h:38
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
Contains makVrv:DtDriver class.
Contains DLL export macros.
std::set< DtUniqueID > IdSet
Definition: DtSelectionManager.h:32
Template for Color values in [0,1] range.
Definition: DtColorValue.h:24

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)