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