|
VR-Engage
2.2
|
DtLoadingState is responsible for loading terrain and scenario data into VR-Engage. It presents a loading UI with progress information, coordinates the loading sequence between simulation and visualization components, and handles transitions to the appropriate state once loading is complete.
#include <loadingState.h>
Public Member Functions | |
| DtLoadingState (DtPlayerStationApp &app) | |
| virtual | ~DtLoadingState () override |
| virtual void | onEnter (const DtPlayerStationStateArgs *args) override |
| virtual void | onExit () override |
| virtual void | tick (double dt) override |
Public Member Functions inherited from makVre::DtPlayerStationState | |
| DtPlayerStationState (DtPlayerStationApp &app, std::string stateType) | |
| virtual | ~DtPlayerStationState () |
| DtPlayerStationState (const DtPlayerStationState &)=delete | |
| DtPlayerStationState & | operator= (const DtPlayerStationState &)=delete |
| virtual void | onEnter () |
| virtual void | onStacked () |
| virtual void | onExposed (const DtPlayerStationStateArgs *args) |
| virtual void | onExposed () |
| bool | active () const |
| bool | exposed () const |
| bool | exiting () const |
| bool | stacking () const |
| const std::string & | stateType () const |
| DtPlayerStationApp & | app () const |
Protected Member Functions | |
| virtual DtVreMessageResult | handleBackendStatus (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleSmsLoadComplete (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleSessionStatus (DtVreMessage *msg) |
| virtual void | loadSimTerrain () |
| virtual void | loadGuiTerrain () |
| virtual bool | loadScenarioObserverViews () |
| virtual bool | parseObserverViewsXml (const DtString &xml, makArchives::DtObserverStateRecordsList &record) |
| virtual bool | findFileRecursive (const std::string &directory, const std::string &filenameToFind, DtFilename &foundPath) |
| virtual void | setStatusText (const QString &msg) |
| virtual void | setTimeToLoad (const int ms) |
| int | getEstimatedTimeToLoad (const std::string &file) |
| void | logEstimatedTimeToLoad (const std::string &file) |
Protected Member Functions inherited from makVre::DtPlayerStationState | |
| bool | pushState (const std::string &newState, DtPlayerStationStateArgs *args=NULL) |
| bool | popSelf () |
| bool | popUntilSelf () |
| bool | popUntilState (const std::string &parentState, DtPlayerStationStateArgs *args=NULL) |
| bool | switchToState (const std::string &newState, DtPlayerStationStateArgs *args=NULL) |
| bool | pushSelf () |
Protected Attributes | |
| std::shared_ptr< SessionLoadDataMessage > | myLoadData |
| std::shared_ptr< DtVreLoadingPage > | myLoadingPage |
| std::shared_ptr< DtVreExternalLoadingPageLogic > | myExternalLoadingLogic |
| int | mySmsLoadStatusBits |
| bool | mySentTerrainLoad |
| bool | myDidSimLoad |
| bool | myDidGuiLoad |
| int | myServerPort |
| std::chrono::time_point< std::chrono::steady_clock > | myTimerStart |
| std::chrono::time_point< std::chrono::steady_clock > | myTimerEnd |
Protected Attributes inherited from makVre::DtPlayerStationState | |
| DtPlayerStationApp & | myApp |
| makVre::DtLoadingState::DtLoadingState | ( | DtPlayerStationApp & | app | ) |
Constructor.
| app | Reference to the player station application |
Creates a new loading state associated with the given application.
References makVre::DtPlayerStationState::app().
|
overridevirtual |
Virtual destructor.
Ensures proper cleanup of loading state resources.
|
overridevirtual |
Called when the state is entered.
| args | Pointer to arguments from the previous state |
Initializes the loading process, sets up the loading UI, and begins the sequence of loading terrain and scenario data. The args parameter typically contains information about what needs to be loaded.
Reimplemented from makVre::DtPlayerStationState.
|
overridevirtual |
Called when the state is exited.
Cleans up loading resources, hides the loading UI, and prepares for the transition to the next state (typically a session state).
Reimplemented from makVre::DtPlayerStationState.
|
overridevirtual |
Updates the state each frame.
| dt | Time in seconds since the last update |
Monitors loading progress, updates the loading UI, and checks for completion conditions to determine when to transition to the next state.
Reimplemented from makVre::DtPlayerStationState.
|
protectedvirtual |
Handles backend status update messages.
| msg | Pointer to the backend status message |
Processes status updates from the backend system, updating the loading progress based on the current state of backend components.
|
protectedvirtual |
Handles SMS load completion messages.
| msg | Pointer to the load complete message |
Processes notifications that the Simulation Management System has completed loading the requested terrain or scenario data.
|
protectedvirtual |
Handles session status messages.
| msg | Pointer to the session status message |
Processes updates about the current session status, which may indicate when the session is ready for player engagement after loading.
|
protectedvirtual |
Initiates terrain loading in the simulation component.
Starts the loading process for terrain data in the simulation system. This prepares the terrain for simulation physics and entity interactions.
|
protectedvirtual |
Initiates terrain loading in the GUI/visualization component.
Starts the loading process for terrain data in the visualization system. This prepares the terrain for visual rendering and display.
|
protectedvirtual |
Loads observer views defined in the scenario file.
Attempts to load pre-defined observer views from the scenario file, which provide camera positions and orientations for observing the simulation.
|
protectedvirtual |
|
protectedvirtual |
Searches recursively for a file in a directory.
| directory | Directory to start the search from |
| filenameToFind | Filename to search for |
| foundPath | [out] Path to the found file if successful |
Performs a recursive search for a specified file within a directory and its subdirectories. If found, the full path is stored in foundPath.
|
protectedvirtual |
Sets the status text in the loading UI.
| msg | Text message to display |
Updates the status text shown in the loading UI to inform the user about the current loading activity or progress.
|
protectedvirtual |
Sets the estimated loading time.
| ms | Estimated time in milliseconds |
Sets the estimated time required to complete the loading process, which may be used to update the progress indicator in the UI.
|
protected |
Gets the estimated loading time for a file.
| file | Path to the scenario or terrain file |
Calculates the estimated time needed to load the specified scenario or terrain file. This starts a timer if not already started and may use historical data to provide an estimate. Returns -1 if the file is not found.
|
protected |
Stops the loading timer and logs statistics.
| file | Path to the scenario or terrain file that was loaded |
Stops the loading timer started by getEstimatedTimeToLoad() and logs the actual loading time to a data file for future reference. This helps improve future loading time estimates.
|
protected |
Data message containing loading parameters.
Contains information about what terrain or scenario to load and how it should be loaded.
|
protected |
Loading page UI component.
Provides the user interface for displaying loading progress.
|
protected |
External loading page logic.
Handles advanced loading UI functionality and interactions.
|
protected |
SMS loading status bitmask.
Tracks which components of the Simulation Management System have completed loading through a bitmask of status flags.
|
protected |
Flag indicating if terrain load command was sent.
|
protected |
Flag indicating if simulation terrain loading is complete.
|
protected |
Flag indicating if GUI terrain loading is complete.
|
protected |
Server port number for the loaded session.
|
protected |
Timer start timestamp.
Records when loading began for performance measurement.
|
protected |
Timer end timestamp.
Records when loading completed for performance measurement.