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