VR-Engage  2.2
Loading...
Searching...
No Matches
DtVirtualRealitySettingsInterface.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file DtVirtualRealitySettingsInterface.h
7//! \brief Defines the interface for virtual reality settings configuration
8//! \ingroup vrvVirtualRealityQt
9//!
10//! This file contains the DtVirtualRealitySettingsInterface abstract class which defines
11//! the interface for configuring virtual reality settings through a GUI. It provides
12//! signals for notifying when settings are changed by the user and methods for updating
13//! the UI to reflect current settings.
14
15#pragma once
16
18
19#include "vrvVirtualReality/DtVirtualRealitySettingsRecord.h"
20
21#include <vrvUtil/signalslib.h>
22#include <vrvUtil/DtUnicode.h>
23
24#include <string>
25#include <vector>
26
27namespace makVrv
28{
29//! \brief Interface for virtual reality settings GUI interaction
30//!
31//! This abstract class defines the interface for interacting with the virtual reality
32//! settings GUI. It provides signals that are emitted when the user changes settings
33//! in the UI, and setter methods that allow the application to update the UI to
34//! reflect current settings. Implementations of this interface serve as the bridge
35//! between the UI and the underlying virtual reality system.
37{
38public:
39 //! \brief Virtual destructor
40 //!
41 //! Ensures proper cleanup of resources in derived classes.
43
44 //! \name Signal Declarations
45 //! @{
46 //! \brief Signal emitted when the VR enabled state is changed
47 //!
48 //! This signal is emitted when the user toggles the virtual reality
49 //! enabled checkbox in the UI.
50 //! \param enabled The new enabled state (true if enabled, false if disabled)
51 boost::signalslib::signal<void(bool)> signal_enabledChanged;
52
53 //! \brief Signal emitted when the mirroring mode is changed
54 //!
55 //! This signal is emitted when the user selects a different mirroring
56 //! option from the dropdown in the UI.
57 //! \param mirroring The new mirroring mode selected
58 boost::signalslib::signal<void(makArchives::DtVirtualRealitySettingsRecord::DtMirroring)> signal_mirroringChanged;
59
60 //! \brief Signal emitted when the mirror channel is changed
61 //!
62 //! This signal is emitted when the user selects a different channel
63 //! for mirroring the HMD view in the UI.
64 //! \param channelName The name of the selected mirror channel
65 boost::signalslib::signal<void(std::string)> signal_mirrorChannelChanged;
66
67 //! \brief Signal emitted when the attached observer is changed
68 //!
69 //! This signal is emitted when the user selects a different observer
70 //! to attach the HMD view to in the UI.
71 //! \param observerName The name of the selected observer
72 boost::signalslib::signal<void(std::string)> signal_attachedObserverChanged;
73
74 //! \brief Signal emitted when the flip overlays setting is changed
75 //!
76 //! This signal is emitted when the user toggles the flip overlays
77 //! checkbox in the UI. Flipping overlays may be necessary to correct
78 //! their orientation on certain HMD models.
79 //! \param flip True if overlays should be flipped, false otherwise
80 boost::signalslib::signal<void(bool)> signal_flipOverlaysChanged;
81 //@}
82
83 //! \name UI Update Methods
84 //! @{
85
86 //! \brief Updates the VR enabled state in the UI
87 //! \param enabled True to check the enabled checkbox, false to uncheck it
88 //!
89 //! Sets the state of the virtual reality enabled checkbox in the UI.
90 //! This should be called when the VR enabled state changes outside the UI.
91 virtual void setEnabled(bool enabled) = 0;
92
93 //! \brief Updates the mirroring mode in the UI
94 //! \param view The mirroring mode to select in the UI
95 //!
96 //! Sets the selected option in the mirroring mode dropdown in the UI.
97 //! This should be called when the mirroring mode changes outside the UI.
98 virtual void setMirroring(makArchives::DtVirtualRealitySettingsRecord::DtMirroring view) = 0;
99
100 //! \brief Updates the selected mirror channel in the UI
101 //! \param channelName The name of the channel to select in the UI
102 //!
103 //! Sets the selected option in the mirror channel dropdown in the UI.
104 //! This should be called when the mirror channel changes outside the UI.
105 virtual void setMirrorChannel(const std::string& channelName) = 0;
106
107 //! \brief Updates the VR hardware availability state in the UI
108 //! \param available True if VR hardware is available, false otherwise
109 //!
110 //! Enables or disables the VR settings controls based on hardware availability.
111 //! When hardware is unavailable, the UI should indicate this and disable
112 //! controls that require hardware to function.
113 virtual void setVirtualRealityAvailable(bool available) = 0;
114
115 //! \brief Updates the list of available mirror channels in the UI
116 //! \param names Vector of channel names to populate the dropdown with
117 //!
118 //! Populates the mirror channel dropdown with the provided list of channel names.
119 //! This should be called when the available channels change.
120 virtual void setChannelNames(const std::vector<std::string>& names) = 0;
121
122 //! \brief Updates the list of available observers in the UI
123 //! \param names Vector of observer names to populate the dropdown with
124 //!
125 //! Populates the observer dropdown with the provided list of observer names.
126 //! This should be called when the available observers change.
127 virtual void setObserverNames(const std::vector<std::string>& names) = 0;
128
129 //! \brief Updates the selected attached observer in the UI
130 //! \param observerName The name of the observer to select in the UI
131 //!
132 //! Sets the selected option in the observer dropdown in the UI.
133 //! This should be called when the attached observer changes outside the UI.
134 virtual void setAttachedObserver(const std::string& observerName) = 0;
135
136 //! \brief Updates the flip overlays setting in the UI
137 //! \param flip True to check the flip overlays checkbox, false to uncheck it
138 //!
139 //! Sets the state of the flip overlays checkbox in the UI. Flipping overlays
140 //! may be necessary to correct their orientation on certain HMD models.
141 //! This should be called when the flip overlays setting changes outside the UI.
142 virtual void setFlipOverlay(bool flip) = 0;
143
144 //! \brief Enables or disables the flip overlays control in the UI
145 //! \param enabled True to enable the control, false to disable it
146 //!
147 //! Enables or disables the flip overlays checkbox in the UI. This control
148 //! should be disabled when flipping overlays is not supported by the current
149 //! HMD model or configuration.
150 virtual void setFlipOverlayEnabled(bool enabled) = 0;
151
152 //@}
153};
154} // namespace makVrv
Interface for virtual reality settings GUI interaction.
Definition DtVirtualRealitySettingsInterface.h:37
boost::signalslib::signal< void(std::string)> signal_attachedObserverChanged
Signal emitted when the attached observer is changed.
Definition DtVirtualRealitySettingsInterface.h:72
virtual void setEnabled(bool enabled)=0
Updates the VR enabled state in the UI.
virtual void setVirtualRealityAvailable(bool available)=0
Updates the VR hardware availability state in the UI.
virtual void setChannelNames(const std::vector< std::string > &names)=0
Updates the list of available mirror channels in the UI.
virtual void setFlipOverlay(bool flip)=0
Updates the flip overlays setting in the UI.
virtual void setMirroring(makArchives::DtVirtualRealitySettingsRecord::DtMirroring view)=0
Updates the mirroring mode in the UI.
boost::signalslib::signal< void(bool)> signal_flipOverlaysChanged
Signal emitted when the flip overlays setting is changed.
Definition DtVirtualRealitySettingsInterface.h:80
boost::signalslib::signal< void(bool)> signal_enabledChanged
Signal emitted when the mirroring mode is changed.
Definition DtVirtualRealitySettingsInterface.h:51
virtual void setObserverNames(const std::vector< std::string > &names)=0
Updates the list of available observers in the UI.
virtual void setMirrorChannel(const std::string &channelName)=0
Updates the selected mirror channel in the UI.
boost::signalslib::signal< void(makArchives::DtVirtualRealitySettingsRecord::DtMirroring)> signal_mirroringChanged
Signal emitted when the mirroring mode is changed.
Definition DtVirtualRealitySettingsInterface.h:58
boost::signalslib::signal< void(std::string)> signal_mirrorChannelChanged
Signal emitted when the mirror channel is changed.
Definition DtVirtualRealitySettingsInterface.h:65
virtual ~DtVirtualRealitySettingsInterface()
Virtual destructor.
virtual void setAttachedObserver(const std::string &observerName)=0
Updates the selected attached observer in the UI.
virtual void setFlipOverlayEnabled(bool enabled)=0
Enables or disables the flip overlays control in the UI.
Definition appLauncherComponent.h:28
Main header file for the VRV Virtual Reality Qt module.