VR-Engage  2.2
Loading...
Searching...
No Matches
DtVirtualRealitySettingsWidget.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file DtVirtualRealitySettingsWidget.h
7//! \brief Defines the widget for virtual reality settings configuration
8//! \ingroup vrvVirtualRealityQt
9//!
10//! This file contains the DtVirtualRealitySettingsWidget class which implements
11//! the user interface controls for configuring virtual reality options. This widget
12//! is used by the DtVirtualRealitySettingsPage class to display VR settings in the
13//! application settings dialog.
14
15#pragma once
16
19#include "vrvVirtualRealityQt/DtVirtualRealitySettingsWidgetUI.hpp"
20
21namespace makVrv
22{
23//! \brief Widget for displaying and editing virtual reality settings
24//!
25//! This class implements a widget containing UI controls for viewing and
26//! modifying virtual reality settings. It implements the DtVirtualRealitySettingsInterface
27//! to provide a consistent interface for updating the UI and receiving user input.
28//! The widget includes controls for enabling/disabling VR, configuring mirroring options,
29//! selecting observer attachments, and other VR-specific settings.
30class DT_DLL_VRVVRQT DtVirtualRealitySettingsWidget : public QWidget,
31 public Ui::DtVirtualRealitySettingsWidgetUI,
33{
34 Q_OBJECT
35
36public:
37 //! \brief Constructor
38 //! \param de Reference to the display engine
39 //! \param parent Parent widget for this widget
40 //!
41 //! Initializes a new VR settings widget with references to the display engine
42 //! and parent widget. Sets up the UI controls defined in the UI form file.
43 DtVirtualRealitySettingsWidget(DtDe& de, QWidget* parent);
44
45 //! \brief Virtual destructor
46 //!
47 //! Cleans up resources associated with the VR settings widget.
49
50 //! \brief Updates the VR enabled state in the UI
51 //! \param enabled True to check the enabled checkbox, false to uncheck it
52 //!
53 //! Sets the state of the virtual reality enabled checkbox in the UI.
54 //! Implements the corresponding method from DtVirtualRealitySettingsInterface.
55 virtual void setEnabled(bool enabled);
56
57 //! \brief Updates the mirroring mode in the UI
58 //! \param view The mirroring mode to select in the UI
59 //!
60 //! Sets the selected option in the mirroring mode dropdown in the UI.
61 //! Implements the corresponding method from DtVirtualRealitySettingsInterface.
62 virtual void setMirroring(makArchives::DtVirtualRealitySettingsRecord::DtMirroring view);
63
64 //! \brief Updates the selected mirror channel in the UI
65 //! \param channelName The name of the channel to select in the UI
66 //!
67 //! Sets the selected option in the mirror channel dropdown in the UI.
68 //! Implements the corresponding method from DtVirtualRealitySettingsInterface.
69 virtual void setMirrorChannel(const std::string& channelName);
70
71 //! \brief Updates the VR hardware availability state in the UI
72 //! \param available True if VR hardware is available, false otherwise
73 //!
74 //! Enables or disables the VR settings controls based on hardware availability.
75 //! When hardware is unavailable, the UI will indicate this and disable
76 //! controls that require hardware to function.
77 //! Implements the corresponding method from DtVirtualRealitySettingsInterface.
78 virtual void setVirtualRealityAvailable(bool available);
79
80 //! \brief Updates the list of available mirror channels in the UI
81 //! \param names Vector of channel names to populate the dropdown with
82 //!
83 //! Populates the mirror channel dropdown with the provided list of channel names.
84 //! Implements the corresponding method from DtVirtualRealitySettingsInterface.
85 virtual void setChannelNames(const std::vector<std::string>& names);
86
87 //! \brief Updates the list of available observers in the UI
88 //! \param names Vector of observer names to populate the dropdown with
89 //!
90 //! Populates the observer dropdown with the provided list of observer names.
91 //! Implements the corresponding method from DtVirtualRealitySettingsInterface.
92 virtual void setObserverNames(const std::vector<std::string>& names);
93
94 //! \brief Updates the selected attached observer in the UI
95 //! \param observerName The name of the observer to select in the UI
96 //!
97 //! Sets the selected option in the observer dropdown in the UI.
98 //! Implements the corresponding method from DtVirtualRealitySettingsInterface.
99 virtual void setAttachedObserver(const std::string& observerName);
100
101 //! \brief Updates the flip overlays setting in the UI
102 //! \param flip True to check the flip overlays checkbox, false to uncheck it
103 //!
104 //! Sets the state of the flip overlays checkbox in the UI. Flipping overlays
105 //! may be necessary to correct their orientation on certain HMD models.
106 //! Implements the corresponding method from DtVirtualRealitySettingsInterface.
107 virtual void setFlipOverlay(bool flip);
108
109 //! \brief Enables or disables the flip overlays control in the UI
110 //! \param enabled True to enable the control, false to disable it
111 //!
112 //! Enables or disables the flip overlays checkbox in the UI. This control
113 //! should be disabled when flipping overlays is not supported by the current
114 //! HMD model or configuration.
115 //! Implements the corresponding method from DtVirtualRealitySettingsInterface.
116 virtual void setFlipOverlayEnabled(bool enabled);
117
118
119 //! \name UI Control Event Handlers
120 //! \brief Slot methods that handle user interaction with UI controls
121 //! @{
122public slots:
123
124 //! \brief Handles changes to the VR enabled checkbox
125 //! \param state New state of the checkbox (Qt::Checked or Qt::Unchecked)
126 //!
127 //! This slot is connected to the enabled checkbox's stateChanged signal
128 //! and emits the signal_enabledChanged signal when the user changes the checkbox.
129 virtual void onEnabledChanged(int state);
130
131 //! \brief Handles changes to the mirroring mode dropdown
132 //! \param state Index of the newly selected item
133 //!
134 //! This slot is connected to the mirroring dropdown's currentIndexChanged signal
135 //! and emits the signal_mirroringChanged signal when the user changes the selection.
136 virtual void onMirroringChanged(int state);
137
138 //! \brief Handles changes to the mirror channel dropdown
139 //! \param state Index of the newly selected item
140 //!
141 //! This slot is connected to the mirror channel dropdown's currentIndexChanged signal
142 //! and emits the signal_mirrorChannelChanged signal when the user changes the selection.
143 virtual void onMirrorChannelChanged(int state);
144
145 //! \brief Handles changes to the attached observer dropdown
146 //! \param state Index of the newly selected item
147 //!
148 //! This slot is connected to the observer dropdown's currentIndexChanged signal
149 //! and emits the signal_attachedObserverChanged signal when the user changes the selection.
150 virtual void onAttachedObserverChanged(int state);
151
152 //! \brief Handles changes to the flip overlays checkbox
153 //! \param state New state of the checkbox (Qt::Checked or Qt::Unchecked)
154 //!
155 //! This slot is connected to the flip overlays checkbox's stateChanged signal
156 //! and emits the signal_flipOverlaysChanged signal when the user changes the checkbox.
157 virtual void onFlipOverlaysChanged(int state);
158 //! @}
159
160protected:
161 //! \brief Reference to the display engine
162 //!
163 //! This reference is used to access VR system settings and other
164 //! application services needed by the widget.
165 DtDe& myDe;
166};
167} // namespace makVrv
Defines the interface for virtual reality settings configuration.
Interface for virtual reality settings GUI interaction.
Definition DtVirtualRealitySettingsInterface.h:37
virtual void onEnabledChanged(int state)
Handles changes to the VR enabled checkbox.
virtual void onAttachedObserverChanged(int state)
Handles changes to the attached observer dropdown.
virtual void setMirrorChannel(const std::string &channelName)
Updates the selected mirror channel in the UI.
virtual void setFlipOverlayEnabled(bool enabled)
Enables or disables the flip overlays control in the UI.
virtual void onMirrorChannelChanged(int state)
Handles changes to the mirror channel dropdown.
virtual void onFlipOverlaysChanged(int state)
Handles changes to the flip overlays checkbox.
virtual void setObserverNames(const std::vector< std::string > &names)
Updates the list of available observers in the UI.
virtual ~DtVirtualRealitySettingsWidget()
Virtual destructor.
virtual void setMirroring(makArchives::DtVirtualRealitySettingsRecord::DtMirroring view)
Updates the mirroring mode in the UI.
virtual void setFlipOverlay(bool flip)
Updates the flip overlays setting in the UI.
virtual void setAttachedObserver(const std::string &observerName)
Updates the selected attached observer in the UI.
virtual void setEnabled(bool enabled)
Updates the VR enabled state in the UI.
virtual void setVirtualRealityAvailable(bool available)
Updates the VR hardware availability state in the UI.
virtual void setChannelNames(const std::vector< std::string > &names)
Updates the list of available mirror channels in the UI.
DtDe & myDe
Reference to the display engine.
Definition DtVirtualRealitySettingsWidget.h:165
DtVirtualRealitySettingsWidget(DtDe &de, QWidget *parent)
Constructor.
virtual void onMirroringChanged(int state)
Handles changes to the mirroring mode dropdown.
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.
Main header file for the VRV Virtual Reality Qt module.