VR-Engage  2.2
Loading...
Searching...
No Matches
vrvPlayerStationDriver.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vrvPlayerStationDriver.h
7//! \brief Contains DtPlayerStationDriver class - the main driver for the VR-Engage player station application
8//!
9//! This file defines the DtPlayerStationDriver class which manages the lifecycle
10//! of the player station application, controls entity resolution, message processing,
11//! and handles the connection between the VRV engine and the player station components.
12
13#pragma once
14
15
16#include <vrvCore/DtDriver.h>
20
21//! Forward declaration of exercise connection class
22class DtExerciseConn;
23
24namespace makVre
25{
26//! Forward declaration of audio manager class
27class DtAudioManager;
28} // namespace makVre
29
30namespace makVrv
31{
32//! Forward declaration of display engine class
33class DtDe;
34
35//! Forward declaration of agent manager class
36class DtAgentManager;
37} // namespace makVrv
38
39namespace makVre
40{
41//! Forward declaration of simulation event connector class
42class DtSimEventConnector;
43
44//! Forward declaration of intersector class
45class DtIntersector;
46
47//! Forward declaration of entity resolver class
49
50//! \brief A driver that controls the lifecycle and execution of the VR-Engage player station application
51//!
52//! The DtPlayerStationDriver class manages the lifecycle of the DtPlayerStationApp,
53//! including initialization, update, and shutdown. It maintains the entity resolver,
54//! provides intersection services, registers message handlers, and handles debug
55//! functionality for the application.
56class PLAYERSTATION_DLL DtPlayerStationDriver : public makVrv::DtDriver
57{
58public:
59 //! \brief Constructor that initializes the driver and associated resources
60 //! \param am Reference to the agent manager used for entity management
61 //!
62 //! Creates and initializes an instance of the DtEntityResolver for entity tracking.
63 //! Initializes the DtEntityHelper instance with the new DtEntityResolver.
64 //! Creates and initializes the instance of the DtVreMessageManager, and
65 //! calls populateVreMessageFactory() to register the stock set of
66 //! DtVreMessage creators.
67 DtPlayerStationDriver(makVrv::DtAgentManager& am);
68 //! \brief Virtual destructor that cleans up resources
69 //!
70 //! Deletes the entity resolver and application instance if they exist
71 virtual ~DtPlayerStationDriver() override;
72
73 //! \brief Gets the name of this C++ class
74 //! \return String containing "DtPlayerStationDriver"
75 virtual const std::string& className() const override;
76
77 //! \brief Sets the player station application instance
78 //! \param app Pointer to the top-level player station application instance
79 //!
80 //! Caches the application in myApp. Creates a new DtVrvIntersector instance
81 //! and sets a pointer to it in the application's DtAttributeStore with the
82 //! name "DtIntersector". Sets a pointer to the DtEntityResolver in the
83 //! application's DtAttributeStore with the name "DtEntityResolver".
85
86 //! \brief Gets the current player station application instance
87 //! \return Reference to the player station application
88 //!
89 //! Provides access to the current player station application instance
91
92 //! \brief Gets the entity resolver used by this driver
93 //! \return Reference to the entity resolver instance
94 //!
95 //! Returns a reference to DtEntityResolver, the object used to
96 //! maintain a mapping between the various identifiers associated with
97 //! simulation objects in the VR-Engage front-end.
99
100 //! \brief Initializes the driver and associated components
101 //! \return True if initialization was successful
102 //!
103 //! Installs the DtVreDebugManager and DtQtQuickRenderer instances,
104 //! enables the display of audio capture device config in the GUI,
105 //! and registers callback for DtVreMessage instances received for display
106 //! in the SHIFT+F4 debug menu. Also logs graphics driver information.
107 virtual bool onStart() override;
108
109 //! \brief Shuts down the driver and associated components
110 //! \return True if shutdown was successful
111 //!
112 //! Calls shutdown() on the DtPlayerStationApp instance and
113 //! deletes it, and calls shutdown() on the DtVreDebugManager.
114 virtual bool onStop() override;
115
116 //! \brief Updates the driver and associated components every frame
117 //! \return True if update was successful
118 //!
119 //! Calculates the time delta since the last frame, updates the
120 //! DtVreMessageManager and DtPlayerStationApp instances.
121 virtual bool onTick() override;
122
123protected:
124 //! \brief Registers all message types with the message factory
125 //!
126 //! Registers stock DtVreMessage class creators with the
127 //! DtVreMessageFactory instance to allow creation and processing of
128 //! all supported message types in the application.
130
131 //! \brief Logs graphics hardware and driver information
132 //!
133 //! Gathers vendor, renderer, OpenGL version, and driver information
134 //! and writes it to the application log file for diagnostic purposes.
135 virtual void logGraphics();
136
137 //! \brief Displays debug information about received messages
138 //!
139 //! Presents the set of all DtVreMessages received this frame
140 //! in the SHIFT+F4 Debug menu, including message types and counts.
141 virtual void debugCallback();
142
143protected:
144 //! \brief Reference to the VR-Vantage display engine instance
145 makVrv::DtDe& myDe;
146
147 //! \brief The player station application instance
148 //!
149 //! Represents the VR-Engage application as a whole
151
152 //! \brief The intersection handler for the application
153 //!
154 //! DtVrvIntersector instance created by this class for use throughout the application.
155 //! A pointer to it is stored in the DtPlayerStationApp instance's DtAttributeStore
156 //! under the name "DtIntersector".
158
159 //! \brief The entity resolution system for the application
160 //!
161 //! DtEntityResolver instance created for looking up various types of identifiers
162 //! objects may have in the application. A pointer to this instance is stored
163 //! in the DtPlayerStationApp instance's DtAttributeStore under the name "DtEntityResolver".
165};
166
167} // namespace makVre
Entity resolution and mapping system.
Definition entityResolver.h:52
Abstract base class for performing intersection tests in 3D space.
Definition intersector.h:37
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:163
DtPlayerStationApp * myApp
The player station application instance.
Definition vrvPlayerStationDriver.h:150
virtual ~DtPlayerStationDriver() override
Virtual destructor that cleans up resources.
DtEntityResolver * myEntityResolver
The entity resolution system for the application.
Definition vrvPlayerStationDriver.h:164
virtual bool onTick() override
Updates the driver and associated components every frame.
DtIntersector * myIntersector
The intersection handler for the application.
Definition vrvPlayerStationDriver.h:157
makVrv::DtDe & myDe
Reference to the VR-Vantage display engine instance.
Definition vrvPlayerStationDriver.h:145
virtual bool onStart() override
Initializes the driver and associated components.
virtual bool onStop() override
Shuts down the driver and associated components.
virtual void logGraphics()
Logs graphics hardware and driver information.
virtual void debugCallback()
Displays debug information about received messages.
virtual void setPlayerStationApp(makVre::DtPlayerStationApp *app)
Sets the player station application instance.
virtual void populateVreMessageFactory()
Registers all message types with the message factory.
virtual makVre::DtPlayerStationApp & playerStationApp()
Gets the current player station application instance.
DtPlayerStationDriver(makVrv::DtAgentManager &am)
Constructor that initializes the driver and associated resources.
virtual makVre::DtEntityResolver & connectionObjects()
Gets the entity resolver used by this driver.
virtual const std::string & className() const override
Gets the name of this C++ class.
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
Definition appLauncherComponent.h:28
Defines the DtPlayerStation class for managing engaged roles.
Defines the DtPlayerStationApp class for the VR-Engage application.