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) 2025 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;
29 
30 namespace makVrv
31 {
32  class DtAsynchronousEventQueue;
33  class DtAsynchronousAgentManager;
34  class DtVrlinkBaseConnection;
35  class DtEntityTypeMapper;
36  class DtObserver;
37  class DtSelectionManager;
38  class DtMouseState;
39  class DtColorValue;
40 
44  protected DtRunnable
45  {
46  public:
47  static const std::string theExConnConfigFileCount;
48  static const std::string theExConnConfigFile;
49 
50  public:
51 
53  DtVrlinkDriver(DtAgentManager& agentManager,
54  const std::string& uniqueName, const std::string& className);
55 
57  virtual ~DtVrlinkDriver();
58 
60  virtual const std::string& className() const;
61 
63  virtual bool observersPublished() const;
64 
66  virtual void setObserversPublished(bool isPublished);
67 
70  virtual bool overrideGlobalViewControl() const;
71 
74  virtual void setOverrideGlobalViewControl(bool enabled);
75 
79  virtual bool viewControlEnabled() const;
80 
83  virtual void setLocalViewControlEnabled(bool enabled);
84 
87  virtual bool localViewControlEnabled() const;
88 
91  virtual void setConnectionFrameTime( double frameTime );
92 
95  virtual double connectionFrameTime() const;
96 
103  void setUseTopoForFlatEarthVectorConversion( bool flag );
104  bool useTopoForFlatEarthVectorConversion() const;
105 
107  virtual void queueDriverFunction(const std::function<void ()>& function);
108 
110  virtual void queueConnectionFunction(const std::function<void ()>& function);
111 
113  bool useThreadFlag() const
114  {
115  return myUseThreadFlag;
116  }
117 
119  {
120  return myConnection;
121  }
122 
124  boost::signalslib::signal<void (DtVrlinkBaseConnection*)> signal_connectionCreated;
125 
127  boost::signalslib::signal<void (DtVrlinkBaseConnection*)> signal_connectionAboutToBeDestroyed;
128 
129  protected:
130 
132  virtual DtVrlinkBaseConnection* createConnection() = 0;
133 
136  virtual bool onStart();
137 
140  virtual bool onStop();
141 
143  virtual void run();
144 
146  void startPublishingObservers();
147 
149  void stopPublishingObservers();
150 
153  virtual bool onTick();
154 
157  void startThread();
158 
161  void stopThread();
162 
164  void setConnectionState( bool state );
165 
167  virtual void slot_displayEngineAdded( const DtDeRecord& igRecord );
168 
170  virtual void slot_globalViewControlEnabledSet( bool );
171 
173 
175  virtual void connectToDynamicSignals();
176 
179  virtual void disconnectFromDynamicSignals();
180 
181  virtual void slot_onViewChanged(
183 
184  virtual void slot_onCurrentSelectionChanged(
185  const DtSelectionManager::IdSet& selected,
186  const DtSelectionManager::IdSet& deselected);
187 
188  virtual void slot_onElementHasHoveredWidget( const DtElementID& elementId, bool hasMouseCursor );
189 
190  virtual void slot_onVertexElementHasHoveredWidget( const DtElementID& parentId, const DtElementID& vertexElementId, bool hasMouseCursor );
191 
192  virtual void slot_onVertexSelected( const DtUniqueID& selected,
193  const DtUniqueID& parentOfSelected);
194 
195  virtual void slot_onVertexDeselected( const DtUniqueID& deselected,
196  const DtUniqueID& parentOfDeselected);
197 
207  virtual void slot_infoLabelsArePinned(
208  const DtSelectionManager::IdSet& elementIds, bool arePinned);
209 
211  virtual void slot_entityTrackHistoryColorOverride(
212  const DtElementID& entityId, const DtColorValue& color, bool overrideColor);
213 
215  virtual void slot_switchEntitySymbolDecorationQuadrant(
216  const DtElementID& entityId);
217 
219  virtual void slot_onCoordinateSystemChanged(
220  const std::string& coordinateSystem,
221  const std::string& coordinateParameters );
222 
224  virtual void toggleEntitySelected(const DtUniqueID& id);
225 
226  virtual void performObserverAction(
228 
230 
231  virtual void slot_onObserverDestroyed(DtObserver* observer);
232 
233  virtual void slot_onObserverCreated(DtObserver* observer);
234 
236  virtual void startPublishingObserver( DtObserver* observer );
237 
239  virtual void stopPublishingObserver( DtObserver* observer );
240 
242  virtual void updateObservers();
243 
246  virtual void slot_pause();
247 
250  virtual void slot_resume();
251 
253  typedef std::vector<std::function<void ()> > FunctionCallList;
254 
255  enum FunctionType {Create, Update, Destroy};
256 
258  virtual void runFunctionQueue(FunctionCallQueue& queue);
259 
260  protected:
261 
262  //Main thread variables.
263  std::string myClassName;
264 
266  //Cross thread variables. They are used between the two threads for
267  //communication.
269  DtThreadStartSP myStart;
270  DtThread* myThread;
271 
276 
280 
282 
285  double myLastSimTime; // only used when single threaded
292 
294 
295  std::string myAppName;
296  std::string myAppVersion;
297  std::string myDefaultConfigFile;
298  std::vector<std::string> myConfigFiles;
299  };
300 }
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:30
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:20

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)