VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtObserverUpdater Class Reference

Detailed Description

DtObserverUpdater provides common functionality for managing observer view settings, including field of view and view modes. It manages channel configurations for windows and synchronizes sensor modes between VR-Engage and VR-Vantage. This class serves as a base for more specialized observer updater components.

#include <observerUpdater.h>

Inheritance diagram for makVre::DtObserverUpdater:
[legend]

Public Member Functions

 DtObserverUpdater ()
 
virtual ~DtObserverUpdater () override
 
virtual bool initialize (DtPlayerStation *station, DtInitTable &config) override
 
virtual bool postInitialize () override
 
virtual void tick (double dt) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
virtual void addChannelToUpdate (const std::string &windowName, const std::string &channelName)
 
virtual void removeChannelToUpdate (const std::string &windowName, const std::string &channelName, bool restoreInitialSettings=true)
 
- Public Member Functions inherited from makVre::DtPlayerComponent
 DtPlayerComponent ()
 
virtual ~DtPlayerComponent ()
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Types

using WindowAndChannelName = std::pair<std::string, std::string>
 
using ChannelConfigMap = std::map<WindowAndChannelName, makVrv::DtChannelConfiguration>
 

Protected Member Functions

virtual void initializeStateAttributes () override
 
virtual void onSensorModeChanged (std::string sensorMode)
 
virtual void onObserverModeChanged (std::string observerMode)
 
virtual void addDefaultChannels ()
 
virtual void addVrChannels ()
 
virtual bool findChannelConfiguration (const std::string &windowName, const std::string &channelName, makVrv::DtChannelConfiguration &config)
 
virtual void updateAllChannels ()
 
virtual void setShowCockpits (bool show)
 
virtual bool applyConfigurationToChannel (const std::string &windowName, const std::string &channelName, const makVrv::DtChannelConfiguration &newConfig)
 
bool firstWindowAndChannelNames (std::string &windowName, std::string &channelName)
 
virtual void updateStateAttributes ()
 

Protected Attributes

makVre::DtInstrumentPanelManagermyInstrumentPanelManager
 
ChannelConfigMap myChannelsToUpdate
 
bool myForceChannelUpdate
 
double myVerticalFOV
 
double myHorizontalFOV
 
makVrv::DtWindow * myWindow
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Member Typedef Documentation

◆ WindowAndChannelName

using makVre::DtObserverUpdater::WindowAndChannelName = std::pair<std::string, std::string>
protected

Type definition for window and channel name pairs.

◆ ChannelConfigMap

using makVre::DtObserverUpdater::ChannelConfigMap = std::map<WindowAndChannelName, makVrv::DtChannelConfiguration>
protected

Type definition for mapping window/channel pairs to configurations.

Constructor & Destructor Documentation

◆ DtObserverUpdater()

makVre::DtObserverUpdater::DtObserverUpdater ( )

Default constructor for DtObserverUpdater.

Initializes the component with the default name "DtObserverUpdater"

◆ ~DtObserverUpdater()

virtual makVre::DtObserverUpdater::~DtObserverUpdater ( )
overridevirtual

Virtual destructor for DtObserverUpdater.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtObserverUpdater::initialize ( DtPlayerStation * station,
DtInitTable & config )
overridevirtual

Initializes the observer updater component.

Parameters
stationPointer to the player station this component belongs to
configConfiguration table containing observer settings
Returns
True if initialization succeeded, false otherwise

Sets up field of view parameters, and adds default channels to be managed by this component

Reimplemented from makVre::DtPlayerComponent.

Reimplemented in DtPilotObserverUpdater, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtGunnerObserverUpdater, makVre::DtHumanObserverUpdater, makVre::DtLookAroundObserverUpdater, makVre::DtSavedViewUpdater, and makVre::DtSpectatorObserverUpdater.

◆ postInitialize()

virtual bool makVre::DtObserverUpdater::postInitialize ( )
overridevirtual

Performs post-initialization after all components are initialized.

Returns
True if post-initialization succeeded, false otherwise

Sets up callbacks for sensor mode and observer mode changes

Reimplemented from makVre::DtPlayerComponent.

Reimplemented in makVre::DtHumanObserverUpdater, and makVre::DtLookAroundObserverUpdater.

◆ tick()

virtual void makVre::DtObserverUpdater::tick ( double dt)
overridevirtual

Called every frame to update observer parameters.

Parameters
dtDelta time since the last frame in seconds

Updates all managed channels and player state attributes

Implements makVre::DtPlayerComponent.

Reimplemented in DtPilotObserverUpdater, makVre::DtCommanderHatchViewUpdater, makVre::DtCommanderObserverUpdater, makVre::DtGunnerObserverUpdater, makVre::DtHumanObserverUpdater, makVre::DtLookAroundObserverUpdater, makVre::DtSavedViewUpdater, and makVre::DtSpectatorObserverUpdater.

◆ shutdown()

virtual void makVre::DtObserverUpdater::shutdown ( )
overridevirtual

◆ type()

virtual const char * makVre::DtObserverUpdater::type ( ) const
overridevirtual

◆ addChannelToUpdate()

virtual void makVre::DtObserverUpdater::addChannelToUpdate ( const std::string & windowName,
const std::string & channelName )
virtual

Adds a channel to be managed by this updater.

