VR-Engage  2.2
Loading...
Searching...
No Matches
DtVreSensorFieldOfViewManager.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file DtVreSensorFieldOfViewManager.h
7//! \brief Defines the VR-Engage sensor field of view manager
8//!
9//! This file contains the DtVreSensorFieldOfViewManager class which extends the
10//! base DtSensorFieldOfViewManager to provide VR-Engage-specific behavior for
11//! managing sensor field of view states, associated observers, and sensor views.
12//! \ingroup vrvCore
13
14#pragma once
15
17#include <vrvCore/vrvCore.h>
18#include <vrvCore/DtSensorFieldOfViewManager.h>
19#include <vrvCore/DtSensorFieldOfViewData.h>
20
22
23
24namespace makVrv
25{
26//! \brief Forward declaration of the observer class
27class DtObserver;
28
29//! \brief Forward declaration of the sensor view overlay class
30class DtSensorViewOverlay;
31} // namespace makVrv
32
33namespace makVre
34{
35//! \brief VR-Engage sensor field of view manager
36//!
37//! DtVreSensorFieldOfViewManager extends the base DtSensorFieldOfViewManager
38//! to provide VR-Engage-specific behavior for managing sensor field of view
39//! states and the observers associated with them. This includes handling
40//! target object position updates, processing tracked locations, managing
41//! sensor view windows, and finding appropriate display windows and channels
42//! for sensor views.
43//! \ingroup vrvCore
44class PLAYERSTATION_DLL DtVreSensorFieldOfViewManager : public makVrv::DtSensorFieldOfViewManager
45{
46public:
47 //! \brief Destructor
48 //!
49 //! Cleans up resources used by the sensor field of view manager.
51
52 //! \brief Constructor
53 //! \param de Reference to the display engine
54 //!
55 //! Creates a new sensor field of view manager associated with the
56 //! specified display engine. This constructor is technically protected,
57 //! as instances should be created through the instance() factory method.
59
60 //! \brief Handles target object position messages
61 //! \param msg Pointer to the target object position message
62 //! \return Message processing result
63 //!
64 //! Processes messages containing target object position updates.
65 //! Updates the cached position and may trigger sensor view updates.
67
68 //! \brief Updates sensor field of view state for a specific sensor
69 //! \param hostId Unique ID of the host entity
70 //! \param sensorId Unique ID of the sensor
71 //! \param observerName Name of the observer to update
72 //!
73 //! Updates the sensor field of view state for the specified sensor,
74 //! which may involve creating or updating sensor views and observers.
75 //! Overridden to provide VR-Engage-specific update behavior.
76 virtual void update(makVrv::DtUniqueID hostId, makVrv::DtUniqueID sensorId, const std::string& observerName) override;
77
78 //! \brief Processes the location of a tracked target
79 //! \param observer Pointer to the observer
80 //! \param hostEntity Element ID of the host entity
81 //! \param relativeLocation Relative location of the tracked target from the host
82 //! \param targetLocation Absolute location of the tracked target
83 //!
84 //! Processes the location of a tracked target relative to the host entity.
85 //! This method is overridden to make it public, allowing VR-Engage systems
86 //! to directly process track locations when needed.
87 virtual void processTrackLocation(makVrv::DtObserver* observer, makVrv::DtElementID hostEntity,
88 const DtVector& relativeLocation, const DtVector& targetLocation) override;
89
90 //! \brief Finds the display window and channel for an observer
91 //! \param observer Pointer to the observer
92 //! \param displayName Output parameter for the display name
93 //! \param windowName Output parameter for the window name
94 //! \param channelName Output parameter for the channel name
95 //! \return True if a display window and channel were found, false otherwise
96 //!
97 //! Finds the appropriate display window and channel for the specified observer.
98 //! This method is overridden to make it public, allowing VR-Engage systems
99 //! to directly find display windows and channels when needed.
100 virtual bool findDisplayWindowAndChannel(const makVrv::DtObserver* observer, std::string& displayName,
101 std::string& windowName, std::string& channelName) const override;
102
103 //! \brief Removes a sensor view window
104 //! \param entId Unique ID of the entity
105 //! \param sensorId Unique ID of the sensor
106 //!
107 //! Removes a sensor view window that has been created for the specified
108 //! entity and sensor. This method is overridden because the base class implementation
109 //! attempts to delete the window as well, which would also delete channels
110 //! associated with it. The VR-Engage implementation provides a safer approach
111 //! that avoids unintended channel deletion.
112 virtual void removeSensorView(makVrv::DtUniqueID entId, makVrv::DtUniqueID sensorId) override;
113
114protected:
115 //! \brief Cached position of the last tracked target
116 //!
117 //! Stores the position of the last tracked target for use in subsequent
118 //! calculations or updates. This avoids redundant position calculations
119 //! or lookups when the same target is being processed multiple times.
121};
122} // namespace makVre
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
virtual void processTrackLocation(makVrv::DtObserver *observer, makVrv::DtElementID hostEntity, const DtVector &relativeLocation, const DtVector &targetLocation) override
Processes the location of a tracked target.
DtVreSensorFieldOfViewManager(makVrv::DtDe &de)
Constructor.
virtual bool findDisplayWindowAndChannel(const makVrv::DtObserver *observer, std::string &displayName, std::string &windowName, std::string &channelName) const override
Finds the display window and channel for an observer.
DtVector myCachedPosition
Cached position of the last tracked target.
Definition DtVreSensorFieldOfViewManager.h:120
virtual void update(makVrv::DtUniqueID hostId, makVrv::DtUniqueID sensorId, const std::string &observerName) override
Updates sensor field of view state for a specific sensor.
virtual void removeSensorView(makVrv::DtUniqueID entId, makVrv::DtUniqueID sensorId) override
Removes a sensor view window.
virtual ~DtVreSensorFieldOfViewManager() override
Destructor.
virtual makVre::DtVreMessageResult handleTargetObjectPosition(makVre::DtVreMessage *msg)
Handles target object position messages.
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.
Defines the base class for all VREngage messages.