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) 2023 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 <functional>
24 
25 class DtThread;
26 class DtEntityType;
27 
28 namespace makVrv
29 {
30  class DtAsynchronousEventQueue;
31  class DtAsynchronousAgentManager;
32  class DtVrlinkBaseConnection;
33  class DtEntityTypeMapper;
34  class DtObserver;
35  class DtSelectionManager;
36  class DtMouseState;
37  class DtColorValue;
38 
42  protected DtRunnable
43  {
44  public:
45 
47  DtVrlinkDriver(DtAgentManager& agentManager,
48  const std::string& uniqueName, const std::string& className);
49 
51  virtual ~DtVrlinkDriver();
52 
54  virtual const std::string& className() const;
55 
57  virtual bool observersPublished() const;
58 
60  virtual void setObserversPublished(bool isPublished);
61 
64  virtual bool overrideGlobalViewControl() const;
65 
68  virtual void setOverrideGlobalViewControl(bool enabled);
69 
73  virtual bool viewControlEnabled() const;
74 
77  virtual void setLocalViewControlEnabled(bool enabled);
78 
81  virtual bool localViewControlEnabled() const;
82 
85  virtual void setConnectionFrameTime( double frameTime );
86 
89  virtual double connectionFrameTime() const;
90 
97  void setUseTopoForFlatEarthVectorConversion( bool flag );
98  bool useTopoForFlatEarthVectorConversion() const;
99 
101  virtual void queueDriverFunction(const std::function<void ()>& function);
102 
104  virtual void queueConnectionFunction(const std::function<void ()>& function);
105 
107  bool useThreadFlag() const
108  {
109  return myUseThreadFlag;
110  }
111 
113  {
114  return myConnection;
115  }
116 
118  boost::signalslib::signal<void (DtVrlinkBaseConnection*)> signal_connectionCreated;
119 
121  boost::signalslib::signal<void (DtVrlinkBaseConnection*)> signal_connectionAboutToBeDestroyed;
122 
123  protected:
124 
126  virtual DtVrlinkBaseConnection* createConnection() = 0;
127 
130  virtual bool onStart();
131 
134  virtual bool onStop();
135 
137  virtual void run();
138 
140  void startPublishingObservers();
141 
143  void stopPublishingObservers();
144 
147  virtual bool onTick();
148 
151  void startThread();
152 
155  void stopThread();
156 
158  void setConnectionState( bool state );
159 
161  virtual void slot_displayEngineAdded( const DtDeRecord& igRecord );
162 
164  virtual void slot_globalViewControlEnabledSet( bool );
165 
167 
169  virtual void connectToDynamicSignals();
170 
173  virtual void disconnectFromDynamicSignals();
174 
175  virtual void slot_onViewChanged(
177 
178  virtual void slot_onCurrentSelectionChanged(
179  const DtSelectionManager::IdSet& selected,
180  const DtSelectionManager::IdSet& deselected);
181 
182  virtual void slot_onElementHasHoveredWidget(
183  const DtElementID& sceneObjectId,
184  bool isHovered);
185 
186  virtual void slot_onVertexSelected( const DtUniqueID& selected,
187  const DtUniqueID& parentOfSelected);
188 
189  virtual void slot_onVertexDeselected( const DtUniqueID& deselected,
190  const DtUniqueID& parentOfDeselected);
191 
201  virtual void slot_infoLabelsArePinned(
202  const DtSelectionManager::IdSet& elementIds, bool arePinned);
203 
205  virtual void slot_entityTrackHistoryColorOverride(
206  const DtElementID& entityId, const DtColorValue& color, bool overrideColor);
207 
209  virtual void slot_switchEntitySymbolDecorationQuadrant(
210  const DtElementID& entityId);
211 
213  virtual void slot_onCoordinateSystemChanged(
214  const std::string& coordinateSystem,
215  const std::string& coordinateParameters );
216 
218  virtual void toggleEntitySelected(const DtUniqueID& id);
219 
220  virtual void performObserverAction(
222 
224 
225  virtual void slot_onObserverDestroyed(DtObserver* observer);
226 
227  virtual void slot_onObserverCreated(DtObserver* observer);
228 
230  virtual void startPublishingObserver( DtObserver* observer );
231 
233  virtual void stopPublishingObserver( DtObserver* observer );
234 
236  virtual void updateObservers();
237 
240  virtual void slot_pause();
241 
244  virtual void slot_resume();
245 
247  typedef std::vector<std::function<void ()> > FunctionCallList;
248 
249  enum FunctionType {Create, Update, Destroy};
250 
252  virtual void runFunctionQueue(FunctionCallQueue& queue);
253 
254  protected:
255 
256  //Main thread variables.
257  std::string myClassName;
258 
260  //Cross thread variables. They are used between the two threads for
261  //communication.
263  DtThreadStartSP myStart;
264  DtThread* myThread;
265 
270 
274 
276 
279  double myLastSimTime; // only used when single threaded
286 
288 
289  };
290 }
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:37
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:20

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)