Parameters
windowNameName of the window containing the channel
channelNameName of the channel to add

Stores the initial configuration of the channel and marks it for updates

◆ removeChannelToUpdate()

virtual void makVre::DtObserverUpdater::removeChannelToUpdate ( const std::string & windowName,
const std::string & channelName,
bool restoreInitialSettings = true )
virtual

Removes a channel from being managed by this updater.

Parameters
windowNameName of the window containing the channel
channelNameName of the channel to remove
restoreInitialSettingsIf true, restores the channel's initial configuration

Stops managing the specified channel and optionally restores its initial settings

◆ initializeStateAttributes()

virtual void makVre::DtObserverUpdater::initializeStateAttributes ( )
overrideprotectedvirtual

Initializes player state attributes related to observer settings.

Sets up field of view attributes and configures the initial channel projection

Reimplemented from makVre::DtPlayerComponent.

◆ onSensorModeChanged()

virtual void makVre::DtObserverUpdater::onSensorModeChanged ( std::string sensorMode)
protectedvirtual

Handles changes to the sensor mode state attribute.

Parameters
sensorModeNew sensor mode value

Updates the observer's sensor mode in VR-Vantage when the sensorMode attribute changes

◆ onObserverModeChanged()

virtual void makVre::DtObserverUpdater::onObserverModeChanged ( std::string observerMode)
protectedvirtual

Handles changes to the observer mode state attribute.

Parameters
observerModeNew observer mode value

Updates the observer's view mode in VR-Vantage when the observerMode attribute changes

◆ addDefaultChannels()

virtual void makVre::DtObserverUpdater::addDefaultChannels ( )
protectedvirtual

Adds the default channel (Window 1, Channel 1) to be managed.

Adds the first window's Channel 1 to configurations to monitor. Derived classes can override this function to change this behavior.

◆ addVrChannels()

virtual void makVre::DtObserverUpdater::addVrChannels ( )
protectedvirtual

Adds VR-specific channels to be managed.

Adds HMD window channels for left and right eyes to be managed by this updater

◆ findChannelConfiguration()

virtual bool makVre::DtObserverUpdater::findChannelConfiguration ( const std::string & windowName,
const std::string & channelName,
makVrv::DtChannelConfiguration & config )
protectedvirtual

Finds the configuration for a specific channel.

Parameters
windowNameName of the window containing the channel
channelNameName of the channel to find
configOutput parameter that will receive the channel configuration
Returns
True if the channel configuration was found, false otherwise

Retrieves the current configuration of the specified channel

◆ updateAllChannels()

virtual void makVre::DtObserverUpdater::updateAllChannels ( )
protectedvirtual

Updates all managed channels with current settings.

Applies appropriate settings to all managed channels based on the display layout

◆ setShowCockpits()

virtual void makVre::DtObserverUpdater::setShowCockpits ( bool show)
protectedvirtual

Sets the showCockpits keyword on all managed channels.

Parameters
showTrue to show cockpits, false to hide them

Adds or removes the "showCockpits" keyword from channel configurations

◆ applyConfigurationToChannel()

virtual bool makVre::DtObserverUpdater::applyConfigurationToChannel ( const std::string & windowName,
const std::string & channelName,
const makVrv::DtChannelConfiguration & newConfig )
protectedvirtual

Applies a configuration to a specific channel.

Parameters
windowNameName of the window containing the channel
channelNameName of the channel to configure
newConfigNew configuration to apply to the channel
Returns
True if the configuration was successfully applied, false otherwise

Modifies a channel's configuration through the window manager

◆ firstWindowAndChannelNames()

bool makVre::DtObserverUpdater::firstWindowAndChannelNames ( std::string & windowName,
std::string & channelName )
protected

Gets the names of the first window and channel.

Parameters
windowNameOutput parameter that will receive the window name
channelNameOutput parameter that will receive the channel name
Returns
True if a window and channel were found, false otherwise

Finds and returns the names of the first window and its first channel

◆ updateStateAttributes()

virtual void makVre::DtObserverUpdater::updateStateAttributes ( )
protectedvirtual

Updates player state attributes with current observer data.

Updates position, orientation, and view attributes based on the current observer state

Reimplemented in makVre::DtHumanObserverUpdater.

Member Data Documentation

◆ myInstrumentPanelManager

makVre::DtInstrumentPanelManager* makVre::DtObserverUpdater::myInstrumentPanelManager
protected

Pointer to the instrument panel manager.

◆ myChannelsToUpdate

ChannelConfigMap makVre::DtObserverUpdater::myChannelsToUpdate
protected

Map of channel configurations to be updated.

Stores the initial configuration of each managed channel, keyed by window name and channel name pairs

◆ myForceChannelUpdate

bool makVre::DtObserverUpdater::myForceChannelUpdate
protected

Flag indicating if channel updates should be forced.

◆ myVerticalFOV

double makVre::DtObserverUpdater::myVerticalFOV
protected

Vertical field of view in degrees.

◆ myHorizontalFOV

double makVre::DtObserverUpdater::myHorizontalFOV
protected

Horizontal field of view in degrees.

◆ myWindow

makVrv::DtWindow* makVre::DtObserverUpdater::myWindow
protected

Pointer to the main window.


The documentation for this class was generated from the following file: