VR-Engage  2.2
Loading...
Searching...
No Matches
vreObserverModeMapper.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file vreObserverModeMapper.h
7//! \brief Defines a mapper for translating between observer mode identifiers
8//!
9//! This file contains the DtVreObserverModeMapper class which provides a way to
10//! refer to VR-Vantage observer modes independently of whether the application
11//! is running in CameraFX or SensorFX mode. It maps generic observer mode
12//! identifiers used in VR-Engage to the specific mode names required by the
13//! VR-Vantage API based on the current sensor library configuration.
14
16
18
19#include <string>
20#include <map>
21
22namespace makVre
23{
24//! \brief Structure to hold observer mode names for different sensor libraries
25//!
26//! DtVrvObserverModes stores the corresponding observer mode names for both
27//! CameraFX and SensorFX libraries. These names match the <myName> entries
28//! found in the default_ObserverModes.omcx configuration file in VR-Vantage.
29using DtVrvObserverModes = struct _DtVrvObserverModes
30{
31 std::string observerModeCameraFX; //!< Observer mode name for CameraFX library
32 std::string observerModeSensorFX; //!< Observer mode name for SensorFX library
33};
34
35//! \brief Type definition for a map of observer mode identifiers to mode names
36using DtVreObserveModeTable = std::map<std::string, DtVrvObserverModes>;
37
38//! \brief Mapper for translating between observer mode identifiers and actual mode names
39//!
40//! DtVreObserverModeMapper provides a way to use generic identifiers for observer
41//! modes in VR-Engage while properly translating them to the specific observer mode
42//! names required by VR-Vantage, which differ between CameraFX and SensorFX modes.
43//! This allows VR-Engage configuration to remain independent of the underlying
44//! visualization engine's sensor library implementation.
46{
47public:
48 //! \brief Constructor
49 //! \param sensorLibrary The sensor library currently in use (CAMERA_FX or SENSOR_FX)
50 //!
51 //! Creates a new observer mode mapper configured for the specified sensor library.
52 //! Any observer mode lookups will return the corresponding VR-Vantage observer
53 //! mode name for this sensor library.
55
56 //! \brief Destructor
57 //!
58 //! Cleans up resources used by the observer mode mapper.
60
61 //! \brief Initializes the mapper with observer mode mappings
62 //! \param initTable LUA table containing observer mode mappings
63 //! \return True if initialization succeeded, false otherwise
64 //!
65 //! Initializes the table of key strings and their corresponding CameraFX/SensorFX
66 //! VR-Vantage observer mode names from the provided LUA table. The initTable
67 //! parameter is typically the 'vreObserverModeMapper' table defined in
68 //! playerStation.lua. Note that not every entry will have both CameraFX and
69 //! SensorFX mappings, as there is not a perfect one-to-one correspondence
70 //! between the observer modes available in each library.
71 virtual bool initialize(DtInitTable& initTable);
72
73 //! \brief Looks up the VR-Vantage observer mode name for a generic identifier
74 //! \param key Generic observer mode identifier
75 //! \return VR-Vantage observer mode name, or empty string if not found
76 //!
77 //! Translates a generic observer mode identifier to the appropriate VR-Vantage
78 //! observer mode name based on the current sensor library configuration. For example,
79 //! if the key string passed in is "IR" and the sensor library is SENSOR_FX, then
80 //! the returned observer mode might be "LWIR (SensorFX)". If the requested mode
81 //! is not available in the current sensor library, an empty string is returned.
82 virtual std::string lookup(std::string key) const;
83
84private:
85 //! \brief Copy constructor (deleted)
86 //!
87 //! Copy construction is not supported for this class.
89
90 //! \brief Assignment operator (deleted)
91 //!
92 //! Assignment is not supported for this class.
94
95protected:
96 //! \brief Current sensor library configuration
97 //!
98 //! Stores which sensor library (CAMERA_FX or SENSOR_FX) is currently in use
99 //! in the application. This determines which set of observer mode names
100 //! will be used during lookup operations.
102
103 //! \brief Table mapping generic identifiers to observer mode names
104 //!
105 //! Table of DtVrvObserverMode entries, indexed by generic string identifiers.
106 //! These identifiers provide an abstraction layer for configuring observer
107 //! modes in VR-Engage independent of whether CameraFX or SensorFX is being used.
109};
110} // namespace makVre
Table-based access to Lua state for configuration data.
Definition initializer.h:38
DtSensorLibrary mySensorLibrary
Current sensor library configuration.
Definition vreObserverModeMapper.h:101
DtVreObserverModeMapper & operator=(const DtVreObserverModeMapper &orig)
Assignment operator (deleted)
DtVreObserverModeMapper(const DtVreObserverModeMapper &orig)
Copy constructor (deleted)
virtual bool initialize(DtInitTable &initTable)
Initializes the mapper with observer mode mappings.
DtVreObserverModeMapper(DtSensorLibrary sensorLibrary)
Constructor.
virtual std::string lookup(std::string key) const
Looks up the VR-Vantage observer mode name for a generic identifier.
DtVreObserveModeTable myObserverModeTable
Table mapping generic identifiers to observer mode names.
Definition vreObserverModeMapper.h:108
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
enum _DtSensorLibrary { CAMERA_FX=0, SENSOR_FX } DtSensorLibrary
Enumeration of available sensor libraries for observer modes.
Definition playerStationApp.h:141
struct _DtVrvObserverModes { std::string observerModeCameraFX; std::string observerModeSensorFX; } DtVrvObserverModes
Structure to hold observer mode names for different sensor libraries.
Definition vreObserverModeMapper.h:29
std::map< std::string, DtVrvObserverModes > DtVreObserveModeTable
Type definition for a map of observer mode identifiers to mode names.
Definition vreObserverModeMapper.h:36
Defines the DtPlayerStationApp class for the VR-Engage application.