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

Detailed Description

DtActionMenuUpdater is responsible for initializing, updating, and rendering the action menus in VR-Engage. It coordinates with the menu system to ensure proper visual presentation of menus, handles menu positioning, and responds to changes in simulation state that affect menu content and visibility.

This component works alongside DtActionMenuLogic, which handles the logical aspects of menu behavior, while this class focuses on visual representation and updating.

#include <actionMenuUpdater.h>

Inheritance diagram for makVre::DtActionMenuUpdater:
[legend]

Public Member Functions

 DtActionMenuUpdater ()
 
virtual ~DtActionMenuUpdater () override
 
virtual bool initialize (DtPlayerStation *player, DtInitTable &config) override
 
virtual bool postInitialize () override
 
virtual void tick (double dt) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
virtual bool initializeMenus (DtInitTable &config)
 
virtual DtQmlActionMenuqmlActionMenu ()
 
virtual void reinitializeQuick ()
 
- 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 Member Functions

virtual void initializeStateAttributes () override
 
virtual void initEventMenu ()
 
virtual void initQuick ()
 
virtual void shutdownQuick ()
 
virtual makVre::DtVreMessageResult handleSimState (makVre::DtVreMessage *msg)
 
virtual makVre::DtVreMessageResult handleApplicationMode (makVre::DtVreMessage *msg)
 

Protected Attributes

DtMenuManagermyMenuManager
 
std::vector< SimulationStateMessage::EmbeddedEntitymyDeployableObjects
 
DtQmlActionMenumyQmlActionMenu
 
int myVrPositionX
 
int myVrPositionY
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtActionMenuUpdater()

makVre::DtActionMenuUpdater::DtActionMenuUpdater ( )

Constructor.

Creates a new action menu updater component with default state.

◆ ~DtActionMenuUpdater()

virtual makVre::DtActionMenuUpdater::~DtActionMenuUpdater ( )
overridevirtual

Virtual destructor.

Ensures proper cleanup of derived action menu updater classes.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtActionMenuUpdater::initialize ( DtPlayerStation * player,
DtInitTable & config )
overridevirtual

Initializes the action menu updater.

Parameters
playerPointer to the owning player station
configConfiguration data for initialization
Returns
True if initialization succeeded, false otherwise

Sets up the action menu updater system based on the provided configuration. This includes creating a menu manager and initializing menu displays.

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ postInitialize()

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

Performs post-initialization setup.

Returns
True if post-initialization succeeded, false otherwise

Completes setup tasks that need to occur after basic initialization, such as connecting to message handlers and initializing state attributes.

Reimplemented from makVre::DtPlayerComponent.

◆ tick()

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

Updates the menu displays.

Parameters
dtTime interval since the last tick in seconds

Called once per frame to update the visual representation of menus. This includes updating positions, visibility, and content based on the current simulation state.

Implements makVre::DtPlayerComponent.

◆ shutdown()

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

Shuts down the action menu updater.

Performs cleanup when the action menu updater is no longer needed. This includes destroying menu displays and disconnecting from message handlers.

Reimplemented from makVre::DtPlayerComponent.

◆ type()

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

Returns the component type identifier.

Returns
String identifier for this component type

Returns the type identifier string for this component, which is used by the VR-Engage framework for component identification and management. The returned value matches DtActionMenuUpdaterType.

Implements makVre::DtPlayerComponent.

◆ initializeMenus()

virtual bool makVre::DtActionMenuUpdater::initializeMenus ( DtInitTable & config)
virtual

Initializes the menu system.

Parameters
configConfiguration data for menu initialization
Returns
True if menu initialization succeeded, false otherwise

Sets up the menu system based on the provided configuration data. This includes creating and configuring the menu manager and individual menus.

◆ qmlActionMenu()

virtual DtQmlActionMenu * makVre::DtActionMenuUpdater::qmlActionMenu ( )
virtual

Gets the QML action menu component.

Returns
Pointer to the QML action menu

Provides access to the QML-based action menu for external use. This is useful for components that need to directly interact with the menu's visual representation.

◆ reinitializeQuick()

virtual void makVre::DtActionMenuUpdater::reinitializeQuick ( )
virtual

Reinitializes the quick menu system.

Rebuilds the quick menu system after changes that require a full reinitialization, such as configuration changes or mode switches.

◆ initializeStateAttributes()

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

Initializes state attributes used by the menu system.

Sets up the state attributes needed for menu functionality, such as player state, entity state, and configuration attributes that affect menus.

Reimplemented from makVre::DtPlayerComponent.

◆ initEventMenu()

virtual void makVre::DtActionMenuUpdater::initEventMenu ( )
protectedvirtual

Initializes the event menu.

Sets up the event menu, which displays event notifications and allows interaction with simulation events.

◆ initQuick()

virtual void makVre::DtActionMenuUpdater::initQuick ( )
protectedvirtual

Initializes the quick menu system.

Sets up the quick menu system for context-sensitive interactions. Quick menus appear when the player approaches interactive objects.

◆ shutdownQuick()

virtual void makVre::DtActionMenuUpdater::shutdownQuick ( )
protectedvirtual

Shuts down the quick menu system.

Cleans up resources used by the quick menu system when it's no longer needed.

◆ handleSimState()

virtual makVre::DtVreMessageResult makVre::DtActionMenuUpdater::handleSimState ( makVre::DtVreMessage * msg)
protectedvirtual

Handles simulation state messages.

Parameters
msgPointer to the simulation state message
Returns
Message handling result

Processes simulation state updates that affect menu content and visibility, such as changes to deployable objects or player state.

◆ handleApplicationMode()

virtual makVre::DtVreMessageResult makVre::DtActionMenuUpdater::handleApplicationMode ( makVre::DtVreMessage * msg)
protectedvirtual

Handles application mode change messages.

Parameters
msgPointer to the application mode message
Returns
Message handling result

Processes changes in application mode that affect menu presentation, such as switching between 2D and VR modes or different UI layouts.

Member Data Documentation

◆ myMenuManager

DtMenuManager* makVre::DtActionMenuUpdater::myMenuManager
protected

Pointer to the menu manager.

The menu manager that coordinates all menus for this player station instance. It handles the creation, organization, and display of menus.

◆ myDeployableObjects

std::vector<SimulationStateMessage::EmbeddedEntity> makVre::DtActionMenuUpdater::myDeployableObjects
protected

List of deployable objects available to the player.

Stores information about objects that can be deployed by the player, such as sensors, markers, or other equipment.

◆ myQmlActionMenu

DtQmlActionMenu* makVre::DtActionMenuUpdater::myQmlActionMenu
protected

QML-based action menu component.

The QML implementation of the action menu used for rendering and interaction. QML provides a more modern and flexible UI compared to traditional approaches.

◆ myVrPositionX

int makVre::DtActionMenuUpdater::myVrPositionX
protected

Horizontal position for VR menu rendering.

The X-coordinate for positioning menus in VR mode.

◆ myVrPositionY

int makVre::DtActionMenuUpdater::myVrPositionY
protected

Vertical position for VR menu rendering.

The Y-coordinate for positioning menus in VR mode.


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