VR-Engage  2.2
Loading...
Searching...
No Matches
selectConnectionState.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file selectConnectionState.h
7//! \brief Defines the connection selection state for VR-Engage
8//!
9//! This file contains the DtSelectConnectionState class which manages the application
10//! state where users select a connection protocol (like DIS, HLA, or TENA). It presents
11//! a user interface for protocol selection and handles the transition to the network
12//! connected state once a connection driver is loaded.
13
14#pragma once
15
17
19
21
22namespace makVre
23{
24//! \brief Forward declaration of the connection selection page
26
27//! \brief Application state for selecting a network connection protocol
28//!
29//! DtSelectConnectionState is the application state where users select
30//! which network protocol to use for connecting to a simulation federation.
31//! The state presents a UI where users can choose from available protocols
32//! like DIS, HLA, or TENA, and handles the loading of the appropriate
33//! connection driver based on their selection.
35{
36public:
37 //! \brief Constructor
38 //! \param app Reference to the player station application
39 //!
40 //! Creates a new connection selection state associated with the given application.
41 //! This state is typically entered after the initialization state.
43
44 //! \brief Virtual destructor
45 //!
46 //! Ensures proper cleanup of connection selection state resources.
47 virtual ~DtSelectConnectionState() override;
48
49 //! \brief Updates the state each frame
50 //! \param dt Time in seconds since the last update
51 //!
52 //! Monitors the connection selection process, updates UI elements with status
53 //! information, and transitions to the next state when a protocol is selected
54 //! and the connection driver is loaded.
55 virtual void tick(double dt) override;
56
57 //! \brief Called when the state is entered
58 //! \param args Pointer to arguments from the previous state
59 //!
60 //! Sets up the connection selection UI, and performs any necessary preparations
61 //! for protocol selection. Takes initialization information from the previous
62 //! state's arguments if available.
63 virtual void onEnter(const DtPlayerStationStateArgs* args) override;
64
65 //! \brief Called when the state is exited
66 //!
67 //! Cleans up resources, hides UI elements, and prepares for the transition
68 //! to the network connected state or back to the initialization state.
69 virtual void onExit() override;
70
71protected:
72 //! \brief Handles network connection status messages
73 //! \param msg Pointer to the network connected message
74 //! \return Message handling result
75 //!
76 //! Processes notifications about successful network connection establishment.
77 //! When a connection is successfully established, this handler prepares for
78 //! the transition to the network connected state.
80
81 //! \brief Handles back button click messages
82 //! \param msg Pointer to the button click message
83 //! \return Message handling result
84 //!
85 //! Processes back button clicks in the connection selection UI, typically
86 //! returning to the initialization state when the user decides to go back.
88
89 //! \brief UI page for connection selection
90 //!
91 //! Provides the user interface where users can select the network protocol
92 //! and configure connection settings.
93 std::shared_ptr<DtVreSelectConnectionPage> mySelectConnectionPage;
94
95 //! \brief Flag indicating whether a connection is ready
96 //!
97 //! When true, indicates that a connection driver has been successfully loaded
98 //! and the application is ready to transition to the network connected state.
100};
101
102} // namespace makVre
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:163
Class for passing arguments during state transitions.
Definition playerStationState.h:45
DtPlayerStationApp & app() const
Gets a reference to the player station application.
DtPlayerStationState(DtPlayerStationApp &app, std::string stateType)
Constructor.
virtual void onEnter(const DtPlayerStationStateArgs *args) override
Called when the state is entered.
std::shared_ptr< DtVreSelectConnectionPage > mySelectConnectionPage
UI page for connection selection.
Definition selectConnectionState.h:93
virtual DtVreMessageResult handleBackButtonClicked(DtVreMessage *msg)
Handles back button click messages.
virtual void tick(double dt) override
Updates the state each frame.
bool myConnectionReady
Flag indicating whether a connection is ready.
Definition selectConnectionState.h:99
virtual ~DtSelectConnectionState() override
Virtual destructor.
DtSelectConnectionState(DtPlayerStationApp &app)
Constructor.
virtual void onExit() override
Called when the state is exited.
virtual DtVreMessageResult handleNetworkConnected(DtVreMessage *msg)
Handles network connection status messages.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
UI page for selecting and configuring network connections.
Definition vreSelectConnectionPage.h:53
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines base classes for the VR-Engage state management system.
Defines the base class for all VREngage messages.