VR-Engage  2.2
Loading...
Searching...
No Matches
spectatorOverlay.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file spectatorOverlay.h
7//! \brief Defines the Qt Quick overlay component for the spectator role
8//! \ingroup vreSpectatorFrontend
9
10#pragma once
11
13
16
17namespace makVre
18{
19//! \brief Forward declaration of the player station persistent notification class
21
22//! \brief Type identifier for DtOverlayComponent component
23constexpr const char* DtSpectatorOverlayType = "DtSpectatorOverlay";
24
25//! \brief Qt Quick overlay component for the spectator role
26//!
27//! This component provides a Qt Quick-based user interface overlay for the
28//! spectator role. It displays information, controls, and notifications specific
29//! to spectators, allowing them to interact with the simulation through a
30//! graphical interface. The overlay manages persistent notifications and
31//! provides spectator-specific UI elements.
33{
34public:
35 //! \brief Constructor
36 //! \param className Name of the class (used for logging and identification)
37 //!
38 //! Creates a new spectator overlay with the specified class name
40
41 //! \brief Virtual destructor
42 virtual ~DtSpectatorOverlay() override;
43
44 //! \brief Initializes the overlay component
45 //! \param player Pointer to the player station
46 //! \param config Reference to the initialization configuration
47 //! \return True if initialization was successful, false otherwise
48 //!
49 //! Sets up the overlay and loads the Qt Quick UI
51
52 //! \brief Updates overlay state each frame
53 //! \param dt Delta time since the last update in seconds
54 //!
55 //! Updates overlay elements based on current simulation state
56 virtual void tick(double dt) override;
57
58 //! \brief Performs cleanup when the component is shut down
59 //!
60 //! Releases overlay resources and cleans up UI elements
61 virtual void shutdown() override;
62
63 //! \brief Initializes the Qt Quick document with the root item
64 //! \param root Pointer to the root QQuickItem
65 //!
66 //! Connects Qt Quick signals and slots and initializes UI elements
67 virtual void initdoc(QQuickItem* root) override;
68
69 //! \brief Checks if the persistent notification is visible
70 //! \return True if the notification is visible, false otherwise
71 //!
72 //! Determines whether the persistent notification is currently displayed
74
75 //! \brief Checks if the current player is a spectator
76 //! \return True if the player is a spectator, false otherwise
77 //!
78 //! Determines whether the current player is in spectator mode
79 virtual bool isSpectator();
80
81 //! \brief Returns the component type identifier
82 //! \return The component type string
83 virtual const char* type() const override;
84
85protected:
86 //! \brief Shared pointer to the persistent notification
87 //!
88 //! Manages the persistent notification displayed to the spectator
89 std::shared_ptr<DtPlayerStationPersistentNotification> myPersistentNotification;
90
91 //! \brief Flag indicating if the player is in spectator mode
93};
94} // namespace makVre
Table-based access to Lua state for configuration data.
Definition initializer.h:38
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Persistent notification UI component for VR-Engage.
Definition playerStationPersistentNotification.h:35
DtQtQuickOverlay()
Constructor for DtQtQuickOverlay.
virtual ~DtSpectatorOverlay() override
Virtual destructor.
virtual void tick(double dt) override
Updates overlay state each frame.
virtual void shutdown() override
Performs cleanup when the component is shut down.
virtual bool isSpectator()
Checks if the current player is a spectator.
std::shared_ptr< DtPlayerStationPersistentNotification > myPersistentNotification
Shared pointer to the persistent notification.
Definition spectatorOverlay.h:89
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the overlay component.
DtSpectatorOverlay()
Constructor.
bool mySpectator
Flag indicating if the player is in spectator mode.
Definition spectatorOverlay.h:92
virtual void initdoc(QQuickItem *root) override
Initializes the Qt Quick document with the root item.
virtual bool isPersistentNotificationVisible()
Checks if the persistent notification is visible.
virtual const char * type() const override
Returns the component type identifier.
Defines export macros for the Spectator Frontend library.
#define SPECTATOR_DLL
Export/import macro for non-Windows platforms (empty)
Definition export.h:25
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtSpectatorOverlayType
Type identifier for DtOverlayComponent component.
Definition spectatorOverlay.h:23
Defines the DtPlayerComponent base class for VR-Engage role components.
Contains DtQtQuickOverlay class which provides a Qt Quick overlay component for rendering 2D UI over ...