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

Detailed Description

This component provides a Qt Quick-based user interface overlay for the spectator role. It displays information, controls, and notifications specific to spectators, allowing them to interact with the simulation through a graphical interface. The overlay manages persistent notifications and provides spectator-specific UI elements.

#include <spectatorOverlay.h>

Inheritance diagram for makVre::DtSpectatorOverlay:
[legend]

Public Member Functions

 DtSpectatorOverlay ()
 
virtual ~DtSpectatorOverlay () override
 
virtual bool initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
 
virtual void tick (double dt) override
 
virtual void shutdown () override
 
virtual void initdoc (QQuickItem *root) override
 
virtual bool isPersistentNotificationVisible ()
 
virtual bool isSpectator ()
 
virtual const char * type () const override
 
- Public Member Functions inherited from makVre::DtQtQuickOverlay
 DtQtQuickOverlay ()
 
virtual ~DtQtQuickOverlay () override
 
virtual bool postInitialize () override
 
virtual void setRoot (QQuickItem *root)
 
virtual DtVreMessageResult handleEnterPlayerState (DtVreMessage *msg)
 
virtual DtVreMessageResult handleExitPlayerState (DtVreMessage *msg)
 
virtual void setVisibility (bool visible)
 
virtual bool isVisible ()
 
virtual void setMenuState (bool on)
 
- 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 Attributes

std::shared_ptr< DtPlayerStationPersistentNotificationmyPersistentNotification
 
bool mySpectator
 
- Protected Attributes inherited from makVre::DtQtQuickOverlay
DtInitTable myBindQmlPropertyToAttribute
 
QQuickItem * myRoot
 
std::string myTargetWindow
 
std::vector< ConnectionmyConnections
 
std::string myQmlFile
 
std::string myQmlDataItemName
 
bool myIsInMenuState
 
bool myCachedVisibility
 
DtAttributeHandleType< bool > myVisibilityAttribute
 
bool myRenderOverlayOnly
 
bool myWantSceneHidden
 
makVrv::DtOsgChannel * myChannel
 
makVrv::DtObserverObject * myObserver
 
QObject myQObject
 
bool myHasTickFunction
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Additional Inherited Members

- Protected Member Functions inherited from makVre::DtQtQuickOverlay
virtual void updateVals (double dt)
 
virtual void disconnect ()
 
virtual bool buildConnections (DtInitTable &connections)
 
virtual void onVisibilityAttributeChanged (bool on)
 
virtual void removeModelSetAndSkyFromChannel ()
 
virtual void restoreModelSetAndSkyToChannel ()
 
- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Constructor & Destructor Documentation

◆ DtSpectatorOverlay()

makVre::DtSpectatorOverlay::DtSpectatorOverlay ( )

Constructor.

Parameters
classNameName of the class (used for logging and identification)

Creates a new spectator overlay with the specified class name

◆ ~DtSpectatorOverlay()

virtual makVre::DtSpectatorOverlay::~DtSpectatorOverlay ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ initialize()

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

Initializes the overlay component.

Parameters
playerPointer to the player station
configReference to the initialization configuration
Returns
True if initialization was successful, false otherwise

Sets up the overlay and loads the Qt Quick UI

Reimplemented from makVre::DtQtQuickOverlay.

References makVre::DtPlayerComponent::player().

◆ tick()

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

Updates overlay state each frame.

Parameters
dtDelta time since the last update in seconds

Updates overlay elements based on current simulation state

Reimplemented from makVre::DtQtQuickOverlay.

◆ shutdown()

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

Performs cleanup when the component is shut down.

Releases overlay resources and cleans up UI elements

Reimplemented from makVre::DtQtQuickOverlay.

◆ initdoc()

virtual void makVre::DtSpectatorOverlay::initdoc ( QQuickItem * root)
overridevirtual

Initializes the Qt Quick document with the root item.

Parameters
rootPointer to the root QQuickItem

Connects Qt Quick signals and slots and initializes UI elements

Reimplemented from makVre::DtQtQuickOverlay.

◆ isPersistentNotificationVisible()

virtual bool makVre::DtSpectatorOverlay::isPersistentNotificationVisible ( )
virtual

Checks if the persistent notification is visible.

Returns
True if the notification is visible, false otherwise

Determines whether the persistent notification is currently displayed

◆ isSpectator()

virtual bool makVre::DtSpectatorOverlay::isSpectator ( )
virtual

Checks if the current player is a spectator.

Returns
True if the player is a spectator, false otherwise

Determines whether the current player is in spectator mode

◆ type()

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

Returns the component type identifier.

Returns
The component type string

Reimplemented from makVre::DtQtQuickOverlay.

Member Data Documentation

◆ myPersistentNotification

std::shared_ptr<DtPlayerStationPersistentNotification> makVre::DtSpectatorOverlay::myPersistentNotification
protected

Shared pointer to the persistent notification.

Manages the persistent notification displayed to the spectator

◆ mySpectator

bool makVre::DtSpectatorOverlay::mySpectator
protected

Flag indicating if the player is in spectator mode.


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