VR-Engage  2.3
Loading...
Searching...
No Matches
playerStationApp.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file playerStationApp.h
7//! \brief Defines the DtPlayerStationApp class for the VR-Engage application
8//!
9//! This file contains the top-level application class for VR-Engage, which manages
10//! player stations, components, plugins, and state transitions. It serves as the
11//! central hub for coordination between different parts of the application and
12//! provides access to various factories and managers.
13
14#pragma once
15
23
24#include "vreUtil/factory.h"
25#include "vreUtil/initializer.h"
26#include "vreUtil/attribute.h"
28
30
31#include <vrvCore/DtUniqueID.h>
32
33#include <vrvUtil/DtSignalConnectionManager.h>
34
35#include <vlutil/vlMutex.h>
36
37#include <map>
38#include <string>
39#include <vector>
40#include <list>
41#include <functional>
42
43class DtSimulationAddress;
44class DtFilename;
45struct lua_State;
46
47namespace makVrv
48{
49//! \brief Forward declaration of the display engine class
50class DtDe;
51
52//! \brief Forward declaration of the human command line processor class
53class DtHumanCommandLineProcessor;
54
55//! \brief Forward declaration of the observer class
56class DtObserver;
57
58//! \brief Forward declaration of the channel class
59class DtChannel;
60} // namespace makVrv
61
62namespace makVre
63{
64//! \brief Forward declaration of the player station class
65class DtPlayerStation;
66
68
69//! \brief Forward declaration of the player station application class
71
72//! \brief Forward declaration of the time source class
73class DtTimeSource;
74
75//! \brief Forward declaration of the player configuration dialog class
76class DtConfigurePlayerDialog;
77
78//! \brief Forward declaration of the entity resolver class
80
81//! \brief Forward declaration of the status listener class
82class DtVreStatusListener;
83
84//! \brief Forward declaration of the instrument panel manager class
86
87//! \brief Forward declaration of the input device factory class
89
90//! \brief Forward declaration of the input manager class
92
93//! \brief Forward declaration of the observer mode mapper class
95
96//! \brief Forward declaration of the sensor mode mapper class
98
99//! \brief Forward declaration of the application input logic class
101
102//! \brief Forward declaration of the input device class
103class DtInputDevice;
104
105// UI Classes
106//! \brief Forward declaration of the role selection panel class
108
109//! \brief Forward declaration of the temporary notification class
111
112// State Management
113//! \brief Forward declaration of the state manager class
115
116//! \brief Type definitions for factory classes
117//! @{
118
119//! \brief Factory type for player components
121
122//! \brief Factory type for connectors
124
125//! \brief Factory type for input devices
127//! @}
128
129//! \brief Enumeration of available sensor libraries for observer modes
130//!
131//! Defines which VR-Vantage sensor library is used for modeling different
132//! observer sensor modes (e.g., IR, night vision).
133using DtSensorLibrary = enum _DtSensorLibrary {
134 CAMERA_FX = 0, //!< Uses the Camera FX library for visual effects
135 SENSOR_FX //!< Uses the Sensor FX library for visual effects
136};
137
138//! \brief Enumeration for dimensionality of the view
139//!
140//! Defines whether the view is 2D or 3D. Used in various parts of the
141//! application to determine appropriate rendering modes and behaviors.
143{
144 Dt2D = 0, //!< 2D view (map/plan view)
145 Dt3D //!< 3D view (perspective view)
146};
147
148//! \brief Top-level class representing the VR-Engage application
149//!
150//! DtPlayerStationApp serves as the main coordinator for the VR-Engage application.
151//! It manages player stations, component factories, state transitions, and provides
152//! access to various application-wide services. This class is typically instantiated
153//! once per application instance and accessible via the static instance() method.
155{
156public:
157 //! \brief Constructor
158 //! \param de Reference to the VR-Vantage display engine
159 //!
160 //! Initializes the application with a reference to the display engine.
161 //! Creates the component factories, publishes the application through the App
162 //! attribute store, and prepares the application for initialization.
163 DtPlayerStationApp(makVrv::DtDe& de);
164
165 //! \brief Virtual destructor
166 //!
167 //! Cleans up resources and performs final shutdown operations.
169
170 //! \brief Gets the singleton instance of this class
171 //! \return Pointer to the application instance, or NULL if not yet created
172 //!
173 //! Provides global access to the application instance. Returns NULL if the
174 //! application has not yet been created. This is the preferred way to access
175 //! the application instance from anywhere in the codebase.
177
178 //! \brief Initializes the application
179 //!
180 //! Reads configuration data from playerStation.lua and initializes all application
181 //! subsystems, including the component factories, state manager, input manager,
182 //! and default player stations if configured. This must be called before the
183 //! application can be used.
184 virtual void initialize();
185
186 //! \brief Updates the application state
187 //! \param dt Time in seconds since the previous tick
188 //!
189 //! This method should be called periodically (typically once per frame) to update
190 //! the application state. It calls tick() on the top-level objects maintained by
191 //! this class, including the player creation palette, state manager, input manager,
192 //! and all active player stations. It also processes any deferred functions that
193 //! are ready to execute.
194 virtual void tick(double dt);
195
196 //! \brief Shuts down the application
197 //!
198 //! Calls shutdown on all top-level objects maintained by the application,
199 //! destroys all player stations, and releases resources. This should be
200 //! called before the application is destroyed to ensure clean termination.
201 //! Releases the App attribute-store handle during teardown.
202 virtual void shutdown();
203
204 //! \brief Initiates application termination
205 //!
206 //! Called when the user closes the application main window.
207 //!
208 //! Delegates to DtOwnershipTransferManager, which divests any owned
209 //! entities before allowing VR-Vantage to complete application shutdown.
210 virtual void quit();
211
212 //! \brief Gets the station-name string for this VR-Engage application instance
213 //! \return Station-name string for this application instance
214 //!
215 //! Returns the initial station-name string used to identify this VR-Engage
216 //! application instance. The value comes from the --stationName startup
217 //! parameter if provided, otherwise falls back to the local hostname.
218 //! This is the raw name string, not a hash or UUID.
219 virtual std::string engageStationId();
220
221 //! \brief Gets a reference to the VR-Vantage display engine
222 //! \return Reference to the display engine
223 //!
224 //! Provides access to the VR-Vantage display engine, which is valid over the
225 //! lifetime of the application. The display engine is used for rendering and
226 //! managing the visual components of the application.
227 virtual makVrv::DtDe& de();
228
229 //! \brief Gets the application initializer
230 //! \return Reference to the initializer instance
231 //!
232 //! The initializer is responsible for loading the Lua configuration files used to
233 //! initialize the application. It holds the configuration data defined in
234 //! appData\scripts\playerStation.lua, which is used throughout the application
235 //! to configure components, connectors, and application behavior.
237
238 //! \brief Gets the startup configuration data
239 //! \return Table of startup configuration data
240 //!
241 //! Returns the configuration data for the startupConfiguration table in playerStation.lua.
242 //! This includes settings such as default observer modes, window positions, and
243 //! initial application state.
245
246 //! \brief Applies the rewind policy.
247 //! \param assignment Role assignment, including whether it originated from rewind.
248 //! \return True for ordinary assignments or when automatic rewind reengagement is enabled.
250
251 //! \brief Finds a named initialization table
252 //! \param name Name of the table to find
253 //! \return The initialization table with the given name, or an empty table if not found
254 //!
255 //! Looks up a table data member corresponding to a Lua table entry in playerStation.lua.
256 //! This provides access to specific configuration sections without having to navigate
257 //! through the entire configuration hierarchy.
258 virtual DtInitTable findInitTable(const std::string& name);
259
260 //! \brief Gets the player creation palette
261 //! \return Reference to the player creation palette
262 //!
263 //! Returns the palette of VR-Engagable entities that can be created. The palette
264 //! contains information about available player roles and their configurations.
265 //! This reference is valid for the lifetime of the application.
267
268 //! \brief Gets the role selection panel
269 //! \return Pointer to the choose role panel
270 //!
271 //! Returns the window containing the creation palette and controls for configuring
272 //! player roles. This panel is used to select and configure new player stations.
274
275 //! \brief Gets the current sensor library
276 //! \return The sensor library currently in use (CAMERA_FX or SENSOR_FX)
277 //!
278 //! Returns the sensor library currently in use for the application, which determines
279 //! how visual effects like night vision and thermal imaging are rendered.
281
282 //! \brief Checks if the application window is being dragged
283 //! \return True if the window is being dragged, false otherwise
284 //!
285 //! Determines whether the application window is currently being dragged
286 //! in the display, which may affect input handling and rendering.
287 virtual bool isDragging();
288 //! \brief Sets the dragging state of the application window
289 //! \param dragging True to indicate dragging is active, false otherwise
290 //!
291 //! Updates the internal state that tracks whether the application window
292 //! is currently being dragged in the display.
293 virtual void setIsDragging(bool dragging);
294
295 //! \brief Gets the component factory
296 //! \return Reference to the component factory
297 //!
298 //! Returns the factory for creating DtComponent class objects. Components
299 //! are the building blocks that make up a player role, providing specific
300 //! functionality such as movement, weapons, and sensors.
302
303 //! \brief Gets the connector factory
304 //! \return Reference to the connector factory
305 //!
306 //! Returns the factory for creating DtConnector class objects. Connectors
307 //! handle communication between the application and external systems or
308 //! simulation entities.
310
311 //! \brief Gets the input device factory
312 //! \return Pointer to the input device factory
313 //!
314 //! Returns the factory for creating DtInputDevice class objects. Input devices
315 //! handle user interaction through various peripherals like keyboards, mice,
316 //! joysticks, and other specialized hardware.
318
319 //! \brief Creates a new player station with specific settings
320 //! \param id The SISO entity identifier of the entity to be created
321 //! \param station The name of the station to create
322 //! \param displayLayout The name of the display layout to use
323 //! \return Pointer to the newly created player station, or nullptr on failure
324 //!
325 //! Factory function that creates a DtPlayerStation with the specified entity
326 //! ID, station type, and display layout. Runs preInit() only; the caller
327 //! completes initialization via the deferred pipeline. The created station
328 //! is owned by the application and will be destroyed when the application
329 //! shuts down.
331 const DtEntityIdentifier& id, const std::string& station, const std::string& displayLayout);
332
333 //! \brief Destroys all player stations
334 //! \return True if any player stations were destroyed, false otherwise
335 //!
336 //! Removes and destroys all active player stations, freeing their resources.
337 virtual bool destroyPlayerStation();
338
339 //! \brief Destroys a specific player station by entity identifier
340 //! \param entityId The entity identifier of the player station to destroy
341 //! \return True if the player station was found and destroyed, false otherwise
342 //!
343 //! Removes and destroys a player station with the specified entity identifier.
344 virtual bool destroyPlayerStation(const DtEntityIdentifier&);
345
346 //! \brief Destroys a specific player station by entity identifier and role name
347 //! \param entityId The entity identifier of the player station to destroy
348 //! \param roleName The name of the role to destroy
349 //! \return True if the player station was found and destroyed, false otherwise
350 //!
351 //! Removes and destroys a player station matching both the specified entity identifier and role name.
352 virtual bool destroyPlayerStation(const DtEntityIdentifier&, const std::string& roleName);
353
354 //! \brief Finds a player station by entity identifier and role name
355 //! \param entityId The entity identifier to search for
356 //! \param roleName The role name to search for
357 //! \return Pointer to the found player station, or NULL if not found
358 //!
359 //! Searches for a player station that matches both the specified entity identifier and role name.
360 virtual DtPlayerStation* findPlayerStation(const DtEntityIdentifier&, const std::string& roleName);
361
362 //! \brief Finds the first player station in the list
363 //! \return Pointer to the first player station, or NULL if none exist
364 //!
365 //! Returns the first player station in the player list. Used as a convenience method
366 //! when the application only has a single player station.
368 //! \brief Finds a player station at a specific index
369 //! \param index The index in the player list
370 //! \return Pointer to the player station at the specified index, or NULL if index is out of range
371 //!
372 //! Returns the player station at the specified index in the player list.
373 virtual DtPlayerStation* findPlayerAt(int index);
374 //! \brief Finds a player station by entity identifier
375 //! \param entityId The entity identifier to search for
376 //! \return Pointer to the found player station, or NULL if not found
377 //!
378 //! Searches for a player station with the specified entity identifier.
379 virtual DtPlayerStation* findPlayer(const DtEntityIdentifier&);
380 //! \brief Finds a player station by element ID
381 //! \param elementId The VR-Vantage element ID to search for
382 //! \return Pointer to the found player station, or NULL if not found
383 //!
384 //! Searches for a player station with the specified VR-Vantage element ID.
385 virtual DtPlayerStation* findPlayer(makVrv::DtElementID);
386 //! \brief Gets the list of all player stations
387 //! \return Reference to the list of player stations
388 //!
389 //! Returns a reference to the internal list of all active player stations.
390 //! This list is valid for the duration of the application.
391 virtual std::list<DtPlayerStation*>& players();
392 //! \brief Removes all player stations from the list without destroying them
393 //!
394 //! Clears the internal player stations list without destroying the player station objects.
395 //! This is typically used during cleanup operations.
396 virtual void clearPlayers();
397 //! \brief Sets the entity to which the observer is attached
398 //! \param entityId The entity identifier to attach to
399 //!
400 //! Updates the entity to which the primary observer is attached.
401 //! When attached, the observer will follow this entity's movements.
402 virtual void setAttachEntity(DtEntityIdentifier const& entityId);
403 //! \brief Gets the entity to which the observer is currently attached
404 //! \return The entity identifier of the attached entity
405 //!
406 //! Returns the identifier of the entity to which the primary observer is currently attached.
407 //! Returns an invalid identifier if the observer is not attached to any entity.
408 virtual DtEntityIdentifier getAttachEntity();
409
410 //! \brief Detaches the observer if it is attached to the specified element
411 //! \param elementId The element ID to check
412 //!
413 //! If the observer is attached to the given element ID, this method detaches it,
414 //! allowing free movement of the observer. This is typically called when an entity
415 //! is about to be removed from the simulation.
416 virtual void detatchObserverIfAttachedTo(makVrv::DtElementID);
417
418 //! \brief Centers the observer on the terrain
419 //!
420 //! Positions the primary observer over the center of the terrain
421 //! at a predefined height. This is typically used to get a broad overview
422 //! of the simulation area.
424
425 //! \brief Makes the observer look at multiple entities
426 //! \param entityIds Vector of entity identifiers to look at
427 //!
428 //! Positions and orients the primary observer to view all of the specified entities.
429 //! The observer will be positioned to keep all entities in view.
430 virtual void observerLookAt(const std::vector<DtEntityIdentifier>&);
431
432 //! \brief Makes the observer look at a single entity
433 //! \param entityId Entity identifier to look at
434 //!
435 //! Positions and orients the primary observer to view the specified entity.
436 //! The observer's position is adjusted to provide a good view of the entity.
437 virtual void observerLookAt(const DtEntityIdentifier&);
438
439 //! \brief Makes the observer follow an entity
440 //! \param entityId Entity identifier to follow
441 //!
442 //! Attaches the primary observer to the specified entity, causing it to
443 //! follow the entity's movements while maintaining a fixed relative position.
444 virtual void observerFollow(const DtEntityIdentifier&);
445
446 //! \brief Detaches the observer from any entity it may be following
447 //!
448 //! Releases the primary observer from attachment to any entity,
449 //! allowing it to be moved independently.
450 virtual void observerDetach();
451 //! \brief Checks if the observer has a default position
452 //! \param outName Optional parameter to receive the name of the default position
453 //! \return True if a default position exists, false otherwise
454 //!
455 //! Determines whether a default position has been defined for the primary observer.
456 //! If outName is provided, it will be filled with the name of the default position.
457 virtual bool observerHasDefault(std::string* outName = NULL);
458
459 //! \brief Resets the observer to its default position
460 //!
461 //! Returns the primary observer to its default position and orientation.
462 //! If no default has been set, this may place the observer at a predefined location.
463 virtual void observerReset();
464
465 //! \brief Resets the view in the Choose Role panel
466 //!
467 //! If the Choose Role Panel is visible, calls slot_onResetViewClicked()
468 //! to reset the view to its default state. This is typically used to
469 //! return to the initial view when selecting a role.
470 virtual void resetView();
471
472 //! \brief Gets the name of the application-level observer
473 //! \return String containing the name of the primary observer
474 //!
475 //! Returns the name of the application-level observer, which is typically "Observer 1".
476 //! This is the primary observer used for the main view in the application.
477 virtual std::string observerName() const;
478
479 //! \brief Sets the current player station type name
480 //! \param playerType The name of the player station type
481 //!
482 //! Sets the type name for the current player station, such as "Pilot",
483 //! "Human", "Vehicle Driver", etc. This name is used to identify
484 //! the station type in the UI and in status messages.
485 virtual void setPlayerStationName(const std::string& playerType);
486
487 //! \brief Sets the display layout for the current player station
488 //! \param displayLayout The name of the display layout to use
489 //!
490 //! Sets the display layout for the current player station. The display layout
491 //! defines how the UI is arranged, including panels, controls, and views.
492 virtual void setPlayerStationDisplayLayout(const std::string& displayLayout);
493
494 //! \brief Gets the current player station type name
495 //! \return Constant reference to the player station type name string
496 //!
497 //! Returns the type name of the current player station, such as "Pilot",
498 //! "Human", "Vehicle Driver", etc.
499 virtual std::string const& getPlayerStationName() const;
500
501 //! \brief Gets the current player station display layout
502 //! \return Constant reference to the display layout name string
503 //!
504 //! Returns the name of the display layout currently in use by the player station.
505 virtual std::string const& getPlayerStationDisplayLayout() const;
506
507 //! \brief Runs the simulation
508 //!
509 //! Starts or resumes the simulation from its current state. This method
510 //! sends messages to connected systems to synchronize the simulation state.
511 virtual void run();
512
513 //! \brief Pauses the simulation
514 //!
515 //! Pauses the simulation, freezing all simulation time and dynamics updates
516 //! while maintaining the current state. This method sends messages to
517 //! connected systems to synchronize the pause state.
518 virtual void pause();
519
520 //! \brief Rewinds the simulation
521 //!
522 //! Rewinds the simulation to its initial state. This is typically used
523 //! in recorded or scenario playback modes to restart from the beginning.
524 //! This method sends messages to connected systems to synchronize the rewind.
525 virtual void rewind();
526
527 //! \brief Sets the play fullscreen mode
528 //! \param fullscreen True to enable fullscreen mode, false to disable it
529 //!
530 //! Controls whether the application should use the full screen when in play mode.
531 //! This affects how the application displays when transitioning to engaged state.
532 virtual void setPlayFullScreen(bool fullscreen);
533
534 //! \brief Gets the play fullscreen mode setting
535 //! \return True if play fullscreen mode is enabled, false otherwise
536 //!
537 //! Returns whether the application is configured to use the full screen when in play mode.
538 virtual bool getPlayFullScreen();
539
540 //! \brief Sets the application's fullscreen state
541 //! \param fullscreen True to enable fullscreen mode, false to disable it
542 //!
543 //! Immediately changes the application between fullscreen and windowed mode.
544 //! This affects the current display mode regardless of application state.
545 virtual void setFullScreen(bool fullscreen);
546
547 //! \brief Checks if the application is currently in fullscreen mode
548 //! \return True if the application is fullscreen, false if it's windowed
549 //!
550 //! Returns whether the application is currently displayed in fullscreen mode.
551 virtual bool isFullScreen();
552
553 //! \brief Sets the current mode of the application
554 //! \param mode The application mode to set (e.g., "Admin", "Player")
555 //! \param changeMenus Whether to update the menus based on the new mode (default: true)
556 //! \param isInitialSet Whether this is the initial setting of the mode (default: false)
557 //! \return True if the mode was successfully set, false otherwise
558 //!
559 //! Changes the current application mode, which affects available features and UI elements.
560 //! Different modes provide different access levels and functionality.
561 virtual bool setAppMode(const std::string& mode, bool changeMenus = true, bool isInitialSet = false);
562
563 //! \brief Gets the current application mode
564 //! \return Constant reference to the current application mode string
565 //!
566 //! Returns the current operating mode of the application, such as "Admin" or "Player".
567 virtual std::string const& getAppMode() const;
568
569 //! \brief Toggles between available application modes
570 //!
571 //! Switches the application between available modes, typically toggling
572 //! between "Admin" and "Player" modes. This affects the available
573 //! features and UI elements.
574 virtual void toggleAppMode();
575
576 //! \brief Updates the application menus based on the specified mode
577 //! \param appMode The application mode to update menus for
578 //!
579 //! Updates the application menu structure and visibility based on the
580 //! specified application mode. Different modes have different menu options available.
581 virtual void updateMenus(const std::string& appMode);
582
583 //! \brief Enables or disables admin mode
584 //! \param enabled True to enable admin mode, false to disable it
585 //!
586 //! Controls whether administrative features are available in the application.
587 //! Admin mode provides access to additional configuration and debug options.
588 virtual void setAdminModeEnabled(bool enabled);
589
590 //! \brief Checks if admin mode is enabled
591 //! \return True if admin mode is enabled, false otherwise
592 //!
593 //! Determines whether the application currently has administrative features enabled.
594 virtual bool isAdminModeEnabled();
595
596 //! \brief Spectator mode functions
597 //! @{
598
599 //! \brief Checks if spectator mode is active
600 //! \return True if spectator mode is enabled, false otherwise
601 //!
602 //! Determines whether the application is in spectator mode, which blocks
603 //! all input except view controls, allowing passive observation only.
604 virtual bool isSpectator();
605
606 //! \brief Sets spectator mode state
607 //! \param value True to enable spectator mode, false to disable it
608 //!
609 //! Enables or disables spectator mode, which blocks all input except view
610 //! controls when enabled, allowing passive observation only.
611 virtual void setSpectator(bool value);
612 //! @}
613
614 //! \brief Role mode functions
615 //! @{
616
617 //! \brief Checks if fixed role mode is enabled
618 //! \return True if fixed role mode is enabled, false otherwise
619 //!
620 //! Determines whether the application is in fixed role mode, which restricts
621 //! the user to a predetermined role rather than allowing role selection.
622 virtual bool fixedRoleMode();
623
624 //! \brief Sets the fixed role mode state
625 //! \param on True to enable fixed role mode, false to disable it
626 //!
627 //! Controls whether the application uses a fixed, predetermined role
628 //! rather than allowing the user to select from available roles.
629 virtual void setFixedRole(bool on = true);
630 //! @}
631
632 //! \brief Checks if VR support is available
633 //! \return True if virtual reality is available, false otherwise
634 //!
635 //! Determines whether VR hardware and software support is available
636 //! in the current runtime environment.
638
639 //! \brief Checks if VRV controls are enabled
640 //! \return True if VRV controls are enabled, false otherwise
641 //!
642 //! Determines whether VR-Vantage specific controls are currently enabled
643 //! in the application interface.
644 virtual bool isVRVControlsEnabled();
645
646 //! \brief Checks if the 3D role selection panel is enabled
647 //! \return True if the 3D panel is enabled, false if using 2D panel
648 //!
649 //! Determines whether the application is using a 3D or 2D version of
650 //! the role selection panel interface.
651 virtual bool isChooseRolePanel3D();
652
653 //! \brief Gets the application state manager
654 //! \return Reference to the state manager
655 //!
656 //! Provides access to the state manager, which controls application
657 //! state transitions and maintains the state stack.
659
660 //! \brief Gets the input manager
661 //! \return Reference to the input manager
662 //!
663 //! Provides access to the input manager, which handles user input
664 //! from various devices and dispatches input events.
666
667 //! \brief Gets the chat manager
668 //! \return Reference to the chat manager
669 //!
670 //! Provides access to the chat manager, which handles message routing,
671 //! channel management, and slash-command registration for the chat system.
673
674 //! \brief Checks if an entity type is allowed
675 //! \param entityType The entity type to check
676 //! \return True if the entity type is allowed, false otherwise
677 //!
678 //! Determines whether the specified entity type is allowed to be
679 //! created or used in the current application configuration.
680 bool isTypeAllowed(DtEntityType entityType);
681
682 //! \brief Sets the observer mode for play state
683 //! \return True if the observer mode was set successfully, false otherwise
684 //!
685 //! Configures the observer mode that will be used when in the play state,
686 //! based on the current sensor library configuration.
688
689 //! \brief Sets the observer mode for non-play states
690 //! \param dimensionality Specifies whether to use 2D or 3D mode
691 //! \return True if the observer mode was set successfully, false otherwise
692 //!
693 //! Configures the observer mode that will be used when in non-play states
694 //! (such as role selection), based on the specified dimensionality and
695 //! the current sensor library configuration.
696 virtual bool setNonPlayStateObserverMode(enum DtDimensionality dimensionality);
697
698 //! \brief Gets the observer mode mapper
699 //! \return Pointer to the observer mode mapper
700 //!
701 //! Returns the utility class used to map generic VR-Engage observer mode names
702 //! to concrete VR-Vantage observer mode names, based on the current sensor library.
703 //! The mappings used by this class are defined in vreObserverModeMapper in playerStation.lua.
705
706 //! \brief Gets the sensor mode mapper
707 //! \return Pointer to the sensor mode mapper
708 //!
709 //! Returns the utility class used to map generic VR-Engage sensor mode names
710 //! to concrete VR-Vantage sensor mode names, based on the current sensor library.
711 //! The mappings used by this class are defined in vreSensorModeMapper in playerStation.lua.
713
714 //! \brief Gets the temporary notification handler
715 //! \return Pointer to the temporary notification handler
716 //!
717 //! Returns the handler for showing temporary notifications in the UI.
719
720 //! \brief Increments the active HUD texture count
721 //! \param textureID ID of the texture to increment
722 //! \return Current count after incrementing
723 //!
724 //! Increases the reference count for a HUD texture and returns the new count.
725 int incrementActiveHudTexture(int textureID);
726
727 //! \brief Decrements the active HUD texture count
728 //! \param textureID ID of the texture to decrement
729 //! \return Current count after decrementing
730 //!
731 //! Decreases the reference count for a HUD texture and returns the new count.
732 int decrementActiveHudTexture(int textureID);
733
734 //! \brief Gets the current HUD texture count
735 //! \param textureID ID of the texture to query
736 //! \return Current reference count for the texture
737 //!
738 //! Returns the current reference count for a specific HUD texture ID.
739 int getActiveHudTextureCount(int textureID);
740
741 //! \brief Air mode functions
742 //! @{
743
744 //! \brief Checks if air mode is enabled
745 //! \param b Optional parameter to check alternate state
746 //! \return True if air mode is enabled, false otherwise
747 static bool isAirEnabled(bool b = false);
748
749 //! \brief Checks if air-only mode is active
750 //! \return True if only air mode is enabled, false otherwise
751 static bool isAirOnly();
752 //! @}
753
754 //! \brief Ground mode functions
755 //! @{
756
757 //! \brief Checks if ground mode is enabled
758 //! \param b Optional parameter to check alternate state
759 //! \return True if ground mode is enabled, false otherwise
760 static bool isGroundEnabled(bool b = false);
761
762 //! \brief Checks if ground-only mode is active
763 //! \return True if only ground mode is enabled, false otherwise
764 static bool isGroundOnly();
765 //! @}
766
767 //! \brief Sensor mode functions
768 //! @{
769
770 //! \brief Checks if sensor mode is enabled
771 //! \param b Optional parameter to check alternate state
772 //! \return True if sensor mode is enabled, false otherwise
773 static bool isSensorEnabled(bool b = false);
774
775 //! \brief Checks if sensor-only mode is active
776 //! \return True if only sensor mode is enabled, false otherwise
777 static bool isSensorOnly();
778 //! @}
779
780 //! \brief Checks if combined mode is active
781 //! \return True if combined mode is active, false otherwise
782 //!
783 //! Determines whether the application is in combined mode,
784 //! which allows multiple role types simultaneously.
785 static bool isCombinedMode();
786
787 //! \brief Signal for menu bar visibility changes
788 boost::signalslib::signal<void()> signal_menuBarVisibilityChanged;
789
790 //! \brief Checks if the menu bar is visible
791 //! \return True if the menu bar is visible, false otherwise
792 //!
793 //! Determines whether the application menu bar is currently visible.
794 virtual bool isMenuBarVisible() const;
795
796 //! \brief Checks if ImGui is visible
797 //! \return True if ImGui is visible, false otherwise
798 //!
799 //! Determines whether ImGui debug interface is currently visible.
801
802 //! \brief Returns a handle for the App level Attribute store
803 //!
804 //! This is an convenience handle to DtAttribute::Root()["App"], where application-level attributes are stored.
806
807 //! \brief Const version of @ref appAttributeStore
809
810 //! \brief Returns a handle for the Entity State Attribute store
811 //!
812 //! This is a convenience handle to DtAttribute::Root()["Entities"], where entity state attributes can be accessed.
813 //!
814 //! Values in this branch of the Attribute system are Read Only. Values are and should only be set by
815 //! DtReflectedEntityConnector. Values are set on-demand, where interest is indicated by the presence of an
816 //! attribute handlel to a specific propery. To query an entity position, for example, create and hold a
817 //! handle to entityStateStore()["{entityId}"]["location"]. The value will be set on the next Net thread tick.
819
820 //! \brief Defers a function to be executed after a number of ticks
821 //! \param f Function to execute
822 //! \param delayInTicks Number of ticks to wait before execution (default: 0)
823 //!
824 //! Schedules a function to be executed after the specified number of ticks.
825 void deferFunction(std::function<void()> f, int delayInTicks = 0);
826
827 //! \brief Defers a function to be executed after a time delay
828 //! \param f Function to execute
829 //! \param delayInSeconds Seconds to wait before execution
830 //!
831 //! Schedules a function to be executed after the specified time delay in seconds.
832 void deferFunction(std::function<void()> f, double delayInSeconds);
833
834 //! \brief Ownership Transfer manager accessor
835 //! @{
836
837 //! \brief Returns the ownership transfer manager.
838 //!
839 //! Provides access to ownership-transfer policy, request ID allocation,
840 //! and the exit-time divest workflow. Returns nullptr before
841 //! loadOwnershipTransferConfiguration() has been called.
843 //! @}
844
845 //! \brief Shows or hides the VR-Vantage status bar.
846 //!
847 //! Controls the visibility of the underlying VR-Vantage display engine
848 //! status bar. Hidden by default during VR-Engage initialization.
849 //!
850 //! \param on True to show the status bar, false to hide it.
851 virtual void setVRVStatusBarShown(bool on);
852
853protected:
854 //! \brief Sets the observer mode for the primary observer
855 //! \param name Name of the observer mode to set
856 //! \return Pointer to the observer, or NULL if not found
857 //!
858 //! Sets the observer mode for "Observer 1", the main application observer.
859 virtual makVrv::DtObserver* setObserverMode(const std::string& name);
860
861 //! \brief Finds the main rendering channel
862 //!
863 //! Locates and stores a reference to the main rendering channel used by
864 //! the application. The main rendering channel is responsible for the
865 //! primary visualization window.
866 virtual void findMainRenderChannel();
867
868 //! \brief Updates the status publisher with current state
869 //!
870 //! Updates the status publisher with the current application state,
871 //! including active player stations and their entities. This information
872 //! is broadcast to other components in the distributed simulation.
873 virtual void updateStatusPublisher();
874
875 //! \brief Initializes virtual reality support
876 //!
877 //! Sets up the virtual reality subsystem if VR hardware is available.
878 //! This includes initializing the VR drivers and configuring the display
879 //! settings for VR mode.
881
882 //! \brief Initializes the minion monitor
883 //!
884 //! Sets up the monitoring system for minion mode operation. In minion mode,
885 //! this instance of VR-Engage follows the state of a "boss" instance and
886 //! automatically synchronizes with its actions.
888
889 //! \brief Monitors the status of the boss station in minion mode
890 //! \param changed Handle to the attribute that changed inside vreStatus/stations
891 //!
892 //! Invoked via myMinionBossCallback whenever the remote-station attribute subtree
893 //! changes. Scans all entries in vreStatus/stations looking for the configured
894 //! boss station and, when it finds a boss engaged to a different entity than this
895 //! station, sends a VreAssignRolePlayerMessage to follow the boss.
897
898 //! \brief Requests the boss station to forward messages
899 //! \param message The subscription request message
900 //! \return Message result indicating how the message was handled
901 //!
902 //! If this station is in minion mode, requests the boss station to
903 //! forward messages of the specified type to this station.
905
906 //! \brief Requests the boss station to stop forwarding messages
907 //! \param message The unsubscription request message
908 //! \return Message result indicating how the message was handled
909 //!
910 //! If this station is in minion mode, requests the boss station to
911 //! stop forwarding messages of the specified type to this station.
913
914 //! \brief Handles session SMS list messages
915 //! \param message The session SMS list message
916 //! \return Message result indicating how the message was handled
917 //!
918 //! Processes messages containing the list of simulation model sets (SMS)
919 //! available in the current session.
921
922 //! \brief Loads ownership transfer configuration from the OwnershipTransfer Lua table
923 //!
924 //! Creates the ownership-transfer manager through its factory and populates
925 //! it from the \c OwnershipTransfer table in the main initializer. Publishes
926 //! its non-owning pointer at \c App.ownershipTransferManager for connectors.
928
929 virtual void debugCallback();
930
931protected:
932 //! \brief Single instance of the application
933 //!
934 //! Static pointer to the singleton instance of the application. Used by the
935 //! static instance() method to provide global access to the application.
937
938 //! \brief Temporary notification handler
939 //!
941
942 //! \brief Initializers and configuration
943 //! @{
944
945 //! \brief Lua configuration initializer
946 //!
947 //! Responsible for loading and parsing Lua configuration files.
949
950 //! \brief Startup configuration table
951 //!
952 //! Contains the startup configuration data from playerStation.lua.
954
955 //! \brief Minion mode configuration table
956 //!
957 //! Contains configuration data for minion mode operation.
959
960 //! \brief Entity resolver
961 //!
962 //! Resolves entity identifiers to entity instances.
964 //! @}
965
966 //! \brief Application managers
967 //! @{
968
969 //! \brief Instrument panel manager
970 //!
971 //! Manages the creation and arrangement of instrument panels in the UI.
973
974 //! \brief Frontend plugin manager.
975 //!
976 //! Owns loaded frontend plugin DLLs for the lifetime of the application.
977 std::unique_ptr<DtVrePluginManager> myPluginManager;
978
979 //! \brief Signal connection manager
980 //!
981 //! Manages signal connections between components in the application.
982 makVrv::DtSignalConnectionManager myConnections;
983
984 //! \brief State manager
985 //!
986 //! Manages application state transitions and maintains the state stack.
988
989 //! \brief Input manager
990 //!
991 //! Handles user input from various devices and dispatches input events.
993
994 //! \brief Input logic handler
995 //!
996 //! Implements application-specific input handling logic.
998 //! @}
999
1000 //! \brief Factory objects
1001 //! @{
1002
1003 //! \brief Component factory
1004 //!
1005 //! Creates player component instances based on registered component classes.
1007
1008 //! \brief Connector factory
1009 //!
1010 //! Creates connector instances based on registered connector classes.
1012
1013 //! \brief Input device factory
1014 //!
1015 //! Creates input device instances based on registered device classes.
1017 //! @}
1018
1019 //! \brief Chat manager
1020 //!
1021 //! Owns the chat manager instance for this player station application.
1023
1024 //! \brief List of active player stations
1025 //!
1026 //! Contains pointers to all active player stations managed by the application.
1027 //! This list is used for managing embarkation and assumptions are made
1028 //! that this list represents an embarkation stack.
1029 std::list<DtPlayerStation*> myPlayers;
1030
1031 //! \brief Menu bar visibility state
1032 //!
1033 //! Tracks whether the application menu bar is currently visible.
1035
1036 //! \brief Full screen mode state for play mode
1037 //!
1038 //! Controls whether the application uses the full screen when in play mode.
1040
1041 //! \brief Spectator mode state
1042 //!
1043 //! When true, blocks all input except view controls. Spectator mode allows
1044 //! passive observation of the simulation without player interaction.
1046
1047 //! \brief Entity identifier for the owned entity
1048 //!
1049 //! The identifier for the application's primary entity. The application
1050 //! is allowed to create only one own entity.
1051 DtEntityIdentifier myOwnEntityId;
1052
1053 //! \brief Resource mutex
1054 //!
1055 //! Protects shared resources from concurrent access.
1057
1058 //! \brief Reference to the VR-Vantage display engine
1059 //!
1060 //! Provides access to the rendering engine and window management.
1061 makVrv::DtDe& myDe;
1062
1063 //! \brief Current player station type name
1064 //!
1065 //! The type name of the current player station, such as "Pilot" or "Vehicle Driver".
1067
1068 //! \brief Current display layout name
1069 //!
1070 //! The name of the display layout currently in use by the player station.
1072
1073 //! \brief Admin mode variables
1074 //! @{
1075
1076 //! \brief Current application mode
1077 //!
1078 //! The current operating mode of the application, such as "Admin" or "Player".
1079 std::string myAppMode;
1080
1081 //! \brief Previous application mode
1082 //!
1083 //! Stores the previous application mode, used when toggling between modes.
1084 std::string myOldAppMode;
1085
1086 //! \brief Admin mode enabled state
1087 //!
1088 //! Controls whether administrative features are available in the application.
1090 //! @}
1091
1092 //! \brief Debug mode state
1093 //!
1094 //! When true, enables additional debug output and functionality.
1096
1097 //! \brief Player creation palette
1098 //!
1099 //! Contains information about available player roles and their configurations.
1100 //! Used for the role selection interface.
1102
1103 //! \brief Role selection panel
1104 //!
1105 //! Panel used for selecting and configuring player roles.
1107
1108 //! \brief Fixed role mode state
1109 //!
1110 //! When true, the application uses a predetermined role rather than
1111 //! allowing the user to select from available roles.
1113
1114 //! \brief Window dragging state
1115 //!
1116 //! Tracks whether the application window is currently being dragged.
1118
1119 //! \brief VR-Vantage controls state
1120 //!
1121 //! Controls whether VR-Vantage specific controls are enabled in the interface.
1123
1124 //! \brief 3D role panel state
1125 //!
1126 //! When true, uses a 3D version of the role selection panel interface.
1127 //! When false, uses a 2D panel.
1129
1130 //! \brief Current sensor library in use
1131 //!
1132 //! The sensor library currently in use for the application (CAMERA_FX or SENSOR_FX).
1133 //! Default is CAMERA_FX. Specify --enableSensorFX on the command line to switch to use
1134 //! SENSOR_FX instead. This determines how visual effects like night vision and
1135 //! thermal imaging are rendered.
1137
1138 //! \brief Local station status attribute subtree
1139 //!
1140 //! Handle for appAttributeStore()["vreStatus"]["local"]. The main thread writes
1141 //! all local-station fields here each tick. The connector layer reads this subtree
1142 //! to build and send outbound status heartbeats.
1144
1145 //! \brief Attribute change callback for minion mode boss monitoring
1146 //!
1147 //! Connected to appAttributeStore()["vreStatus"]["stations"] during
1148 //! initMinionMonitor(). Fires minionModeBossMonitor() on the main thread
1149 //! whenever any remote station's status field is updated.
1151
1152 //! \brief Observer modes for different states
1153 //! @{
1154
1155 //! \brief Observer mode for 2D non-play states
1156 //!
1157 //! Observer mode to use while in the choosing role state when using 2D view.
1159
1160 //! \brief Observer mode for 3D non-play states
1161 //!
1162 //! Observer mode to use while in the choosing role state when using 3D view.
1164
1165 //! \brief Observer mode for play state
1166 //!
1167 //! Observer mode to use while in the play state (always 3D).
1169 //! @}
1170
1171 //! \brief Observer and sensor mode mappers
1172 //! @{
1173
1174 //! \brief Observer mode mapper
1175 //!
1176 //! Utility class that maps a given key string representing a generic
1177 //! VR-Vantage Observer mode name (not specific to a camera FX or sensor FX library)
1178 //! to the specific VR-Vantage observer mode name appropriate for the sensor
1179 //! library currently loaded in the application. The key string is used in VR-Engage
1180 //! as a way to represent an observer mode in a sensor-library independent manner.
1181 //! Note that the use of the key string is only appropriate for use within the
1182 //! VR-Engage API. It must be translated into a real VR-Vantage observer mode name
1183 //! by this utility class any time it is used in the VR-Vantage API.
1185
1186 //! \brief Sensor mode mapper
1187 //!
1188 //! Utility class that maps a given key string representing generic VR-Vantage Sensor
1189 //! mode name. It is similar in purpose and function to myVreObserverModeMapper, except
1190 //! that instead of a generic mapping of observer mode names, it provides a generic
1191 //! mapping of sensor mode names, between a VR-Engage generic key string and concrete
1192 //! VR-Vantage sensor mode names.
1194 //! @}
1195
1196 //! \brief Application-level observer name
1197 //!
1198 //! Observer name for application-level observer (as opposed to any secondary
1199 //! additional observers that get created for particular roles). By default the
1200 //! observer name is "Observer 1".
1201 std::string myObserverName;
1202
1203 //! \brief HUD texture reference count map
1204 //!
1205 //! Tracking map for how many HUDs are drawing each offscreen texture.
1206 //! Used to manage the lifecycle of shared textures.
1207 std::map<int, int> myActiveHudTextureLookup;
1208
1209 //! \brief Handle for App level Attributes
1210 //!
1211 //! Convenience handle to DtAttribute::Root()["App"], where application-level attributes are stored.
1212 //! \vreAttrKey{App}
1214
1215 //! \brief Handle for Entity State Attributes
1216 //!
1217 //! Convenience handle to DtAttribute::Root()["Entities"], where entity state attributes can be accessed.
1218 //!
1219 //! Values in this branch of the Attribute system are Read Only. Values are and should only be set by
1220 //! DtReflectedEntityConnector. Values are set on-demand, where interest is indicated by the presence of an
1221 //! attribute handlel to a specific propery. To query an entity position, for example, create and hold a
1222 //! handle to entityStateStore()["{entityId}"]["location"]. The value will be set on the next Net thread tick.
1224
1225 //! \brief Ownership transfer manager loaded from the OwnershipTransfer Lua table
1226 //!
1227 //! Created via DtOwnershipTransferManager::create() and populated by
1228 //! parseConfiguration() inside loadOwnershipTransferConfiguration() during initialize().
1230
1232};
1233} // namespace makVre
Provides attribute handling system for hierarchical data storage and manipulation.
Scoped attribute change callback wrapper.
Definition attributeCallback.h:101
Handle class for safe access to attributes.
Definition attributeHandle.h:30
Type-specific handle class for attributes.
Definition attributeHandle.h:229
UI panel for selecting and engaging with entities and roles.
Definition chooseRolePanel.h:60
Entity resolution and mapping system.
Definition entityResolver.h:52
Factory class for creating objects of different derived types.
Definition factory.h:81
Definition functionQueue.h:26
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Configuration initializer for VREngage components.
Definition initializer.h:80
Factory for creating input device instances.
Definition inputDeviceFactory.h:24
Abstract base class for hardware input device implementations.
Definition inputDevice.h:25
Manager for instrument panels, gimbal sensors, and specialized views.
Definition instrumentPanelManager.h:45
Class for managing available entities and roles for engagement.
Definition playerCreationPalette.h:59
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:155
virtual std::string const & getAppMode() const
Gets the current application mode.
virtual DtPlayerStationTempNotification * tempNotification()
Gets the temporary notification handler.
Definition playerStationApp.h:718
virtual std::list< DtPlayerStation * > & players()
Gets the list of all player stations.
virtual bool destroyPlayerStation(const DtEntityIdentifier &)
Destroys a specific player station by entity identifier.
virtual bool setAppMode(const std::string &mode, bool changeMenus=true, bool isInitialSet=false)
Sets the current mode of the application.
std::string myPlayerStationName
Current player station type name.
Definition playerStationApp.h:1066
DtComponentFactory myComponentFactory
Factory objects.
Definition playerStationApp.h:1006
virtual void setSpectator(bool value)
Sets spectator mode state.
static bool isGroundOnly()
Checks if ground-only mode is active.
DtInitTable myMinionConfig
Minion mode configuration table.
Definition playerStationApp.h:958
virtual void observerLookAt(const DtEntityIdentifier &)
Makes the observer look at a single entity.
bool myUse3DChooseRolePanel
3D role panel state
Definition playerStationApp.h:1128
DtPlayerStationTempNotification * myTempNotification
Temporary notification handler.
Definition playerStationApp.h:940
virtual DtComponentFactory & componentFactory()
Gets the component factory.
bool myAmSpectator
Spectator mode state.
Definition playerStationApp.h:1045
virtual DtVreSensorModeMapper * vreSensorModeMapper() const
Gets the sensor mode mapper.
virtual void detatchObserverIfAttachedTo(makVrv::DtElementID)
Detaches the observer if it is attached to the specified element.
virtual void debugCallback()
virtual void clearPlayers()
Removes all player stations from the list without destroying them.
DtInputDeviceFactory * myInputDeviceFactory
Input device factory.
Definition playerStationApp.h:1016
DtPlayerStationStateManager * myStateManager
State manager.
Definition playerStationApp.h:987
std::list< DtPlayerStation * > myPlayers
List of active player stations.
Definition playerStationApp.h:1029
DtInitializer * myInitializer
Initializers and configuration.
Definition playerStationApp.h:948
bool myMenuBarVisible
Menu bar visibility state.
Definition playerStationApp.h:1034
bool myDebugMode
Debug mode state.
Definition playerStationApp.h:1095
virtual void pause()
Pauses the simulation.
DtPlayerStationAppInputLogic * myInputLogic
Input logic handler.
Definition playerStationApp.h:997
const DtAttributeHandle entityStateStore() const
Returns a handle for the Entity State Attribute store.
virtual std::string const & getPlayerStationDisplayLayout() const
Gets the current player station display layout.
virtual bool setNonPlayStateObserverMode(enum DtDimensionality dimensionality)
Sets the observer mode for non-play states.
makVrv::DtSignalConnectionManager myConnections
Signal connection manager.
Definition playerStationApp.h:982
virtual DtInitTable findInitTable(const std::string &name)
Finds a named initialization table.
virtual void run()
Runs the simulation.
static bool isAirEnabled(bool b=false)
Air mode functions.
virtual DtInitializer & initializer()
Gets the application initializer.
virtual makVrv::DtObserver * setObserverMode(const std::string &name)
Sets the observer mode for the primary observer.
virtual DtSensorLibrary sensorLibrary() const
Gets the current sensor library.
virtual void setAttachEntity(DtEntityIdentifier const &entityId)
Sets the entity to which the observer is attached.
std::string myOldAppMode
Previous application mode.
Definition playerStationApp.h:1084
static bool isGroundEnabled(bool b=false)
Ground mode functions.
virtual void centerObserverOnTerrain()
Centers the observer on the terrain.
DtVreSensorModeMapper * myVreSensorModeMapper
Sensor mode mapper.
Definition playerStationApp.h:1193
DtEntityResolver * myEntityResolver
Entity resolver.
Definition playerStationApp.h:963
static bool isSensorOnly()
Checks if sensor-only mode is active.
DtPlayerStationApp(makVrv::DtDe &de)
Constructor.
virtual void setVRVStatusBarShown(bool on)
Shows or hides the VR-Vantage status bar.
virtual DtPlayerStation * findPlayerAt(int index)
Finds a player station at a specific index.
virtual DtPlayerCreationPalette & playerCreationPalette()
Gets the player creation palette.
std::string myNonPlayStateObserverMode2D
Observer modes for different states.
Definition playerStationApp.h:1158
virtual void shutdown()
Shuts down the application.
virtual std::string engageStationId()
Gets the station-name string for this VR-Engage application instance.
virtual void setIsDragging(bool dragging)
Sets the dragging state of the application window.
virtual bool isSpectator()
Spectator mode functions.
virtual void updateStatusPublisher()
Updates the status publisher with current state.
DtOwnershipTransferManager::Ptr ownershipTransferManager() const
Ownership Transfer manager accessor.
std::map< int, int > myActiveHudTextureLookup
HUD texture reference count map.
Definition playerStationApp.h:1207
DtMutex myResourceMutex
Resource mutex.
Definition playerStationApp.h:1056
virtual void setAdminModeEnabled(bool enabled)
Enables or disables admin mode.
virtual DtPlayerStation * findPlayer(const DtEntityIdentifier &)
Finds a player station by entity identifier.
const DtAttributeHandle myEntityStateStore
Handle for Entity State Attributes.
Definition playerStationApp.h:1223
virtual bool virtualRealityAvailable()
Checks if VR support is available.
const DtAttributeHandle appAttributeStore() const
Const version of appAttributeStore.
virtual bool getPlayFullScreen()
Gets the play fullscreen mode setting.
virtual void observerLookAt(const std::vector< DtEntityIdentifier > &)
Makes the observer look at multiple entities.
virtual DtVreObserverModeMapper * vreObserverModeMapper() const
Gets the observer mode mapper.
std::string myPlayerStationDisplayLayout
Current display layout name.
Definition playerStationApp.h:1071
makVrv::DtDe & myDe
Reference to the VR-Vantage display engine.
Definition playerStationApp.h:1061
void initMinionMonitor()
Initializes the minion monitor.
virtual void setPlayerStationName(const std::string &playerType)
Sets the current player station type name.
static bool isSensorEnabled(bool b=false)
Sensor mode functions.
virtual DtPlayerStation * findPlayer(makVrv::DtElementID)
Finds a player station by element ID.
DtVreMessageResult handleSessionSmsListMessage(DtVreMessage *message)
Handles session SMS list messages.
virtual void toggleAppMode()
Toggles between available application modes.
virtual DtPlayerStation * findPlayerStation(const DtEntityIdentifier &, const std::string &roleName)
Finds a player station by entity identifier and role name.
virtual bool destroyPlayerStation(const DtEntityIdentifier &, const std::string &roleName)
Destroys a specific player station by entity identifier and role name.
bool myPlayFullScreen
Full screen mode state for play mode.
Definition playerStationApp.h:1039
virtual void observerDetach()
Detaches the observer from any entity it may be following.
virtual std::string const & getPlayerStationName() const
Gets the current player station type name.
bool myFixedRoleMode
Fixed role mode state.
Definition playerStationApp.h:1112
virtual makVrv::DtDe & de()
Gets a reference to the VR-Vantage display engine.
DtAttributeHandle myVreStatusLocalAttr
Local station status attribute subtree.
Definition playerStationApp.h:1143
virtual void setFixedRole(bool on=true)
Sets the fixed role mode state.
DtAttributeHandle appAttributeStore()
Returns a handle for the App level Attribute store.
DtVreChatManager::Uptr myChatManager
Chat manager.
Definition playerStationApp.h:1022
virtual void initialize()
Initializes the application.
DtVreMessageResult handleSubscribeToBoss(DtVreMessage *message)
Requests the boss station to forward messages.
virtual bool destroyPlayerStation()
Destroys all player stations.
virtual DtPlayerStationStateManager & stateManager()
Gets the application state manager.
virtual void setFullScreen(bool fullscreen)
Sets the application's fullscreen state.
DtFunctionQueue myFunctionQueue
Definition playerStationApp.h:1231
virtual DtEntityIdentifier getAttachEntity()
Gets the entity to which the observer is currently attached.
virtual DtInputDeviceFactory * inputDeviceFactory()
Gets the input device factory.
DtInstrumentPanelManager * myInstrumentPanelManager
Application managers.
Definition playerStationApp.h:972
DtOwnershipTransferManager::Uptr myOwnershipTransferManager
Ownership transfer manager loaded from the OwnershipTransfer Lua table.
Definition playerStationApp.h:1229
std::unique_ptr< DtVrePluginManager > myPluginManager
Frontend plugin manager.
Definition playerStationApp.h:977
static DtPlayerStationApp * instance()
Gets the singleton instance of this class.
int incrementActiveHudTexture(int textureID)
Increments the active HUD texture count.
virtual DtChooseRolePanel * getChoosePlayerPanel()
Gets the role selection panel.
std::string myObserverName
Application-level observer name.
Definition playerStationApp.h:1201
virtual bool isDragging()
Checks if the application window is being dragged.
virtual DtPlayerStation * findPlayer()
Finds the first player station in the list.
std::string myAppMode
Admin mode variables.
Definition playerStationApp.h:1079
int getActiveHudTextureCount(int textureID)
Gets the current HUD texture count.
virtual ~DtPlayerStationApp()
Virtual destructor.
DtVreInputManager * myInputManager
Input manager.
Definition playerStationApp.h:992
bool isTypeAllowed(DtEntityType entityType)
Checks if an entity type is allowed.
DtChooseRolePanel * myChoosePlayerPanel
Role selection panel.
Definition playerStationApp.h:1106
DtAttributeChangeCallback myMinionBossCallback
Attribute change callback for minion mode boss monitoring.
Definition playerStationApp.h:1150
virtual bool setPlayStateObserverMode()
Sets the observer mode for play state.
boost::signalslib::signal< void()> signal_menuBarVisibilityChanged
Signal for menu bar visibility changes.
Definition playerStationApp.h:788
virtual void loadOwnershipTransferConfiguration()
Loads ownership transfer configuration from the OwnershipTransfer Lua table.
virtual void setPlayFullScreen(bool fullscreen)
Sets the play fullscreen mode.
std::string myNonPlayStateObserverMode3D
Observer mode for 3D non-play states.
Definition playerStationApp.h:1163
bool isImguiVisible()
Checks if ImGui is visible.
static bool isCombinedMode()
Checks if combined mode is active.
bool myEnableVRVControls
VR-Vantage controls state.
Definition playerStationApp.h:1122
static DtPlayerStationApp * theApp
Single instance of the application.
Definition playerStationApp.h:936
virtual bool observerHasDefault(std::string *outName=NULL)
Checks if the observer has a default position.
bool shouldAcceptRoleAssignment(const VreAssignRolePlayerMessage &assignment)
Applies the rewind policy.
virtual bool isAdminModeEnabled()
Checks if admin mode is enabled.
DtPlayerCreationPalette myPlayerCreationPalette
Player creation palette.
Definition playerStationApp.h:1101
DtInitTable myStartupConfig
Startup configuration table.
Definition playerStationApp.h:953
void initVirtualReality()
Initializes virtual reality support.
virtual bool isFullScreen()
Checks if the application is currently in fullscreen mode.
virtual void findMainRenderChannel()
Finds the main rendering channel.
bool myAdminModeEnabled
Admin mode enabled state.
Definition playerStationApp.h:1089
virtual void quit()
Initiates application termination.
virtual bool isChooseRolePanel3D()
Checks if the 3D role selection panel is enabled.
std::string myPlayStateObserverMode
Observer mode for play state.
Definition playerStationApp.h:1168
void minionModeBossMonitor(const DtAttributeHandle &changed)
Monitors the status of the boss station in minion mode.
static bool isAirOnly()
Checks if air-only mode is active.
virtual void rewind()
Rewinds the simulation.
virtual void setPlayerStationDisplayLayout(const std::string &displayLayout)
Sets the display layout for the current player station.
DtVreObserverModeMapper * myVreObserverModeMapper
Observer and sensor mode mappers.
Definition playerStationApp.h:1184
virtual bool isMenuBarVisible() const
Checks if the menu bar is visible.
virtual DtConnectorFactory & connectorFactory()
Gets the connector factory.
virtual DtVreInputManager & inputManager()
Gets the input manager.
virtual DtInitTable startupConfig()
Gets the startup configuration data.
void deferFunction(std::function< void()> f, double delayInSeconds)
Defers a function to be executed after a time delay.
virtual std::string observerName() const
Gets the name of the application-level observer.
virtual void resetView()
Resets the view in the Choose Role panel.
virtual void updateMenus(const std::string &appMode)
Updates the application menus based on the specified mode.
void deferFunction(std::function< void()> f, int delayInTicks=0)
Defers a function to be executed after a number of ticks.
virtual bool fixedRoleMode()
Role mode functions.
DtConnectorFactory myConnectorFactory
Connector factory.
Definition playerStationApp.h:1011
DtVreMessageResult handleUnsubscribeFromBoss(DtVreMessage *message)
Requests the boss station to stop forwarding messages.
virtual bool isVRVControlsEnabled()
Checks if VRV controls are enabled.
int decrementActiveHudTexture(int textureID)
Decrements the active HUD texture count.
virtual void tick(double dt)
Updates the application state.
DtSensorLibrary mySensorLibrary
Current sensor library in use.
Definition playerStationApp.h:1136
DtEntityIdentifier myOwnEntityId
Entity identifier for the owned entity.
Definition playerStationApp.h:1051
DtAttributeHandleType< DtPlayerStationApp * > myAppStore
Handle for App level Attributes.
Definition playerStationApp.h:1213
virtual DtPlayerStation * createPlayerStation(const DtEntityIdentifier &id, const std::string &station, const std::string &displayLayout)
Creates a new player station with specific settings.
virtual void observerFollow(const DtEntityIdentifier &)
Makes the observer follow an entity.
virtual void observerReset()
Resets the observer to its default position.
virtual DtVreChatManager & chatManager()
Gets the chat manager.
bool myIsDragging
Window dragging state.
Definition playerStationApp.h:1117
Application-level input logic handler for VR-Engage.
Definition playerStationAppInputLogic.h:29
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Manager for player station states and state transitions.
Definition playerStationStateManager.h:42
Temporary notification UI component for VR-Engage.
Definition playerStationTempNotification.h:36
High-level chat manager for VR-Engage player-station plugins.
Definition vreChatManager.h:80
Central manager for input device handling, action mapping, and input processing.
Definition vreInputManager.h:81
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Mapper for translating between observer mode identifiers and actual mode names.
Definition vreObserverModeMapper.h:46
Mapper for translating between sensor mode identifiers and actual mode names.
Definition vreSensorModeMapper.h:46
std::unique_ptr< DtVreChatManager > Uptr
Definition baseClass.h:355
DtOwnershipTransferManager * Ptr
Definition baseClass.h:352
Assigns a role and identifies automatic reengagement caused by rewind or snapshot rollback.
Definition vreAssignRolePlayer.h:35
Defines the DtConnector base class for simulation protocol connections.
Provides a template-based factory system for object creation.
Deferred function queue.
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Provides configuration initialization for VREngage components.
!
Definition glsVreMessageUtil.h:50
DtFactory< DtInputDevice > DtDeviceFactory
Factory type for input devices.
Definition playerStationApp.h:126
DtDimensionality
Enumeration for dimensionality of the view.
Definition playerStationApp.h:143
@ Dt3D
3D view (perspective view)
Definition playerStationApp.h:145
@ Dt2D
2D view (map/plan view)
Definition playerStationApp.h:144
DtFactory< DtPlayerComponent > DtComponentFactory
Type definitions for factory classes.
Definition playerStationApp.h:120
enum _DtSensorLibrary { CAMERA_FX=0, SENSOR_FX } DtSensorLibrary
Enumeration of available sensor libraries for observer modes.
Definition playerStationApp.h:133
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
DtFactory< DtConnector > DtConnectorFactory
Factory type for connectors.
Definition playerStationApp.h:123
Definition appLauncherComponent.h:28
Runtime manager for the Ownership Transfer feature.
Defines the DtPlayerComponent base class for VR-Engage role components.
Defines the DtPlayerCreationPalette class for managing available entity roles.
Declares DtChatCommand and DtVreChatManager.
Defines the base class for all VREngage messages.
Declares the frontend plugin wrapper and plugin manager.