VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSensorFieldOfViewManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
17 #include <vrvCore/DtUniqueID.h>
18 
19 namespace makVrv
20 {
21  class DtObserver;
22  class DtSensorViewOverlay;
23  class DtCoordinateSystem;
24 
29  {
30  public:
31 
36  {
37  std::string myDisplayName;
38  std::string myWindowName;
39  std::string myChannelName;
40  DtSensorViewOverlay* myOverlay = 0;
41  };
42 
43  typedef std::map<DtUniqueID, DtSensorFieldOfViewData> SensorFieldOfViewDataMap;
44 
46  static DtSensorFieldOfViewManager& instance( DtDe& de );
47 
49  virtual ~DtSensorFieldOfViewManager();
50 
52  virtual void addSensorFieldOfView(DtElementID hostEntity,
53  DtElementID sensorFieldOfView, const DtSensorFieldOfViewData& initData);
54 
56  virtual void updateSensorFieldOfView(DtElementID hostEntity,
57  DtElementID sensorFieldOfView, const DtSensorFieldOfViewData& data);
58 
60  virtual void getSensorFieldOfViewData(DtElementID hostEntity,
61  DtElementID sensorFieldOfView, DtSensorFieldOfViewData& data) const;
62 
64  virtual void removeSensorFieldOfView(DtElementID hostEntity,
65  DtElementID sensorFieldOfView);
66 
69  virtual void addSensorObserver(const std::string& observerName,
70  DtElementID hostId, DtElementID sensorId, bool createControls);
71 
73  virtual bool hasSensorObserver(DtElementID hostId, DtElementID sensorId);
74 
78  virtual std::string sensorObserverName(DtElementID hostId, DtElementID sensorId) const;
79 
82  const SensorFieldOfViewDataMap* fieldsOfViewForEntity(DtElementID entity) const;
83 
85 
86  virtual std::string sensorId(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
87  virtual void setSensorId(DtElementID hostEntity, DtElementID sensorFieldOfView,
88  const std::string& id);
90 
92 
93  virtual DtVector relativeLocation(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
94  virtual void setRelativeLocation(DtElementID hostEntity, DtElementID sensorFieldOfView,
95  const DtVector& loc);
97 
99 
100  virtual DtTaitBryan relativeOrientation(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
101  virtual void setRelativeOrientation(DtElementID hostEntity, DtElementID sensorFieldOfView,
102  const DtTaitBryan& ori);
104 
106 
107  virtual double radius(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
108  virtual void setRadius(DtElementID hostEntity, DtElementID sensorFieldOfView,
109  double r);
111 
114 
115  virtual double minimumAzimuthAngle(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
116  virtual void setMinimumAzimuthAngle(DtElementID hostEntity, DtElementID sensorFieldOfView,
117  double angle);
119 
122 
123  virtual double maximumAzimuthAngle(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
124  virtual void setMaximumAzimuthAngle(DtElementID hostEntity, DtElementID sensorFieldOfView,
125  double angle);
127 
130 
131  virtual double minimumElevationAngle(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
132  virtual void setMinimumElevationAngle(DtElementID hostEntity, DtElementID sensorFieldOfView,
133  double angle);
135 
138 
139  virtual double maximumElevationAngle(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
140  virtual void setMaximumElevationAngle(DtElementID hostEntity, DtElementID sensorFieldOfView,
141  double angle);
143 
145 
146  virtual double maximumZoomLevel(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
147  virtual void setMaximumZoomLevel(DtElementID hostEntity, DtElementID sensorFieldOfView,
148  double zoom);
150 
152 
153  virtual double zoomLevel(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
154  virtual void setZoomLevel(DtElementID hostEntity, DtElementID sensorFieldOfView,
155  double zoom);
157 
160 
161  virtual double xHalfAngle(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
162  virtual void setXHalfAngle(DtElementID hostEntity, DtElementID sensorFieldOfView,
163  double angle);
165 
168 
169  virtual double yHalfAngle(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
170  virtual void setYHalfAngle(DtElementID hostEntity, DtElementID sensorFieldOfView,
171  double angle);
173 
175 
176  virtual DtElementID targetId(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
177  virtual void setTargetId(DtElementID hostEntity, DtElementID sensorFieldOfView,
178  DtElementID id);
180 
182 
183  virtual DtVector targetLocation(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
184  virtual void setTargetLocation(DtElementID hostEntity, DtElementID sensorFieldOfView,
185  const DtVector& loc);
187 
189 
190  virtual std::string trackingMode(DtElementID hostEntity, DtElementID sensorFieldOfView) const;
191  virtual void setTrackingMode(DtElementID hostEntity, DtElementID sensorFieldOfView,
192  const std::string& mode);
194 
196 
197  virtual void color(DtElementID hostEntity, DtElementID sensorFieldOfView,
198  float& r, float& g, float& b, float& a) const;
199  virtual void setColor(DtElementID hostEntity, DtElementID sensorFieldOfView,
200  float r, float g, float b, float a);
202 
204 
205  virtual DtSensorFieldOfViewData* sensorFieldOfViewData(DtElementID hostEntity,
206  DtElementID sensorFieldOfView);
207  virtual const DtSensorFieldOfViewData* sensorFieldOfViewData(DtElementID hostEntity,
208  DtElementID sensorFieldOfView) const;
210 
212  virtual void removeSensorView(DtUniqueID entId, DtUniqueID sensorId);
213 
215  virtual void removeSensorOverlay(DtUniqueID entId, DtUniqueID sensorId);
216 
218  {
219  return mySensorFieldsOfViewCollection;
220  }
221 
222  protected:
223 
226 
228  virtual void processTrackTarget(DtObserver* observer, DtElementID hostEntity,
229  const DtVector& relativeLocation, DtElementID targetEntity);
230 
232  virtual void processTrackLocation(DtObserver* observer, DtElementID hostEntity,
233  const DtVector& relativeLocation, const DtVector& targetLocation);
234 
236  virtual void processSetOrientation(DtObserver* observer, DtElementID hostEntity,
237  const DtVector& relativeLocation, const DtTaitBryan& relativeOrientation);
238 
241  virtual bool findDisplayWindowAndChannel(const DtObserver* observer,
242  std::string& displayName, std::string& windowName, std::string& channelName) const;
243 
244 
245  virtual void slot_onObjectAdded(const DtVrlinkSensorFieldsOfViewView&);
246  virtual void slot_onObjectUpdated(DtStateView<DtVrlinkSensorFieldsOfView>* fieldsOfView);
247  virtual void slot_onObjectAboutToBeRemoved(const DtVrlinkSensorFieldsOfViewView&);
248  virtual void slot_onUpdate();
249 
250  virtual void update(DtUniqueID hostId, DtUniqueID sensorId, const std::string& observerName);
251 
253  virtual void destroySensorViewOverlayEntry(DtSensorViewOverlayEntry* overlayEntry);
254 
256  virtual void slot_coordinateSystemChanged();
257 
259  virtual void slot_channelToBeDestroyed(const std::string& displayName,
260  const std::string& winName, const std::string& channelName );
261 
262  protected:
263 
266 
267  typedef std::pair<DtElementID, DtElementID> HostAndSensorId;
268  typedef std::map<HostAndSensorId, std::string> SensorObserverMap;
269  typedef std::map<std::string, DtSensorViewOverlayEntry*> SensorObserverOverlayMap;
270  typedef std::map<DtElementID, SensorFieldOfViewDataMap> HostSensorFieldOfViewDataMap;
271 
275 
277 
279 
282  DtCoordinateSystem* myCoordinateSystem = nullptr;
283  };
284 }
285 
286 
287 
288 
289 
290 
291 
292 
293 
294 
295 
296 
std::map< DtUniqueID, DtSensorFieldOfViewData > SensorFieldOfViewDataMap
Definition: DtSensorFieldOfViewManager.h:43
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
DtVrlinkSensorFieldsOfViewStateViewCollection * mySensorFieldsOfViewCollection
Definition: DtSensorFieldOfViewManager.h:265
DtSensorViewOverlay is responsible for creating and updating the overlay information on a sensor view...
Definition: DtSensorViewOverlay.h:26
DtDe & myDe
Definition: DtSensorFieldOfViewManager.h:264
DtVrlinkSensorFieldsOfViewStateViewCollection * sensorFieldsOfViewCollection() const
Definition: DtSensorFieldOfViewManager.h:217
SensorObserverOverlayMap mySensorOverlays
Definition: DtSensorFieldOfViewManager.h:274
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
SensorObserverMap mySensorObservers
Definition: DtSensorFieldOfViewManager.h:273
DtSignalConnectionManager myConnections
Definition: DtSensorFieldOfViewManager.h:278
Contains the data defining the current state of a sensor field of view.
Definition: DtSensorFieldOfViewData.h:23
A facade for a DtObserverObject.
Definition: DtObserver.h:37
Contains makVrv::DtVirtualBaseClass class.
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
std::map< HostAndSensorId, std::string > SensorObserverMap
Definition: DtSensorFieldOfViewManager.h:268
std::string myChannelName
Definition: DtSensorFieldOfViewManager.h:39
std::string myDisplayName
Definition: DtSensorFieldOfViewManager.h:37
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
A DtStateView is a the interface to simulation state information. Users can create DtStateViews for s...
Definition: DtStateView.h:49
A DtStateViewCollection is a collection of DtStateViews of a specific state.
Definition: DtStateViewCollection.h:27
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
bool myRegisteredForUpdates
Definition: DtSensorFieldOfViewManager.h:276
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
Base class to provide boost signal/slot management.
const char int mode
Definition: ioapi.h:38
Contains makVrv::DtUniqueID type.
std::pair< DtElementID, DtElementID > HostAndSensorId
Definition: DtSensorFieldOfViewManager.h:267
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
std::string myWindowName
Definition: DtSensorFieldOfViewManager.h:38
std::map< DtElementID, SensorFieldOfViewDataMap > HostSensorFieldOfViewDataMap
Definition: DtSensorFieldOfViewManager.h:270
The sensor field of view manager. Keeps track of sensor field of view states and any observers associ...
Definition: DtSensorFieldOfViewManager.h:28
std::map< std::string, DtSensorViewOverlayEntry * > SensorObserverOverlayMap
Definition: DtSensorFieldOfViewManager.h:269
A structure used to associate a DtSensorViewOverlay object with the information that was used to init...
Definition: DtSensorFieldOfViewManager.h:35
Contains DLL export macros.
HostSensorFieldOfViewDataMap mySensorFieldOfViewData
Definition: DtSensorFieldOfViewManager.h:272

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)